/opt/canhelp/apps/web/.next/cache/webpack/client-production
NameSizeModeActions
0.pack645019950644editdlrm
1.pack6228990644editdlrm
2.pack16053830644editdlrm
3.pack18294750644editdlrm
4.pack13724980644editdlrm
5.pack40780644editdlrm
6.pack18542550644editdlrm
7.pack11179260644editdlrm
8.pack38699010644editdlrm
9.pack40193500644editdlrm
10.pack10927090644editdlrm
11.pack361280644editdlrm
12.pack13004210644editdlrm
13.pack115880644editdlrm
14.pack40780644editdlrm
15.pack214033720644editdlrm
16.pack5411070644editdlrm
17.pack40780644editdlrm
18.pack2954110644editdlrm
19.pack222311380644editdlrm
20.pack2752970644editdlrm
21.pack54214750644editdlrm
index.pack34315280644editdlrm
index.pack.old34732550644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/9.pack (4019350B)
wpcT=webpack/lib/cache/PackFileCacheStrategyPackContentItems `@3FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/lib/api.ts|app-pages-browserDCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/support/page.tsx|app-pages-browser|webpackOCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx|app-pages-browser|webpackDCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/context/location.tsx|app-pages-browser|webpackNCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/become-specialist/page.tsx|app-pages-browser|webpackKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/delete-account/page.tsx|app-pages-browser|webpackFCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/favorites/page.tsx|app-pages-browser|webpackDCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/payment/page.tsx|app-pages-browser|webpackECompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/schedule/page.tsx|app-pages-browser|webpackWCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/FavoriteSpecialistButton.tsx|app-pages-browser|webpackFCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/new/page.tsx|app-pages-browser|webpackMCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx|app-pages-browser|webpack:Compilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/lib/api.ts|app-pages-browser|webpackKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/SupportModal.tsx|app-pages-browser|webpackVCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/Header.tsx|app-pages-browser|ded78a72f604b3ec|webpackCompilation/codeGeneration|webpack/runtime/get javascript chunk filename|webpackCompilation/assets|chunk1240Compilation/assets|chunk4466Compilation/assets|chunk4040Compilation/assets|chunk8974Compilation/assets|chunk8407Compilation/assets|chunk7826Compilation/assets|chunk5442Compilation/assets|chunk1755Compilation/assets|chunk6174Compilation/assets|chunk9478Compilation/assets|chunk8068Compilation/assets|chunk6467Compilation/assets|chunk2982MinifierWebpackPlugin|static/chunks/app/become-specialist/page-1fcacedafff4c9f3.jsMinifierWebpackPlugin|static/chunks/app/delete-account/page-d024a37df379b46c.jsMinifierWebpackPlugin|static/chunks/app/favorites/page-d646fc7e0a9bb0b8.jsMinifierWebpackPlugin|static/chunks/app/page-e20477871325d0e8.jsMinifierWebpackPlugin|static/chunks/app/payment/page-d11da66e06583eba.jsMinifierWebpackPlugin|static/chunks/app/schedule/page-07cc841af3be1da1.jsMinifierWebpackPlugin|static/chunks/app/specialist-setup/page-9fdc55a4c7b8c33b.jsMinifierWebpackPlugin|static/chunks/app/specialists/page-475a8eca95808835.jsMinifierWebpackPlugin|static/chunks/app/support/page-000dedfa8bbfe610.jsMinifierWebpackPlugin|static/chunks/app/tasks/new/page-cebe52b63974323c.jsMinifierWebpackPlugin|static/chunks/webpack-74f4bc92e0a7d443.jsMinifierWebpackPlugin|static/chunks/6467.06a1c0ca06759ccf.jsMinifierWebpackPlugin|static/chunks/2982-aa1cc4952e0e36a5.jsMinifierWebpackPlugin|server/middleware-react-loadable-manifest.jsMinifierWebpackPlugin|server/middleware-build-manifest.jsRealContentHashPlugin|analyse|static/chunks/app/become-specialist/page-1fcacedafff4c9f3.jsRealContentHashPlugin|analyse|static/chunks/app/delete-account/page-d024a37df379b46c.jsRealContentHashPlugin|analyse|static/chunks/app/favorites/page-d646fc7e0a9bb0b8.jsRealContentHashPlugin|analyse|static/chunks/app/page-e20477871325d0e8.jsRealContentHashPlugin|analyse|static/chunks/app/payment/page-d11da66e06583eba.jsRealContentHashPlugin|analyse|static/chunks/app/schedule/page-07cc841af3be1da1.jsRealContentHashPlugin|analyse|static/chunks/app/specialist-setup/page-9fdc55a4c7b8c33b.jsRealContentHashPlugin|analyse|static/chunks/app/specialists/page-475a8eca95808835.jsRealContentHashPlugin|analyse|static/chunks/app/support/page-000dedfa8bbfe610.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/new/page-cebe52b63974323c.jsRealContentHashPlugin|analyse|static/chunks/webpack-74f4bc92e0a7d443.jsRealContentHashPlugin|analyse|static/chunks/6467.06a1c0ca06759ccf.jsRealContentHashPlugin|analyse|static/chunks/2982-aa1cc4952e0e36a5.jsRealContentHashPlugin|analyse|react-loadable-manifest.jsonRealContentHashPlugin|analyse|server/middleware-react-loadable-manifest.jsRealContentHashPlugin|analyse|server/middleware-build-manifest.jsRealContentHashPlugin|generate|static/chunks/webpack-74f4bc92e0a7d443.jsRealContentHashPlugin|generate|react-loadable-manifest.jsonRealContentHashPlugin|generate|server/middleware-react-loadable-manifest.jsRealContentHashPlugin|generate|server/middleware-build-manifest.jswebpack/lib/ModuleGraphRestoreProvidedData@nameprovidedcanMangleProvideterminalBindingexportsInfoacceptOfferactivateUseraddFavoriteaddPortfolioItemaddSpecialistFavoriteadminBroadcastPushadminSendPushToUseradminTopUpUserBalanceadminUpdateSpecialistCardadminWithdrawUserBalanceapplyMyReferralautoTranslateautoTranslateEmailTemplatesautoTranslateTaskscancelTaskcancelTaskAdminߎchangeUserRole݌completeTaskێcreateCategoryَcreateLocation׋createOfferՊcreatePlanӔcreatePriceListGroupѓcreatePriceListItemόcreateReview͋createSkill˔createSpecialistCardɓcreateSupportTicketNJcreateTaskŎdeactivateUserÌdeclineOfferdeleteCategorydeleteLocationdeletePlandeletePortfolioItemdeletePriceListGroupdeletePriceListItemdeleteSkilldeleteSpecialistCarddeleteTaskAdmindisconnectGoogleCalendardismissNotificationgetAdminActivityLogsgetAdminAiLogsgetAdminBalanceHistorygetAdminCategoriesgetAdminEmailTemplatesgetAdminLocationsgetAdminMailLogsgetAdminMailStatsgetAdminNotifLogsgetAdminNotifStatsgetAdminPlansgetAdminReferralsgetAdminReportsgetAdminSettingsgetAdminSkillsgetAdminSpecialistCardsgetAdminStatsgetAdminSupportTicketsgetAdminTasksgetAdminUsergetAdminUserSpecialistCardsgetAdminUsersgetAutoMatchResults}getAutoResponseSettings{getBalanceHistoryygetCanMessagewgetCategoriesugetChatRoomssgetCustomerFomoDashboardqgetDailyUsageogetFavoritesmgetFomoRecommendationskgetGoogleCalendarConnectUrligetGoogleCalendarStatusggetLocationsegetMessagescgetMyAvailabilityagetMyDashboard_getMyOffers]getMyPortfolio[getMyReferralInfoYgetMyReviewsWgetMySpecialistCardsUgetMyStatusesSgetMySupportTicketsQgetMyTasksOgetNotificationsMgetOffersKgetOrCreateDirectRoomIgetPaymentHistoryGgetPlanHistoryEgetPlansCgetPriceListAgetPublicSiteProfile?getSiteStats=getSkillDedup;getSkillSuggestions9getSpecialistAvailability7getSpecialistCards5getSpecialistFavorites3getSpecialistFomoDashboard1getSpecialistPortfolio/getSpecialists-getTask+getTaskBudgetRange)getTaskCountsByCategory'getTaskInvite%getTaskReviews#getTaskStats!getTasksgetTasksForSpecialistgetTasksTranslationPreviewgetTranslationsMissinggetTranslationsStatsgetUnreadCountgetUserProfilegetUserRatinggetUserReviewsimportFromGoogleCalendar initiateTopUp markAllRead markReadmergeSkillDuplicatespreviewPlanChangepurchasePlanremoveFavoriteremoveSpecialistFavoritereplyToSupportTicketrequestrunAutoMatchsaveSiteSeosaveTranslationssearchTaskssendMessagesendPublicSupportMessagesendTestEmailsetAvailabilitysetAvailabilityRangesetSupportTicketStatustestTelegramConnectiontoggleStatustrackSiteMessagetranslateAdminEmailTemplateupdateAdminEmailTemplateupdateAdminSettingsupdateAdminUserupdateAutoResponseSettingsupdateCategoryupdateLocationupdateNotifSettingsupdatePlanupdatePortfolioItemupdatePriceListGroupupdatePriceListItemupdateReportStatusupdateSkillupdateSpecialistCardupdateTaskverifyAdminUserEmailverifyTelegramToken sourcesruntimeRequirementsdatajavascriptwebpack/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 */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource6/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } c8={}_46j@NC J o v   M T z H __ TXptvyy|#&ad:>\_EI2_6z~ d!g!{"~"%%&&&')) **+ +-L--.0.2.@.o/r//020&1)111(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$buffersourcesizemapshashA__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; function SupportPage() { const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: point }) ] }, point)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource6/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24152422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24632470(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25052512(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25632570(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25722586_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined26372644(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26822689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27292736(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28882911(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined35803583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36683672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38553858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39523956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39583961(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44734476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46434646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47784782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52175220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54345438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59805983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62136217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64506454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65516554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68116814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71217125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72907294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74077410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76857688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84318435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85488551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88278830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96329636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97339736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99829985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1066410668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1076510768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101411017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1175511758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182111824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182611840_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1214312146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1233512338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1258212585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1269212706_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined__webpack_require____webpack_require__.n__webpack_require__.r__webpack_exports____webpack_require__.d !webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } a"F_&(]U[ov ?Fhmz_<Dry. < z}TWY\Bad(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)true(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment!/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]); const [activePlanId, setActivePlanId] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const origPlanRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>setMounted(true), []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (true) { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (!isAdmin) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)().then(setPlans).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); }  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : '▼' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } 70155undefined157196undefined198241undefined243294undefined296349undefined597603undefined703712(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined736744(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined11351142(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined11821189(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12401247(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12901297(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13431350(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13841389(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)undefined14021410(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14431451(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14711494trueundefined15961604(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined16501657(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)undefined17281736(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined26062620(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)undefined33023306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35553559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38323835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41804183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43524356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43584366react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined44414444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47584762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52905293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55315534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61126115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64976500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } aR^(4EL >H1;S V 4 : _ h (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext) /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); }  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined g%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 */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } c'={}_!#FHV@G,0il _    -0z}-0$'J-0-0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)f&__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function BecomeSpecialistPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleBecome() { setLoading(true); setError(''); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); }  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); 3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined993996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20922096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21532156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23092313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24582461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26872690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29542958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33183321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34623466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36293632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42924295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45484551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49094912(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50195023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51565159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54035406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55585562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57955798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60456048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64456448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65566560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67016704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69016904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73227325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ,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 */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } c/={}_CESKRx|_KN  @ C Z{~jmQUjn!$ !!""(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default()).__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function DeleteAccountPage() { const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const [reason, setReason] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [confirmed, setConfirmed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [done, setDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: session.user.email }) }), /*#__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-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); }  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); $/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined14151418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15031507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16891692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17861790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17921795(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined21232126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23192322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25082512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined26902693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32233226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35473550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37843787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40844088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined42664269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44874490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44924495(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined48684872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50425046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52435246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56245627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60336036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63216324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65066509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67376741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68386841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71127115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77867790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79697972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83898392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86968699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88818884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined "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 */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } c$={}_JL!*BJaiuAX_CG  l p r u   9=D(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H) __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ function FavoritesPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [favorites, setFavorites] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); }  `__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined728736(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined885906(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined10891112(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined14491452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16031607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17151718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19191923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22292232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24122416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24182421(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined27852788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30783092(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined37853789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40144018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40204023(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45664569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51085111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53975400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58065809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined &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 */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c ={}_')I-;RZ3;_bZ]A D = @ 5 8 .\1W[+.ehDH hk14ad(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_3___default())0&__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status function PaymentPage() { const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); }  __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined819827(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12521272_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined18871890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26252628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28772880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33813384(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36303633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44804483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49514955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51635166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54775480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60836086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62126216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64066409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65726575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67606763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69266930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69326935(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined72177220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75217524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined 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 */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } export default function SchedulePage() { var _session_user; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); useEffect(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } cl={}_JLcq!@HC J q x   P _W  $ j r | )1/7#47 _^ d X"\"""##6$9$$$%%U&Y&' '((1)4)**O+R+e,h,I-M-._...Z0]01122I3L3 5#566+8.899E:I:::<<K=N=f>i>c?f?@_@AAnCqCDEGEsFvF1G5GGGqHuHII2K5KKMOMNNP PQQQQSS V_$VVVWWXXJZMZ[\^]a]^^aa iiiiUjXjtkxkllxm|m.n2npT pBrErzs}s t tttuu||9~<~~~ (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)"https://api.canhelp.gr"0(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)C__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } function SchedulePage() { var _session_user; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const now = new Date(); const [viewYear, setViewYear] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getFullYear()); const [viewMonth, setViewMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [rangeMode, setRangeMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [rangeStatus, setRangeStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [gcalLoading, setGcalLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [gcalToast, setGcalToast] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const today = new Date().toISOString().slice(0, 10); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((year, month)=>{ const key = toMonthKey(year, month); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = "https://api.canhelp.gr" || 0; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); }   __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } export default function SchedulePage() { var _session_user; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); useEffect(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18911905undefined19962005(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined20292037(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20672081(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined21122120(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21892196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22562263(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24172424(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25272534(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26402647(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27322739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27902797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28452852(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29222930(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined34523462(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined34783484(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined36253633(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42384248(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined43204336(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined46554663(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined58365855(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined69336947(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined72207223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75967626"https://api.canhelp.gr"undefined763176530undefined79477953(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined82868292(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined87928796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89178920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91589162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined92709273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94639466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96809684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99909993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1036810372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054510548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1091010914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1108711090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1136511368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159311597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1177611780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1194811951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237812381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267912682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1296912973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1312913132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1360013603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1405814061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1437914382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1474714751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1491714921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1507715081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1537715380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1569115694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597415977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1622716230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1653816541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1684916852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1726217265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1773217735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1803518038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1822518229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1836618370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854518549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1889318896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1925019253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1978719791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2010920112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2050920512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2073620740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2091220915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2146221465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204822052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2218922192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2241522419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2276622770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2311423117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2354923552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390223905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2425524258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2499525003(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2689226896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2704527049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2722127224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2750827512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2765127655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2802428028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2820628210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2870028704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2925029253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2956229565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970629709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991429917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3010830111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3190731911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3231332316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3249032493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3277832781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3303733040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource2/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); 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(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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}R5<0;>(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)/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); }  2/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982);  /* __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(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined450459(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined504511(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined565572(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined793816(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined914934(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10831086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedxy 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 */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg: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 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 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') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 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') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } @`=_#%LNz|57ln24lz_ 3AFMzIP(/  B I _   Z a }  K R u z  ~  _!!""""e#h###$$%%&&H'K'((((+ +++,,,,/_/00z1}122{5555b7e788x;|;;;== >>@@AAeChCEE(F_,FGGLHOH"J%JKKPPbSeSUUuWxW1Y4Y[[{_~_SbWbdd.f1f.h1hi_i jj8k;kllpprrrrssttv v2w5waxdxyyI{M{{{||}_}~~.24<χ҇ݍ֎َ~LPR_UY\\_ϡ+.~gj_}z~TW~"&il#'=AloWDZ"https://api.canhelp.gr"0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(next_link__WEBPACK_IMPORTED_MODULE_3___default())9__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); /* __next_internal_client_entry_do_not_use__ default auto */ const API = "https://api.canhelp.gr" || 0; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; function CreateTaskPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topSpecialists, setTopSpecialists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [deadline, setDeadline] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(30); const [calendarMonth, setCalendarMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const [specialistAvailMap, setSpecialistAvailMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [invitedIds, setInvitedIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const { locationSlug: ctxLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(preselectedCategory); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [photoUploading, setPhotoUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)().then(setCategories).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)().then(setLocations).catch(()=>{}); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = (0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); }  }__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928);  /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg: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 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 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') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 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') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11761190undefined12601269(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12931301(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13311345(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined15531561(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined16061613(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16581665(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17061713(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17531760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18151822(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18651872(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20282035(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20882095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22462251(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined23162323(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23702377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24352442(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24442458_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined25172527(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined25842591(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26502657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26852693(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined28292836(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28912898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29332938(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29512959(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30343046(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30933104(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined31983206(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33203333(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined35453553(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined70787087(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined73997402(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85918595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87188721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89018905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90619064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91839187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined94659468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97099713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99239927(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005610059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1038610389(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1039110408_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1101411018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114711150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1147711480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1148211499_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1218512189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1230212306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1266612669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1302113024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1369113695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380813812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1417814181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1453314536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1522415228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1534115344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1563715641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1588515888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1655316557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1682316826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1725317256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1784317847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1796017964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1818018183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1850818511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1897818981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1933519338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2071820722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2134621349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2194321946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2238922392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283322836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2343223435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444324446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2517125175(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2581125814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2615826161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2667026673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2703127035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2714827151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2744827451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786527869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2883328836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920429208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2932129324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2962029624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2992729930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3021530218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3051430517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3081730820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3111631119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156131565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3167831681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3197431978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3221232216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3250832511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3291132914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3368733690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3460634610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3461234620react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3476734770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3509835101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3558735590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3608736091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3631736321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3656636569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3702037023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775837762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3789137894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3822038224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3848238485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900139004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3951639519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021340217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4034640349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4068040683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140441407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140941423_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4171441717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4228342286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4241842422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4262242625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4288742890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4314643149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4336743370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4365643670(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4441544428(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4466944673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492244926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492844931(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4539645399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4573345736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4620846212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4646246465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4682846832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4713847142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772147724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4816348167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4895748961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4963249636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5002850031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5063950643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5103151034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5195451957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5212052123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedkl Awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource|__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = useState((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [categories, setCategories] = useState((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = useState((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } @b={}_46VXhk"&J M z }  _   mp8<TW'+%,QX#_+;Eo%, 0 i l !"!!!="@"####$$%_%J'M'(())))U-X-..S0W00011334 45566J8Q8t8{88_88899::4;7;;;<<= ===M@P@AAAAjBmBrDuDEFFFG_GGGH H0H7HEHMH]HmHHHHHLLMMMM~NN,O0OOOPP'Q+Q>R_AR3T7TTTWWYY[[]]5^8^!_$_bbccgcAdDd9f=fRgUgWgbg8hHhJj_MjImMm?nBn[p^prrRtYtuuDuKuYuauquu5xLxyy=y@yyyzzK{N{~_~TX36†VYmpeh/_3ɑ̑ {BKckܙW_՛؛15X),hk7:ߢEHƦɦ36(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em"https://api.canhelp.gr"00_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)r__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [phone, setPhone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUrl, setAvatarUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploading, setUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [desc, setDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [suggestions, setSuggestions] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW().then(setAllCategories).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── function SpecialistSetupPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [step, setStep] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [card, setCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepDone, { t: t }), step === 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } sv w|__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); x/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = useState((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [categories, setCategories] = useState((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = useState((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined616619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12811284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15221525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19321935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22832287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23782381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25442548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29382941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33313334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35143517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36933696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40614064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42824285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47484752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined49484951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54155419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59255932(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59695976(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60156022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60706077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61246131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61616166(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61796187(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined62036213_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined70237053"https://api.canhelp.gr"undefined705870800undefined73607390"https://api.canhelp.gr"undefined739574170undefined74517461_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78887898_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined82368240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82978300(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84798482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86538657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87658768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89868990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91419144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93879390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96259629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005810061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1026210265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1062710631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1073610739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1193411937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237112375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1248312486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1271212715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1322913233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1334113344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1357213575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404314046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1441014417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1445214459(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1449814505(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1454514552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1481014833_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1509515099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1515615159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533815341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1551215516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1562415627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1585515858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1646116464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1666016664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1677216775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1700217005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1752217525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1791617923(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1809618103(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1817618183(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1837818385(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1843418441(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1848018487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1850118509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1852518541_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1859918607(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1862318645_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1962319646_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1985119855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1991219915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009420097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2026820272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2038020383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2063320636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2077520779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2105421057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155521559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169721700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247122474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2294222945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2342523429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2400524009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2411724120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2435324356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2533425338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2544325447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2566525668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616926173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2645026453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2645526466_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2668026696(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2721027213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2797727981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2822328226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2876328766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937129374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2977829785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2997429981(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3002030027(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3004130049(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3006530080_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined3077330796_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined3097630980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3103731040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3121931222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3139331396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156331566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3250332507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3259632600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3279432797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325433257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3358733590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3427334277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3449534498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3498234985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3546635469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3582635830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3592635929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3609236095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3646136464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3660536608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3678736790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3696536968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3716737171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3732137324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3764237645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816838172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3826738271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3863838641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3914539159undefined3923439243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3926739275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3930639314(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3934739354(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3938839395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3951139519(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3970039703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3989339896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3998539989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4009740101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4023340236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4047240475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4080840811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4095440958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4114141144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127141274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4145741460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4169541698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4198241985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4230942312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269442697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4280342806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedy{|}^_ webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceu// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "object" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if ("object" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; export const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request("/tasks/".concat(id)); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); export const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); export const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); export const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); export const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); export const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); export const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); export const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; export const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); export const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); export const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request("/admin/users/".concat(id)); export const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); export const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; export const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); export const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; export const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); export const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; export const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; export const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; export const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; export const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; export const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; export const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; export const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; export const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; export const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; export const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; export const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); export const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; export const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); export const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); _25;jp 9?.4jp_ms    q w  + 1 }  <B_CIGM OU"(QW_<B$\bou{_!!""u"{"*#0#q#w###$$"&(&&&8'>'((e)k)))T+Z+,,,_,..002222;3A3}33!4'455B5H555a6g67%7Y7_777h8n89_$9^9d9998:>:::;;;;^=d=>>??x@~@=ACABBCCDDFFG_GGGHHIIOIII:K@KKK?LELLLLLrMxMNNNN OOOORPXPP_QQQ(R.RRRSSST1U7UUUV VVVWWQYWYYZZZ[[a[[[\_\W\]\]]^!^^^&_,_` `P`V```2a8aaaDbJbbb ccycc(d.dzdPdddee:f@fffNgTg hhhh'i-i false0"https://api.canhelp.gr"0false{}e%/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = false ? 0 : "https://api.canhelp.gr" || 0; async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if (false) {} const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request("/tasks/".concat(id)); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request("/admin/users/".concat(id)); const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); fi j&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ ku// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "object" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if ("object" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; export const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request("/tasks/".concat(id)); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); export const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); export const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); export const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); export const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); export const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); export const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); export const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; export const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); export const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); export const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request("/admin/users/".concat(id)); export const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); export const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; export const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); export const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; export const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); export const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; export const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; export const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; export const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; export const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; export const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; export const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; export const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; export const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; export const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; export const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; export const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); export const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; export const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); export const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) });  164187 falseundefined1912450undefined249279"https://api.canhelp.gr"undefined2843060undefined309315undefined415438falseundefined441476{}undefined11301136undefined12741280undefined14411447undefined15411547undefined15931599undefined17571763undefined18381844undefined18981904undefined20192025undefined21572163undefined22682274undefined24542460undefined25322538undefined25862592undefined27092715undefined28182824undefined29292935undefined30843090undefined32463252undefined33713377undefined34533459undefined35883594undefined36443650undefined37323738undefined38173823undefined39073913undefined41674173undefined43014307undefined43644370undefined44314437undefined45424548undefined46424648undefined47534759undefined49454951undefined50135019undefined52655271undefined53475353undefined55175523undefined56525658undefined57855791undefined58405846undefined59485954undefined60616067undefined61386144undefined62806286undefined65856591undefined66536659undefined67896795undefined69426948undefined71337139undefined72607266undefined73897395undefined75357541undefined76407646undefined78037809undefined80948100undefined81528158undefined85838589undefined87048710undefined88218827undefined90029008undefined90739079undefined91889194undefined93589364undefined97629768undefined99119917undefined1004010046undefined1047910485undefined1059710603undefined1070510711undefined1109211098undefined1128511291undefined1148411490undefined1202012026undefined1249312499undefined1297212978undefined1304813054undefined1311513121undefined1318113187undefined1334513351undefined1356813574undefined1363413640undefined1376913775undefined1392113927undefined1411114117undefined1416914175undefined1429614302undefined1444014446undefined1462214628undefined1468614692undefined1482414830undefined1490414910undefined1507515081undefined1524215248undefined1534615352undefined1571015716undefined1605116057undefined1612916135undefined1650416510undefined1670116707undefined1708517091undefined1738617392undefined1763417640undefined1806218068undefined1817818184undefined1839118397undefined1861118617undefined1876118767undefined1882118827undefined1925819264undefined1940919415undefined1951919525undefined1961119617undefined1968419690undefined1982619832undefined1998519991undefined2011920125undefined2023720243undefined2040820414undefined2056220568undefined2073320739undefined2090320909undefined2103221038undefined2121021216undefined2137621382undefined2150121507undefined2180921815undefined2197521981undefined2204222048undefined2224622252undefined2244422450undefined2286522871undefined2303723043undefined2321523221undefined2338723393undefined2351523521undefined2357523581undefined2363923645undefined2403324039undefined2409124097undefined2428824294undefined2435824364undefined2458124587undefined2465624662undefined2472724733undefined2488224888undefined2496724973undefined2515625162undefined2523525241undefined2535325359undefined2546525471undefined2564025646undefined2572225728undefined2578725793undefined2600826014undefined2617026176undefined2631426320undefined2644626452undefined2663426640undefined2675926765undefined2691926925undefinedopQR 0webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceI__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceV*/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useLocale } from '@/context/locale'; import { createSupportTicket } from '@/lib/api'; export default function SupportModal(param) { let { onClose } = param; const { t } = useLocale(); const [type, setType] = useState('bug'); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await createSupportTicket({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ _jsxs("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ _jsx("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } c,={}_ [c>EmtEWeh.2x| _" e h KNY\9<  RV orloT*-.1!!h!k!i"l"J%M%&&&&>(A((0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)X93__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function SupportModal(param) { let { onClose } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); const [type, setType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('bug'); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } Y\ ]I__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); ^V*/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useLocale } from '@/context/locale'; import { createSupportTicket } from '@/lib/api'; export default function SupportModal(param) { let { onClose } = param; const { t } = useLocale(); const [type, setType] = useState('bug'); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await createSupportTicket({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ _jsxs("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ _jsx("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); }  61123undefined125157undefined159203undefined205252undefined254268undefined347355(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined388395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined439446(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined574581(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined621628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13491367(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)undefined16371640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18381842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19801984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21682172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23352338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27022705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined31733176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34683471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36593662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39873990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43774381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined45194522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46974700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51295132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54585462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56425646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57435746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59965999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62946298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68366839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73657369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74667469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77267729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84518455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85528555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88098812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95469549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97319735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98909893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1030210305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined_abcACBD webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } aF_^fOU}$(wzJ@ F a e 4 7 __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._buffersourcesizemapshashz/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [open, setOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const ref = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); var _LOCALES_find; const current = (_LOCALES_find = __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._[0]; // Close on outside click __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.map((loc)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_UoI^ECn  % q @+uAu(0,context_locale/* useLocale */.Y)(0,react.useState)(0,react.useRef)translations/* LOCALES */.YZ(0,react.useEffect)(0,jsx_runtime.jsxs)(0,jsx_runtime.jsx) // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts  +webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } bFmoH __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; }  T/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedEAN(0,auth/* useSession */.wV) // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx  Iwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } @`<_IK}%'LN,>@O_ -7Zc)0dk%*INn_s08V e C K fn$14_y|'+     _ !!!!w#z#|##;%>%@%C%&&&&'"'$'''}((**K-N-////0_03 3~557788::X;f;R<U<'>*>+@.@TBWBDD1F5F7F?FFFFF#I_&IKKOOOOPQSQSSBXFXHXPXXXYY8[;[^^)a-abcLfPfRfUfh_hHkKk_ sv>AMPZ^`h36.1_mqs{ G_JTWad\_        nrt_w47(+e"i"&#,#$$&&D)H)J)R)))))S+XV+X+[+--.!...//T0W0L1O1o2s2%3(3444466__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__.___webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))/*require.resolve*/6467"https://api.canhelp.gr"0__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._w/* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = __WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const pathname = __WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._(); const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [menuOpen, setMenuOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [profileOpen, setProfileOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [supportOpen, setSupportOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [unreadNotif, setUnreadNotif] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [unreadChat, setUnreadChat] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [msgToast, setMsgToast] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [planTier, setPlanTier] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const profileRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const headerRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const toastTimer = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const pathnameRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(pathname); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = __WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; const socket = __WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setPlanTier(null); return; } __WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "truncate max-w-[100px]", children: __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setMenuOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); }  7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined@`]_ c}RqDxT ^ ]}<\ . _  X v O]n;a|&(w_!n[ !&"##$ % %\%%!&#&p&'((g()B*D**+X+Z++[---_-///*0102222344n44557556$7D996<<>??]?@@C]CE_F\HHIJKLL*MN`N2P|P}RRT7UWXYYYYYZZZ<[l]]L``c_8d:ddfgii9nnnnooopPrr`uuxyz6{~~~GV_݇9ԍN.@GA=AEc(tv_îɰyóQSXhjf`KMCE1_!5ODn*h&.d2_TV\^HZJ(*y02*<r_ `r`Zl   ACIK91{GJL_bd:|D    f""$$X((((p))) *++.Y.0:12_2s5556779:o=== >k??}AADDD#EFFHHlKKKLZMMO_OSSS(VtVvVV XjX7ZZ\7]]F^_B`bKbd8e:eee>f@ffhehghhjT=kk ll&mm1nno pTptqqrrr9ttttvw(0,app_dynamic["default"])(0,navigation.useRouter)(0,navigation.usePathname)useEffectiveRole(0,esm.io)(0,api/* getUnreadCount */.$M)(0,api/* getMyDashboard */.H)jsx_runtime.Fragment(link_default())(0,formatName/* formatShortName */.H)(0,auth/* signOut */.CI)LanguageSwitcherJ[ // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx /* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = (0,context_locale/* useLocale */.Y)(); const [open, setOpen] = (0,react.useState)(false); const ref = (0,react.useRef)(null); var _LOCALES_find; const current = (_LOCALES_find = translations/* LOCALES */.YZ.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : translations/* LOCALES */.YZ[0]; // Close on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: translations/* LOCALES */.YZ.map((loc)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = (0,auth/* useSession */.wV)(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx /* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = (0,app_dynamic["default"])(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = (0,navigation.useRouter)(); const pathname = (0,navigation.usePathname)(); const { data: session } = (0,auth/* useSession */.wV)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [menuOpen, setMenuOpen] = (0,react.useState)(false); const [profileOpen, setProfileOpen] = (0,react.useState)(false); const [supportOpen, setSupportOpen] = (0,react.useState)(false); const [unreadNotif, setUnreadNotif] = (0,react.useState)(0); const [unreadChat, setUnreadChat] = (0,react.useState)(0); const [msgToast, setMsgToast] = (0,react.useState)(null); const [planTier, setPlanTier] = (0,react.useState)(null); const profileRef = (0,react.useRef)(null); const headerRef = (0,react.useRef)(null); const toastTimer = (0,react.useRef)(null); const pathnameRef = (0,react.useRef)(pathname); (0,react.useEffect)(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat (0,react.useEffect)(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); (0,react.useEffect)(()=>{ if (!session) return; const socket = (0,esm.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>(0,api/* getUnreadCount */.$M)().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setPlanTier(null); return; } (0,api/* getMyDashboard */.H)().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); (0,react.useEffect)(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "truncate max-w-[100px]", children: (0,formatName/* formatShortName */.H)(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setMenuOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } KN `O // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx  ReplaceSourceO/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138224(0,context_locale/* useLocale */.Y)undefined257341(0,react.useState)undefined367447(0,react.useRef)undefined516585translations/* LOCALES */.YZundefined672736translations/* LOCALES */.YZundefined776862(0,react.useEffect)undefined11671243(0,jsx_runtime.jsxs)undefined13491425(0,jsx_runtime.jsxs)undefined17851859(0,jsx_runtime.jsx)undefined19902064(0,jsx_runtime.jsx)undefined24142488(0,jsx_runtime.jsx)undefined27712845(0,jsx_runtime.jsx)undefined30133082translations/* LOCALES */.YZundefined31093185(0,jsx_runtime.jsxs)undefined36483722(0,jsx_runtime.jsx)undefined38833957(0,jsx_runtime.jsx)undefined42134287(0,jsx_runtime.jsx)undefinedRawSource // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts KT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedz658746(0,auth/* useSession */.wV)undefined10051089(0,react.useState)undefined11021188(0,react.useEffect)undefinedRawSource // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx G7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined"93176(0,app_dynamic["default"])undefined525611(0,navigation.useRouter)undefined637727(0,navigation.usePathname)undefined762850(0,auth/* useSession */.wV)undefined881967(0,context_locale/* useLocale */.Y)undefined10081092(0,react.useState)undefined11441228(0,react.useState)undefined12801364(0,react.useState)undefined14161500(0,react.useState)undefined15461630(0,react.useState)undefined16721756(0,react.useState)undefined18011885(0,react.useState)undefined19171997(0,react.useRef)undefined20282108(0,react.useRef)undefined21402220(0,react.useRef)undefined22532333(0,react.useRef)undefined23502436(0,react.useEffect)undefined25622648(0,react.useEffect)undefined31903291useEffectiveRoleundefined41754261(0,react.useEffect)undefined43594445(0,react.useEffect)undefined45064579(0,esm.io)undefined52305316(0,react.useEffect)undefined54355531(0,api/* getUnreadCount */.$M)undefined57295815(0,react.useEffect)undefined59166012(0,api/* getMyDashboard */.H)undefined63286414(0,react.useEffect)undefined68746950(0,jsx_runtime.jsxs)undefined69527031jsx_runtime.Fragmentundefined70827156(0,jsx_runtime.jsx)undefined73647440(0,jsx_runtime.jsxs)undefined75947670(0,jsx_runtime.jsxs)undefined78917967(0,jsx_runtime.jsxs)undefined79698046(link_default())undefined82838357(0,jsx_runtime.jsx)undefined86688742(0,jsx_runtime.jsx)undefined91119187(0,jsx_runtime.jsxs)undefined94079483(0,jsx_runtime.jsxs)undefined94859564jsx_runtime.Fragmentundefined96879761(0,jsx_runtime.jsx)undefined97639840(link_default())undefined1019010264(0,jsx_runtime.jsx)undefined1026610343(link_default())undefined1074210818(0,jsx_runtime.jsxs)undefined1082010899jsx_runtime.Fragmentundefined1102211096(0,jsx_runtime.jsx)undefined1109811175(link_default())undefined1161111685(0,jsx_runtime.jsx)undefined1168711764(link_default())undefined1217712251(0,jsx_runtime.jsx)undefined1225312330(link_default())undefined1277412848(0,jsx_runtime.jsx)undefined1285012927(link_default())undefined1326513341(0,jsx_runtime.jsxs)undefined1334313422jsx_runtime.Fragmentundefined1354513621(0,jsx_runtime.jsxs)undefined1362313700(link_default())undefined1404214116(0,jsx_runtime.jsx)undefined1466014734(0,jsx_runtime.jsx)undefined1541415488(0,jsx_runtime.jsx)undefined1606616142(0,jsx_runtime.jsxs)undefined1614416221(link_default())undefined1655416628(0,jsx_runtime.jsx)undefined1717117245(0,jsx_runtime.jsx)undefined1787217946(0,jsx_runtime.jsx)undefined1852418600(0,jsx_runtime.jsxs)undefined1888918965(0,jsx_runtime.jsxs)undefined1938719461(0,jsx_runtime.jsx)undefined1965619754(0,formatName/* formatShortName */.H)undefined1999020064(0,jsx_runtime.jsx)undefined2053020604(0,jsx_runtime.jsx)undefined2111721191(0,jsx_runtime.jsx)undefined2174121815(0,jsx_runtime.jsx)undefined2245722533(0,jsx_runtime.jsxs)undefined2287322949(0,jsx_runtime.jsxs)undefined2295123030jsx_runtime.Fragmentundefined2320123277(0,jsx_runtime.jsxs)undefined2327923356(link_default())undefined2391623990(0,jsx_runtime.jsx)undefined2465224726(0,jsx_runtime.jsx)undefined2558025656(0,jsx_runtime.jsxs)undefined2565825735(link_default())undefined2629726371(0,jsx_runtime.jsx)undefined2703327107(0,jsx_runtime.jsx)undefined2821728293(0,jsx_runtime.jsxs)undefined2829528374jsx_runtime.Fragmentundefined2854528621(0,jsx_runtime.jsxs)undefined2862328700(link_default())undefined2926429338(0,jsx_runtime.jsx)undefined3004830122(0,jsx_runtime.jsx)undefined3092731003(0,jsx_runtime.jsxs)undefined3146831542(0,jsx_runtime.jsx)undefined3238532461(0,jsx_runtime.jsxs)undefined3246332540(link_default())undefined3309533169(0,jsx_runtime.jsx)undefined3387833952(0,jsx_runtime.jsx)undefined3470534781(0,jsx_runtime.jsxs)undefined3523635310(0,jsx_runtime.jsx)undefined3615336229(0,jsx_runtime.jsxs)undefined3623136308(link_default())undefined3686836942(0,jsx_runtime.jsx)undefined3760437678(0,jsx_runtime.jsx)undefined3882138897(0,jsx_runtime.jsxs)undefined3889938976(link_default())undefined3949539569(0,jsx_runtime.jsx)undefined4018340257(0,jsx_runtime.jsx)undefined4112241198(0,jsx_runtime.jsxs)undefined4120041277(link_default())undefined4179341869(0,jsx_runtime.jsxs)undefined4256542639(0,jsx_runtime.jsx)undefined4361943693(0,jsx_runtime.jsx)undefined4458444660(0,jsx_runtime.jsxs)undefined4466244739(link_default())undefined4525745331(0,jsx_runtime.jsx)undefined4594546019(0,jsx_runtime.jsx)undefined4685346929(0,jsx_runtime.jsxs)undefined4693147008(link_default())undefined4752847602(0,jsx_runtime.jsx)undefined4821648290(0,jsx_runtime.jsx)undefined4918249256(0,jsx_runtime.jsx)undefined4951449590(0,jsx_runtime.jsxs)undefined5027850352(0,jsx_runtime.jsx)undefined5096651040(0,jsx_runtime.jsx)undefined5196952043(0,jsx_runtime.jsx)undefined5230152377(0,jsx_runtime.jsxs)undefined5280352885(0,auth/* signOut */.CI)undefined5331753391(0,jsx_runtime.jsx)undefined5399154065(0,jsx_runtime.jsx)undefined5517255248(0,jsx_runtime.jsxs)undefined5525055329jsx_runtime.Fragmentundefined5545255526(0,jsx_runtime.jsx)undefined5552855605(link_default())undefined5599056064(0,jsx_runtime.jsx)undefined5606656143(link_default())undefined5664456718(0,jsx_runtime.jsx)undefined5672056815LanguageSwitcherundefined5694257018(0,jsx_runtime.jsxs)undefined5721557289(0,jsx_runtime.jsx)undefined5729157386LanguageSwitcherundefined5744857522(0,jsx_runtime.jsx)undefined5782057894(0,jsx_runtime.jsx)undefined5834058414(0,jsx_runtime.jsx)undefined5872458798(0,jsx_runtime.jsx)undefined5936659442(0,jsx_runtime.jsxs)undefined5965659732(0,jsx_runtime.jsxs)undefined5973459813jsx_runtime.Fragmentundefined5992059996(0,jsx_runtime.jsxs)undefined5999860075(link_default())undefined6041460488(0,jsx_runtime.jsx)undefined6094461018(0,jsx_runtime.jsx)undefined6161561691(0,jsx_runtime.jsxs)undefined6169361770(link_default())undefined6211762191(0,jsx_runtime.jsx)undefined6264762721(0,jsx_runtime.jsx)undefined6345263528(0,jsx_runtime.jsxs)undefined6353063609jsx_runtime.Fragmentundefined6371663792(0,jsx_runtime.jsxs)undefined6379463871(link_default())undefined6422464298(0,jsx_runtime.jsx)undefined6475464828(0,jsx_runtime.jsx)undefined6539465470(0,jsx_runtime.jsxs)undefined6547265549(link_default())undefined6588865962(0,jsx_runtime.jsx)undefined6641866492(0,jsx_runtime.jsx)undefined6716867244(0,jsx_runtime.jsxs)undefined6724667323(link_default())undefined6767467748(0,jsx_runtime.jsx)undefined6820468278(0,jsx_runtime.jsx)undefined6910969185(0,jsx_runtime.jsxs)undefined6918769266jsx_runtime.Fragmentundefined6937369449(0,jsx_runtime.jsxs)undefined6945169528(link_default())undefined6987169945(0,jsx_runtime.jsx)undefined7044970523(0,jsx_runtime.jsx)undefined7116571239(0,jsx_runtime.jsx)undefined7167871754(0,jsx_runtime.jsxs)undefined7175671835jsx_runtime.Fragmentundefined7195872034(0,jsx_runtime.jsxs)undefined7203672113(link_default())undefined7250672580(0,jsx_runtime.jsx)undefined7308473158(0,jsx_runtime.jsx)undefined7379673872(0,jsx_runtime.jsxs)undefined7387473951(link_default())undefined7434274416(0,jsx_runtime.jsx)undefined7492074994(0,jsx_runtime.jsx)undefined7586475940(0,jsx_runtime.jsxs)undefined7594276021jsx_runtime.Fragmentundefined7614476220(0,jsx_runtime.jsxs)undefined7622276299(link_default())undefined7670076774(0,jsx_runtime.jsx)undefined7732777401(0,jsx_runtime.jsx)undefined7806278138(0,jsx_runtime.jsxs)undefined7850778581(0,jsx_runtime.jsx)undefined7921979295(0,jsx_runtime.jsxs)undefined7929779374(link_default())undefined7976179835(0,jsx_runtime.jsx)undefined8033980413(0,jsx_runtime.jsx)undefined8126381339(0,jsx_runtime.jsxs)undefined8134181418(link_default())undefined8177181845(0,jsx_runtime.jsx)undefined8230182375(0,jsx_runtime.jsx)undefined8308083156(0,jsx_runtime.jsxs)undefined8315883235(link_default())undefined8358683660(0,jsx_runtime.jsx)undefined8412184195(0,jsx_runtime.jsx)undefined8484484920(0,jsx_runtime.jsxs)undefined8492284999(link_default())undefined8533885414(0,jsx_runtime.jsxs)undefined8593386007(0,jsx_runtime.jsx)undefined8686786941(0,jsx_runtime.jsx)undefined8759287668(0,jsx_runtime.jsxs)undefined8767087747(link_default())undefined8809688170(0,jsx_runtime.jsx)undefined8863188705(0,jsx_runtime.jsx)undefined8932389399(0,jsx_runtime.jsxs)undefined8958889670(0,auth/* signOut */.CI)undefined9010490178(0,jsx_runtime.jsx)undefined9062590699(0,jsx_runtime.jsx)undefined9137291448(0,jsx_runtime.jsxs)undefined9145091529jsx_runtime.Fragmentundefined9163691710(0,jsx_runtime.jsx)undefined9171291789(link_default())undefined9218792261(0,jsx_runtime.jsx)undefined9226392340(link_default())undefined9291592989(0,jsx_runtime.jsx)undefined9311793193(0,jsx_runtime.jsxs)undefined9340493478(0,jsx_runtime.jsx)undefined9366993745(0,jsx_runtime.jsxs)undefined9389993973(0,jsx_runtime.jsx)undefined9421894292(0,jsx_runtime.jsx)undefined9458094656(0,jsx_runtime.jsxs)undefined9483494908(0,jsx_runtime.jsx)undefined9528995363(0,jsx_runtime.jsx)undefined9536595442(link_default())undefined9595496028(0,jsx_runtime.jsx)undefinedtopLevelDeclarations`jsx_runtimejsx_runtime_namespaceObjectjsx_runtime_defaultapp_dir_linklink_namespaceObjectlink_defaultnavigationauthcontext_localeformatNamereactreact_namespaceObjectreact_defaulttranslationsLanguageSwitcherLanguageSwitcher_namespaceObjectapiesmreadPreviewRoleuseEffectiveRoleuseEffectiveRole_namespaceObjectapp_dynamicSupportModalAPI_URLHeaderHeader_namespaceObject-.*+__webpack_require__.e  runtimewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR// This function allow to reference async chunks __webpack_require__.u = (chunkId) => { // return url for filenames based on template return "static/chunks/" + (chunkId === 9031 ? "e89fb3a8" : chunkId) + "." + {"3542":"bb9abe76cf68d932","6467":"06a1c0ca06759ccf","7797":"7f09b625f84a88e2","9031":"7ade5d06ffa9957d"}[chunkId] + ".js"; };   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1240],{ /***/ 1592: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) buffersourcesizemapshash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 9621:  owebpack/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/RawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); `\Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource_import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); k092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { _import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); k092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991))undefined, /***/ 9991:  oxwebpack/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 g%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 */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } c'={}_!#FHV@G,0il _    -0z}-0$'J-0-0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshashf&__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function BecomeSpecialistPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleBecome() { setLoading(true); setError(''); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined993996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20922096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21532156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23092313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24582461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26872690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29542958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33183321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34623466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36293632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42924295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45484551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49094912(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50195023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51565159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54035406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55585562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57955798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60456048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64456448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65566560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67016704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69016904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73227325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) &/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function BecomeSpecialistPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleBecome() { setLoading(true); setError(''); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } /***/ })   __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); 3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { request } from '@/lib/api'; export default function BecomeSpecialistPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); async function handleBecome() { setLoading(true); setError(''); try { await request('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ _jsx("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ _jsx("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ _jsx("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ _jsx("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ _jsx("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ _jsx("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } R 61123undefined125157undefined159202undefined204243undefined245289undefined291326undefined328342undefined418427(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined451459(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined482490(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined576583(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined706712(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined993996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20922096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21532156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23092313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24582461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26872690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined29542958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33183321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34623466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36293632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42924295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45484551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49094912(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined50195023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51565159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54035406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55585562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57955798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60456048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64456448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65566560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined67016704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69016904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73227325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(9621))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ,(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1240],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 9621: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991)); /***/ }), /***/ 9991: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ BecomeSpecialistPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function BecomeSpecialistPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleBecome() { setLoading(true); setError(''); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/users/me/offer-help', { method: 'POST' }); router.push('/specialist-setup'); } catch (e) { setError(t('common.error')); setLoading(false); } } if (isPending) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const steps = [ { n: 1, title: t('become_specialist.step1.title'), desc: t('become_specialist.step1.desc'), icon: '🗂️' }, { n: 2, title: t('become_specialist.step2.title'), desc: t('become_specialist.step2.desc'), icon: '🔍' }, { n: 3, title: t('become_specialist.step3.title'), desc: t('become_specialist.step3.desc'), icon: '💰' } ]; const benefits = [ { icon: '🎯', text: t('become_specialist.benefit1') }, { icon: '⭐', text: t('become_specialist.benefit2') }, { icon: '📅', text: t('become_specialist.benefit3') }, { icon: '❤️', text: t('become_specialist.benefit4') } ]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl md:text-5xl font-bold mb-4", children: t('become_specialist.hero.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xl text-green-100 mb-8", children: t('become_specialist.hero.subtitle') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-4xl mx-auto px-4 py-16", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-white mb-10 text-center", children: t('become_specialist.how.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid md:grid-cols-3 gap-8", children: steps.map((step)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4", children: step.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3", children: step.n }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-white text-lg mb-2", children: step.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-100 text-sm leading-relaxed", children: step.desc }) ] }, step.n)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "bg-gray-50 py-14 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-8 text-center", children: t('become_specialist.benefits.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid sm:grid-cols-2 gap-4", children: benefits.map((b, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl shrink-0", children: b.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 font-medium leading-snug", children: b.text }) ] }, i)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "py-16 px-4 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-md mx-auto", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-sm mb-4", children: error }), session ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleBecome, disabled: loading, className: "w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition", children: loading ? t('common.loading') : t('profile.become_specialist') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/register", className: "block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center", children: t('profile.become_specialist') }) ] }) }) ] }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(9621))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); {} `)X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1240],{ /***/ 1592: _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504);  import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 9621:  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {  _import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/become-specialist/page.tsx"); k092Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9991))undefined, /***/ 9991: 6 78 }, !PrefixSourceConcatSourceRawSource2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(9621))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } /******/ RawSource]); webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4466],{ /***/ 1592: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) buffersourcesizemapshash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 5845:  iwebpack/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/RawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); `YPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource\import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { \import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623))undefined, /***/ 9623:  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 */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } c/={}_CESKRx|_KN  @ C Z{~jmQUjn!$ !!""(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())buffersourcesizemapshash.__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function DeleteAccountPage() { const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const [reason, setReason] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [confirmed, setConfirmed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [done, setDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: session.user.email }) }), /*#__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-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource$/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined14151418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15031507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16891692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17861790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17921795(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined21232126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23192322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25082512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined26902693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32233226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35473550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37843787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40844088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined42664269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44874490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44924495(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined48684872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50425046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52435246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56245627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60336036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63216324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65066509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67376741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68386841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71127115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77867790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79697972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83898392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86968699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88818884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) S//***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function DeleteAccountPage() { const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const [reason, setReason] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [confirmed, setConfirmed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [done, setDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: session.user.email }) }), /*#__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-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } /***/ })   __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); $/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { createSupportTicket } from '@/lib/api'; export default function DeleteAccountPage() { const { t } = useLocale(); const { data: session } = useSession(); const [reason, setReason] = useState(''); const [confirmed, setConfirmed] = useState(false); const [submitting, setSubmitting] = useState(false); const [done, setDone] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await createSupportTicket({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ _jsxs("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ _jsx(Link, { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ _jsx("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ _jsx("span", { className: "font-medium", children: session.user.email }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ _jsx("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } t 61123undefined125157undefined159187undefined189233undefined235274undefined276323undefined325339undefined389397(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined432441(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined478485(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined530537(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined587594(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined632639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined679686(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined892910(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)undefined14151418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15031507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16891692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17861790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17921795(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined21232126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23192322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25082512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined26902693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28802883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32233226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35473550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37843787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40844088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined42664269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44874490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44924495(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined48684872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50425046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52435246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined56245627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60336036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63216324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65066509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67376741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68386841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71127115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77867790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79697972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined83898392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86968699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88818884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(5845))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); :5(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4466],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 5845: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623)); /***/ }), /***/ 9623: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ DeleteAccountPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function DeleteAccountPage() { const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const [reason, setReason] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [confirmed, setConfirmed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [done, setDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const handleSubmit = async (e)=>{ e.preventDefault(); if (!confirmed || submitting) return; setSubmitting(true); setError(null); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSupportTicket */ .mq)({ type: 'delete_account', subject: 'Account deletion request', body: reason.trim() || 'No reason provided.' }); setDone(true); } catch (err) { var _err_message; setError((_err_message = err === null || err === void 0 ? void 0 : err.message) !== null && _err_message !== void 0 ? _err_message : 'Error'); } finally{ setSubmitting(false); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-extrabold text-gray-900 mb-2", children: t('delete_account.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-8", children: t('delete_account.subtitle') }), done ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-green-50 border border-green-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-green-800 mb-1", children: t('delete_account.success_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('delete_account.success_body') }) ] }) : !(session === null || session === void 0 ? void 0 : session.user) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl bg-amber-50 border border-amber-200 p-6 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-amber-800 mb-4", children: t('delete_account.login_required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/login", className: "inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition", children: t('delete_account.login_btn') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-700", children: t('delete_account.warning') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: session.user.email }) }), /*#__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-sm font-medium text-gray-700 mb-1.5", children: t('delete_account.reason_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reason, onChange: (e)=>setReason(e.target.value), placeholder: t('delete_account.reason_placeholder'), rows: 4, maxLength: 2000, className: "w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-start gap-3 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: confirmed, onChange: (e)=>setConfirmed(e.target.checked), className: "mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('delete_account.confirm_label') }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: !confirmed || submitting, className: "w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition", children: submitting ? t('delete_account.submitting') : t('delete_account.submit') }) ] }) ] }) }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(5845))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  `)X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4466],{ /***/ 1592: , /***/ 5845: \import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/delete-account/page.tsx"); k089Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9623))undefined, /***/ 9623: 123var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(5845))); var __webpack_exports__ = __webpack_require__.O();  Mwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource` webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4040],{ /***/ 1258: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource dwebpack/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 */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CTZbuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) buffersourcesizemapshash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:   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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) 5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504);  import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined, /***/ 3383:  $jwebpack/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 */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } c$={}_JL!*BJaiuAX_CG  l p r u   9=D(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)buffersourcesizemapshash __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ function FavoritesPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [favorites, setFavorites] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource`__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined728736(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined885906(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined10891112(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined14491452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16031607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17151718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19191923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22292232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24122416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24182421(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined27852788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30783092(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined37853789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40144018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40204023(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45664569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51085111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53975400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58065809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) !/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ function FavoritesPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [favorites, setFavorites] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } /***/ })   `__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getSpecialistFavorites, removeSpecialistFavorite } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; export default function FavoritesPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); const [favorites, setFavorites] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; getSpecialistFavorites().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await removeSpecialistFavorite(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ _jsx("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } 661123undefined125168undefined170198undefined200243undefined245284undefined286330undefined332408undefined410460undefined462476undefined545554(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined578586(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined609617(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined660667(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined708715(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined728736(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined885906(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)undefined10891112(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)undefined14491452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16031607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined17151718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19191923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22292232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined24122416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24182421(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined27852788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30783092(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined37853789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40144018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40204023(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45664569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51085111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53975400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58065809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 4381:  _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 Xwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Wimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383))undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4381))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); +,(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4040],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 3383: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FavoritesPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* __next_internal_client_entry_do_not_use__ default auto */ function FavoritesPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [favorites, setFavorites] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) { router.push('/login'); return; } if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSpecialistFavorites */ .pD)().then(setFavorites).catch(()=>{}).finally(()=>setLoading(false)); }, [ session, isPending ]); async function handleRemove(specialistId) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .removeSpecialistFavorite */ .sD)(specialistId).catch(()=>{}); setFavorites((prev)=>prev.filter((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) !== specialistId; })); } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-6", children: t('favorites.specialists.title') }), favorites.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/70", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-4", children: "\uD83E\uDD0D" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-lg", children: t('favorites.specialists.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/specialists", className: "mt-4 inline-block text-white hover:text-white/80 text-sm", children: [ t('specialists.view'), " →" ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: favorites.map((row)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const u = row.specialist; if (!u) return null; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(u.id), className: "flex items-center gap-3 flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 truncate", children: name }), u.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 line-clamp-1", children: u.bio }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleRemove(u.id), title: t('specialist.unfavorite'), className: "flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition", children: "❤️" }) ] }, row.id); }) }) ] }); } /***/ }), /***/ 4381: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4381))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  `4X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[4040],{ /***/ 1258: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined, /***/ 1592: , /***/ 3383: 123, /***/ 4381: Wimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/favorites/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3383))undefinedvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4381))); var __webpack_exports__ = __webpack_require__.O();  F$webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8974],{ /***/ 912: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Rwebpack/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 */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource1/* __next_internal_client_entry_do_not_use__ ShareButton auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; export function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = useState(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } a AT'. 6:<D379A|(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentbuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ShareButton auto */ function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource_/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource1/* __next_internal_client_entry_do_not_use__ ShareButton auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; export function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = useState(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } ]65150undefined152184undefined186192undefined295302(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined774777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10781082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined10841092react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined11511154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13311335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined13371345react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) buffersourcesizemapshash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ShareButton auto */ function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; _/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource1/* __next_internal_client_entry_do_not_use__ ShareButton auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; export function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = useState(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } ]65150undefined152184undefined186192undefined295302(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined774777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10781082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined10841092react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined11511154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13311335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined13371345react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ }), /***/ 1277:  Pwebpack/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/RawSourceX/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceM/* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import Link from 'next/link'; function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; export function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = useState(INITIAL_TIME); useEffect(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ _jsxs("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ _jsx("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ _jsx("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ _jsx("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ _jsx("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } aD_+2GO|vy, /   Jbegj(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_link__WEBPACK_IMPORTED_MODULE_2___default())buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(INITIAL_TIME); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSourceX/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); ReplaceSourceRawSourceM/* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import Link from 'next/link'; function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; export function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = useState(INITIAL_TIME); useEffect(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ _jsxs("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ _jsx("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ _jsx("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ _jsx("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ _jsx("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } ,68130undefined132175undefined177205undefined926932undefined10671074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10951103(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12841288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15541557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17341737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19161920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21662169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23482351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25362539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27152718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33553359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35253528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37863790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39683971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45554558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49624965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49674970(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(INITIAL_TIME); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } /***/ })   X/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); M/* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import Link from 'next/link'; function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; export function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = useState(INITIAL_TIME); useEffect(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ _jsxs("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ _jsx("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ _jsx("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ _jsx("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ _jsx("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } ,68130undefined132175undefined177205undefined926932undefined10671074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10951103(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12841288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15541557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17341737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19161920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21662169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23482351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25362539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27152718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33553359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35253528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37863790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39683971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45554558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49624965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49674970(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined, /***/ 1386:  >swebpack/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/RawSource8/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; import { CategoryIcon } from '@/components/CategoryIcon'; export function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = useRouter(); const [activeParentSlug, setActiveParentSlug] = useState(null); const activeParent = useMemo(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ _jsxs("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ _jsx("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } aF_-/5AGeiks2 5 7 B 6 9   V ruGK"<?qt| (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ezbuffersourcesizemapshash$/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [activeParentSlug, setActiveParentSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const activeParent = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource8/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; import { CategoryIcon } from '@/components/CategoryIcon'; export function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = useRouter(); const [activeParentSlug, setActiveParentSlug] = useState(null); const activeParent = useMemo(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ _jsxs("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ _jsx("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } 70155undefined157198undefined200243undefined245301undefined303309undefined471479(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined536543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined577583(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined16371641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16431651react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined17021705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19921996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23542357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23592370_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ezundefined28702873(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33463350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35293532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38063810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40484051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42404243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44664469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48784881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54065410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined62046207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67696772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72927295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74307433(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 */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [activeParentSlug, setActiveParentSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const activeParent = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } /***/ })   8/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; import { CategoryIcon } from '@/components/CategoryIcon'; export function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = useRouter(); const [activeParentSlug, setActiveParentSlug] = useState(null); const activeParent = useMemo(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ _jsxs("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ _jsx("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } 70155undefined157198undefined200243undefined245301undefined303309undefined471479(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined536543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined577583(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined16371641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16431651react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined17021705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19921996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23542357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23592370_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ezundefined28702873(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33463350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35293532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38063810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40484051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42404243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44664469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48784881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54065410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined62046207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67696772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72927295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74307433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 1592:   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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) 5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504);  import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined, /***/ 2294:  +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/RawSource5/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter } from 'next/navigation'; import { useLocation } from '@/context/location'; import { useLocale } from '@/context/locale'; export function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = useRouter(); const { setLocation } = useLocation(); const { locale } = useLocale(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } a CVY](0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(); const { setLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)(); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource5/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); ReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter } from 'next/navigation'; import { useLocation } from '@/context/location'; import { useLocale } from '@/context/locale'; export function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = useRouter(); const { setLocation } = useLocation(); const { locale } = useLocale(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } U67129undefined131174undefined176224undefined226270undefined272278undefined386394(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined427437(0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)undefined465473(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined770773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11131117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19211924(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 */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(); const { setLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)(); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } /***/ })   5/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906);  /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter } from 'next/navigation'; import { useLocation } from '@/context/location'; import { useLocale } from '@/context/locale'; export function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = useRouter(); const { setLocation } = useLocation(); const { locale } = useLocale(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } U67129undefined131174undefined176224undefined226270undefined272278undefined386394(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined427437(0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)undefined465473(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined770773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11131117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19211924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 4029:  .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 */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } aR^(4EL >H1;S V 4 : _ h (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ReplaceSourceRawSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined /***/ })  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined, /***/ 5940:  /"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 H webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~V06@Clo"https://api.canhelp.gr"0(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(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 */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); 'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 6787:  p&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 */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ HeroSearch auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; export function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = useState(''); const router = useRouter(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } b @~S=D^f37cf(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash- /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* __next_internal_client_entry_do_not_use__ HeroSearch auto */ function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ HeroSearch auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; export function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = useState(''); const router = useRouter(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } "64126undefined128160undefined162205undefined207213undefined317324(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined350358(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined819823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13791382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16711674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19291932(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 */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* __next_internal_client_entry_do_not_use__ HeroSearch auto */ function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* __next_internal_client_entry_do_not_use__ HeroSearch auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; export function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = useState(''); const router = useRouter(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } "64126undefined128160undefined162205undefined207213undefined317324(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined350358(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined819823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13791382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16711674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19291932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 6811:  awebpack/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 */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); }  bL{}Ny(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource?/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } x76123undefined125164undefined166209undefined211255undefined257263undefined377386(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined410418(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined441449(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined681684(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 */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } /***/ })   ?/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } x76123undefined125164undefined166209undefined211255undefined257263undefined377386(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined410418(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined441449(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined681684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 7529:  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/RawSource'import(/* webpackMode: "eager", webpackExports: ["BecomeSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/BecomeSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["FaqAccordion"] */ "/opt/canhelp/apps/web/src/components/FaqAccordion.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HeroSearch"] */ "/opt/canhelp/apps/web/src/components/HeroSearch.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCategoryGrid"] */ "/opt/canhelp/apps/web/src/components/HomeCategoryGrid.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCityCloud"] */ "/opt/canhelp/apps/web/src/components/HomeCityCloud.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["PromoCountdown"] */ "/opt/canhelp/apps/web/src/components/PromoCountdown.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ShareButton"] */ "/opt/canhelp/apps/web/src/components/ShareButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); N$Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))buffersourcesizemapshashPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource'import(/* webpackMode: "eager", webpackExports: ["BecomeSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/BecomeSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["FaqAccordion"] */ "/opt/canhelp/apps/web/src/components/FaqAccordion.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HeroSearch"] */ "/opt/canhelp/apps/web/src/components/HeroSearch.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCategoryGrid"] */ "/opt/canhelp/apps/web/src/components/HomeCategoryGrid.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCityCloud"] */ "/opt/canhelp/apps/web/src/components/HomeCityCloud.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["PromoCountdown"] */ "/opt/canhelp/apps/web/src/components/PromoCountdown.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ShareButton"] */ "/opt/canhelp/apps/web/src/components/ShareButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); t0143Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811))undefined148271Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869))undefined276395Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787))undefined400531Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386))undefined536661Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294))undefined666793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277))undefined798919Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912))undefined9241060Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefined /***/ }) {/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 'import(/* webpackMode: "eager", webpackExports: ["BecomeSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/BecomeSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["FaqAccordion"] */ "/opt/canhelp/apps/web/src/components/FaqAccordion.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HeroSearch"] */ "/opt/canhelp/apps/web/src/components/HeroSearch.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCategoryGrid"] */ "/opt/canhelp/apps/web/src/components/HomeCategoryGrid.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCityCloud"] */ "/opt/canhelp/apps/web/src/components/HomeCityCloud.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["PromoCountdown"] */ "/opt/canhelp/apps/web/src/components/PromoCountdown.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ShareButton"] */ "/opt/canhelp/apps/web/src/components/ShareButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); t0143Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811))undefined148271Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869))undefined276395Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787))undefined400531Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386))undefined536661Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294))undefined666793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277))undefined798919Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912))undefined9241060Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefined, /***/ 9869:  G(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/RawSourcea/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource_ /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; export function FaqAccordion(param) { let { items } = param; const [open, setOpen] = useState(null); return /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ _jsxs("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ _jsx("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } a BV*-lpad(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ function FaqAccordion(param) { let { items } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSourcea/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource_ /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; export function FaqAccordion(param) { let { items } = param; const [open, setOpen] = useState(null); return /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ _jsxs("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ _jsx("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } 66128undefined130162undefined164170undefined257264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined298301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11611164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14091412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16901693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21452148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) y /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ function FaqAccordion(param) { let { items } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } /***/ })   a/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); _ /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; export function FaqAccordion(param) { let { items } = param; const [open, setOpen] = useState(null); return /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ _jsxs("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ _jsx("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } 66128undefined130162undefined164170undefined257264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined298301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11611164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14091412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16901693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21452148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7529))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); d(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8974],{ /***/ 912: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ShareButton auto */ function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } /***/ }), /***/ 1277: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(INITIAL_TIME); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } /***/ }), /***/ 1386: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [activeParentSlug, setActiveParentSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const activeParent = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2294: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)(); const { setLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)(); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } /***/ }), /***/ 4029: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ }), /***/ 5940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }), /***/ 6787: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* __next_internal_client_entry_do_not_use__ HeroSearch auto */ function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } /***/ }), /***/ 6811: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } /***/ }), /***/ 7529: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23)); /***/ }), /***/ 9869: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ function FaqAccordion(param) { let { items } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7529))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  @W(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8974],{ /***/ 912: _/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ShareButton: () => (/* binding */ ShareButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); 1/* __next_internal_client_entry_do_not_use__ ShareButton auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState } from 'react'; export function ShareButton(param) { let { label, copiedLabel } = param; const [copied, setCopied] = useState(false); const handle = async ()=>{ const url = window.location.origin; if (navigator.share) { try { await navigator.share({ url, title: 'CanHelp' }); return; } catch (e) {} } await navigator.clipboard.writeText(url); setCopied(true); setTimeout(()=>setCopied(false), 2500); }; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handle, className: "inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95", children: copied ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "✓" }), copiedLabel ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-lg", children: "\uD83D\uDD17" }), label ] }) }); } ]65150undefined152184undefined186192undefined295302(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined774777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10781082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined10841092react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined11511154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13311335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined13371345react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined14041407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 1277: X/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromoCountdown: () => (/* binding */ PromoCountdown) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); M/* __next_internal_client_entry_do_not_use__ PromoCountdown auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import Link from 'next/link'; function getTimeLeft() { const now = new Date(); const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59) // Dec 31 this year ; const diff = end.getTime() - now.getTime(); if (diff <= 0) return { d: 0, h: 0, m: 0, s: 0 }; const d = Math.floor(diff / (1000 * 60 * 60 * 24)); const h = Math.floor(diff % (1000 * 60 * 60 * 24) / (1000 * 60 * 60)); const m = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60)); const s = Math.floor(diff % (1000 * 60) / 1000); return { d, h, m, s }; } function pad(n) { return String(n).padStart(2, '0'); } const INITIAL_TIME = { d: 0, h: 0, m: 0, s: 0 }; export function PromoCountdown(param) { let { title, subtitle, cta, days, hours, minutes, seconds } = param; const [time, setTime] = useState(INITIAL_TIME); useEffect(()=>{ setTime(getTimeLeft()); const id = setInterval(()=>setTime(getTimeLeft()), 1000); return ()=>clearInterval(id); }, []); return /*#__PURE__*/ _jsxs("div", { className: "relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none" }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83C\uDF81" }), " Pro — Free" ] }), /*#__PURE__*/ _jsx("h2", { className: "text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg", children: title }), /*#__PURE__*/ _jsx("p", { className: "text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium", children: subtitle }), /*#__PURE__*/ _jsx("div", { className: "flex items-end gap-3 md:gap-6 mb-8", children: [ { value: time.d, label: days }, { value: time.h, label: hours }, { value: time.m, label: minutes }, { value: time.s, label: seconds } ].map((unit, i)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-end gap-3 md:gap-6", children: [ i > 0 && /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none", children: ":" }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg", children: /*#__PURE__*/ _jsx("span", { className: "text-3xl md:text-4xl font-extrabold tabular-nums", children: pad(unit.value) }) }), /*#__PURE__*/ _jsx("span", { className: "text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest", children: unit.label }) ] }) ] }, unit.label)) }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200", children: cta }) ] }); } ,68130undefined132175undefined177205undefined926932undefined10671074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10951103(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12841288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined15541557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17341737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19161920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21662169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23482351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25362539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27152718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33553359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35253528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37863790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39683971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45554558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49624965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49674970(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined, /***/ 1386: 8/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCategoryGrid: () => (/* binding */ HomeCategoryGrid) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ HomeCategoryGrid auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; import { CategoryIcon } from '@/components/CategoryIcon'; export function HomeCategoryGrid(param) { let { categories, locale, isSpecialist, allInLabel, categoryLabel, selectLabel, cancelLabel } = param; const router = useRouter(); const [activeParentSlug, setActiveParentSlug] = useState(null); const activeParent = useMemo(()=>{ var _categories_find; return (_categories_find = categories.find((c)=>c.slug === activeParentSlug)) !== null && _categories_find !== void 0 ? _categories_find : null; }, [ categories, activeParentSlug ]); var _activeParent_children; const activeChildren = (_activeParent_children = activeParent === null || activeParent === void 0 ? void 0 : activeParent.children) !== null && _activeParent_children !== void 0 ? _activeParent_children : []; function goToCategory(slug) { router.push(isSpecialist ? "/tasks?category=".concat(slug) : "/tasks/new?category=".concat(slug)); } function handleCategoryClick(cat) { const hasChildren = Array.isArray(cat.children) && cat.children.length > 0; if (isSpecialist || !hasChildren) { goToCategory(cat.slug); return; } setActiveParentSlug(cat.slug); } function closeModal() { setActiveParentSlug(null); } var _activeParent_names_locale; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4", children: categories.map((cat)=>{ var _cat_names_locale, _cat_names_locale1; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleCategoryClick(cat), className: "modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200", children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: (_cat_names_locale = cat.names[locale]) !== null && _cat_names_locale !== void 0 ? _cat_names_locale : cat.names.el, className: "h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight", children: (_cat_names_locale1 = cat.names[locale]) !== null && _cat_names_locale1 !== void 0 ? _cat_names_locale1 : cat.names.el }) ] }, cat.id); }) }), activeParent && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4", children: [ /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute inset-0 bg-black/45", onClick: closeModal, "aria-label": cancelLabel }), /*#__PURE__*/ _jsxs("div", { className: "relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-bold text-gray-900 mb-1", children: categoryLabel }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-4", children: selectLabel }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2 max-h-[55vh] overflow-y-auto pr-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(activeParent.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ allInLabel, " ", (_activeParent_names_locale = activeParent.names[locale]) !== null && _activeParent_names_locale !== void 0 ? _activeParent_names_locale : activeParent.names.el ] }) }), activeChildren.map((sub)=>{ var _sub_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ goToCategory(sub.slug); closeModal(); }, className: "w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition", children: /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: (_sub_names_locale = sub.names[locale]) !== null && _sub_names_locale !== void 0 ? _sub_names_locale : sub.names.el }) }, sub.id); }) ] }), /*#__PURE__*/ _jsx("div", { className: "mt-5 flex justify-end", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: closeModal, className: "px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50", children: cancelLabel }) }) ] }) ] }) ] }); } 70155undefined157198undefined200243undefined245301undefined303309undefined471479(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined536543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined577583(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined16371641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16431651react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined17021705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19921996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23542357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23592370_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_3__/* .CategoryIcon */ .Ezundefined28702873(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33463350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35293532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38063810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40484051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42404243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44664469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46794683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48784881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54065410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined62046207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67696772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined72927295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74307433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 2294: 5/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HomeCityCloud: () => (/* binding */ HomeCityCloud) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7541); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4029); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906);  /* __next_internal_client_entry_do_not_use__ HomeCityCloud auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRouter } from 'next/navigation'; import { useLocation } from '@/context/location'; import { useLocale } from '@/context/locale'; export function HomeCityCloud(param) { let { locationTree, isSpecialist = false } = param; const router = useRouter(); const { setLocation } = useLocation(); const { locale } = useLocale(); const handleClick = (slug)=>{ if (isSpecialist) { router.push("/tasks?location=".concat(slug)); } else { setLocation(slug); router.push('/tasks/new'); } }; if (!locationTree.length) return null; return /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap justify-center gap-3", children: locationTree.map((city)=>{ var _city_names_locale, _city_children; return /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>handleClick(city.slug), className: "inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer", children: [ "\uD83D\uDCCD ", (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names['el'] ] }), ((_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []).map((d)=>{ var _d_names_locale; return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleClick(d.slug), className: "inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer", children: (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names['el'] }, d.id); }) ] }, city.id); }) }); } U67129undefined131174undefined176224undefined226270undefined272278undefined386394(0,next_navigation__WEBPACK_IMPORTED_MODULE_1__.useRouter)undefined427437(0,_context_location__WEBPACK_IMPORTED_MODULE_2__/* .useLocation */ .z)undefined465473(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined770773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined11131117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19211924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 4029: , /***/ 5940: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); 'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 6787: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HeroSearch: () => (/* binding */ HeroSearch) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* __next_internal_client_entry_do_not_use__ HeroSearch auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useRouter } from 'next/navigation'; export function HeroSearch(param) { let { placeholder, mode = 'customer' } = param; const [q, setQ] = useState(''); const router = useRouter(); const handleSubmit = (e)=>{ e.preventDefault(); const trimmed = q.trim(); if (mode === 'specialist') { if (trimmed) router.push("/tasks?q=".concat(encodeURIComponent(trimmed))); else router.push('/tasks'); } else { if (trimmed) router.push("/specialists?q=".concat(encodeURIComponent(trimmed))); else router.push('/specialists'); } }; return /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "relative w-full mb-8", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: q, onChange: (e)=>setQ(e.target.value), placeholder: placeholder, className: "w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm" }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200", "aria-label": "Search", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" }) }) }) ] }); } "64126undefined128160undefined162205undefined207213undefined317324(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined350358(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined819823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13791382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16711674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19291932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 6811: ?/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BecomeSpecialistButton: () => (/* binding */ BecomeSpecialistButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* __next_internal_client_entry_do_not_use__ BecomeSpecialistButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; export function BecomeSpecialistButton(param) { let { className } = param; const { data: session, isPending } = useSession(); const router = useRouter(); const { t } = useLocale(); function handleClick() { if (isPending) return; if (!session) { router.push('/register'); } else { router.push('/become-specialist'); } } return /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleClick, className: className !== null && className !== void 0 ? className : 'btn-outline w-full sm:w-auto text-center', children: t('hero.cta.browse') }); } x76123undefined125164undefined166209undefined211255undefined257263undefined377386(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined410418(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined441449(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined681684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 7529: 'import(/* webpackMode: "eager", webpackExports: ["BecomeSpecialistButton"] */ "/opt/canhelp/apps/web/src/components/BecomeSpecialistButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["FaqAccordion"] */ "/opt/canhelp/apps/web/src/components/FaqAccordion.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HeroSearch"] */ "/opt/canhelp/apps/web/src/components/HeroSearch.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCategoryGrid"] */ "/opt/canhelp/apps/web/src/components/HomeCategoryGrid.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["HomeCityCloud"] */ "/opt/canhelp/apps/web/src/components/HomeCityCloud.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["PromoCountdown"] */ "/opt/canhelp/apps/web/src/components/PromoCountdown.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ShareButton"] */ "/opt/canhelp/apps/web/src/components/ShareButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["__esModule","default"] */ "/opt/canhelp/node_modules/next/dist/client/app-dir/link.js"); t0143Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6811))undefined148271Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9869))undefined276395Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6787))undefined400531Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1386))undefined536661Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2294))undefined666793Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1277))undefined798919Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 912))undefined9241060Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefined, /***/ 9869: a/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FaqAccordion: () => (/* binding */ FaqAccordion) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); _ /* __next_internal_client_entry_do_not_use__ FaqAccordion auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; export function FaqAccordion(param) { let { items } = param; const [open, setOpen] = useState(null); return /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: items.map((item, i)=>{ const isOpen = open === i; return /*#__PURE__*/ _jsxs("div", { className: "modern-card overflow-hidden transition-all duration-200", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center justify-between gap-4 px-6 py-5 text-left", onClick: ()=>setOpen(isOpen ? null : i), children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900 text-base leading-snug", children: item.q }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(isOpen ? 'rotate-45' : ''), children: /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M7 2v10M2 7h10", stroke: "#2563EB", strokeWidth: "2", strokeLinecap: "round" }) }) }) ] }), isOpen && /*#__PURE__*/ _jsx("div", { className: "px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4", children: item.a }) ] }, i); }) }); } 66128undefined130162undefined164170undefined257264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined298301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11611164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined14091412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined16901693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21452148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7529))); var __webpack_exports__ = __webpack_require__.O();  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8407],{ /***/ 2028: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource [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 Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196))undefined /***/ }) buffersourcesizemapshash/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196)); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196))undefined RawSource /***/ }), /***/ 3196:  xwebpack/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 */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c ={}_')I-;RZ3;_bZ]A D = @ 5 8 .\1W[+.ehDH hk14ad(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_3___default())buffersourcesizemapshash0&__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status function PaymentPage() { const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined819827(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12521272_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined18871890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26252628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28772880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33813384(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36303633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44804483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49514955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51635166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54775480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60836086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62126216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64066409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65726575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67606763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69266930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69326935(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined72177220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75217524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) &/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status function PaymentPage() { const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } /***/ })   _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status export default function PaymentPage() { const searchParams = useSearchParams(); const { t } = useLocale(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = useState(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); useEffect(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await api.getPaymentHistory(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ _jsx("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } c61123undefined125168undefined170219undefined221249undefined251295undefined297329undefined492506undefined557571(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined594602(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined732739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined819827(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12521272_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pKundefined18871890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26252628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28772880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33813384(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36303633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42304233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44804483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49514955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51635166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54775480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60836086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62126216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64066409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined65726575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67606763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined69266930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined69326935(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined72177220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75217524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 7541:  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 import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map `/buffersourcesizemapshash/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); ReplaceSourceRawSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined /***/ }) H/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ })   /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); Xexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(2028))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); /(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8407],{ /***/ 2028: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196)); /***/ }), /***/ 3196: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PaymentPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ // Status is determined either by: // 1. ?status=cancelled (from our cancel redirect) // 2. ?ref=ORDER_REF → we poll /payments/history to check the order status function PaymentPage() { const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const statusParam = searchParams.get('status'); const ref = searchParams.get('ref'); const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(statusParam === 'cancelled' ? 'cancelled' : ref ? 'loading' : 'pending'); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (statusParam === 'cancelled') { setStatus('cancelled'); return; } if (!ref) return; // Poll payment history to find the order status let attempts = 0; const MAX = 12 // ~24 seconds total ; const INTERVAL = 2000; const check = async ()=>{ attempts++; try { const history = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPaymentHistory */ .pK(); const payment = history.find((p)=>p.orderRef === ref); if (payment && payment.status !== 'pending') { setStatus(payment.status); return; } } catch (e) {} if (attempts < MAX) { setTimeout(check, INTERVAL); } else { setStatus('pending'); // timeout - show pending message } }; setTimeout(check, INTERVAL); }, [ ref, statusParam ]); const config = { success: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-green-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.success.title'), desc: t('payment.success.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, cancelled: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-yellow-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-yellow-700', bg: 'bg-yellow-50', border: 'border-yellow-200' }, failed: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }) }), title: t('payment.cancelled.title'), desc: t('payment.cancelled.desc'), color: 'text-red-700', bg: 'bg-red-50', border: 'border-red-200' }, pending: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-16 h-16 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" }) }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-green-700', bg: 'bg-green-50', border: 'border-green-200' }, loading: { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-16 h-16 text-gray-400 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), title: t('payment.pending.title'), desc: t('payment.pending.desc'), color: 'text-gray-700', bg: 'bg-gray-50', border: 'border-gray-200' } }; var _config_status; const current = (_config_status = config[status]) !== null && _config_status !== void 0 ? _config_status : config.pending; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border ".concat(current.border, " shadow-sm p-10 max-w-sm w-full text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center mb-5", children: current.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold mb-2 ".concat(current.color), children: current.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-8", children: current.desc }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/profile", className: "inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) }), t('payment.back_to_profile') ] }) ] }) }); } /***/ }), /***/ 7541: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(2028))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  `)X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8407],{ /***/ 2028: Uimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/payment/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3196))undefined, /***/ 3196: , /***/ 7541: /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); Xexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefinedvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(2028))); var __webpack_exports__ = __webpack_require__.O();  D$webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7826],{ /***/ 1592: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) buffersourcesizemapshash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 2861:  ]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 Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); `SPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceVimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); k083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Vimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); k083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807))undefined, /***/ 9807:  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 */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } export default function SchedulePage() { var _session_user; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); useEffect(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } cl={}_JLcq!@HC J q x   P _W  $ j r | )1/7#47 _^ d X"\"""##6$9$$$%%U&Y&' '((1)4)**O+R+e,h,I-M-._...Z0]01122I3L3 5#566+8.899E:I:::<<K=N=f>i>c?f?@_@AAnCqCDEGEsFvF1G5GGGqHuHII2K5KKMOMNNP PQQQQSS V_$VVVWWXXJZMZ[\^]a]^^aa iiiiUjXjtkxkllxm|m.n2npT pBrErzs}s t tttuu||9~<~~~ (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)"https://api.canhelp.gr"0(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshashC__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } function SchedulePage() { var _session_user; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const now = new Date(); const [viewYear, setViewYear] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getFullYear()); const [viewMonth, setViewMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [rangeMode, setRangeMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [rangeStatus, setRangeStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [gcalLoading, setGcalLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [gcalToast, setGcalToast] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const today = new Date().toISOString().slice(0, 10); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((year, month)=>{ const key = toMonthKey(year, month); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = "https://api.canhelp.gr" || 0; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } export default function SchedulePage() { var _session_user; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); useEffect(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18911905undefined19962005(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined20292037(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20672081(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined21122120(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21892196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22562263(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24172424(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25272534(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26402647(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27322739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27902797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28452852(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29222930(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined34523462(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined34783484(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined36253633(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42384248(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined43204336(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined46554663(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined58365855(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined69336947(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined72207223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75967626"https://api.canhelp.gr"undefined763176530undefined79477953(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined82868292(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined87928796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89178920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91589162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined92709273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94639466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96809684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99909993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1036810372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054510548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1091010914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1108711090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1136511368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159311597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1177611780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1194811951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237812381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267912682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1296912973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1312913132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1360013603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1405814061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1437914382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1474714751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1491714921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1507715081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1537715380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1569115694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597415977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1622716230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1653816541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1684916852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1726217265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1773217735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1803518038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1822518229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1836618370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854518549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1889318896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1925019253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1978719791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2010920112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2050920512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2073620740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2091220915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2146221465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204822052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2218922192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2241522419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2276622770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2311423117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2354923552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390223905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2425524258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2499525003(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2689226896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2704527049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2722127224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2750827512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2765127655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2802428028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2820628210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2870028704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2925029253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2956229565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970629709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991429917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3010830111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3190731911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3231332316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3249032493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3277832781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3303733040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } function SchedulePage() { var _session_user; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const now = new Date(); const [viewYear, setViewYear] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getFullYear()); const [viewMonth, setViewMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [rangeMode, setRangeMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [rangeStatus, setRangeStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [gcalLoading, setGcalLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [gcalToast, setGcalToast] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const today = new Date().toISOString().slice(0, 10); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((year, month)=>{ const key = toMonthKey(year, month); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = "https://api.canhelp.gr" || 0; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } /***/ })    __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useCallback } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyAvailability, setAvailability, setAvailabilityRange, request } from '@/lib/api'; const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } export default function SchedulePage() { var _session_user; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { locale, t } = useLocale(); const now = new Date(); const [viewYear, setViewYear] = useState(now.getFullYear()); const [viewMonth, setViewMonth] = useState(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = useState({}); const [saving, setSaving] = useState(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = useState(null); const [rangeMode, setRangeMode] = useState(false); const [rangeStatus, setRangeStatus] = useState('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = useState(null); const [gcalLoading, setGcalLoading] = useState(false); const [gcalToast, setGcalToast] = useState(null); const today = new Date().toISOString().slice(0, 10); useEffect(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = useCallback(()=>{ request('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); useEffect(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = useCallback((year, month)=>{ const key = toMonthKey(year, month); getMyAvailability(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); useEffect(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await setAvailabilityRange(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await setAvailability(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await request('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await request('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ _jsx("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ _jsxs("div", { className: "mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ _jsx("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ _jsx("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ _jsx(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ _jsx("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ _jsx("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ _jsx("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ _jsx("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ _jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ _jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ _jsx("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ _jsxs("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ _jsx("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ _jsx("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ _jsx("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ _jsxs("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ _jsxs("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ _jsx("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ _jsx("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ _jsx("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } 61123undefined125181undefined183243undefined245284undefined286330undefined332425undefined18911905undefined19962005(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined20292037(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined20672081(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined21122120(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined21892196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22562263(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24172424(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25272534(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25812588(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26402647(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27322739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27902797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28452852(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29222930(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined34523462(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined34783484(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined36253633(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42384248(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined43204336(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)undefined46554663(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined58365855(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)undefined69336947(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)undefined72207223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined75967626"https://api.canhelp.gr"undefined763176530undefined79477953(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined82868292(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined87928796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89178920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91589162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined92709273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined94639466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96809684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98139817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99909993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1036810372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054510548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1091010914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1108711090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1136511368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159311597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1177611780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1194811951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237812381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267912682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1296912973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1312913132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1360013603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1405814061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1437914382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1474714751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1491714921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1507715081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1537715380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1569115694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1597415977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1622716230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1653816541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1684916852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1726217265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1773217735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1803518038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1822518229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1836618370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854518549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1889318896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1925019253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1978719791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2010920112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2050920512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2073620740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2091220915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2146221465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204822052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2218922192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2241522419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2276622770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2311423117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2354923552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390223905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2425524258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2499525003(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined2689226896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2704527049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2722127224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2750827512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2765127655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2802428028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2820628210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2870028704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2925029253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2956229565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2970629709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991429917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3010830111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3190731911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3231332316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3249032493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3277832781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3303733040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(2861))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7826],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2861: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807)); /***/ }), /***/ 9807: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SchedulePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const STATUS_CYCLE = { available: 'busy', busy: null }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σά', 'Κυ' ] }; const MONTHS_BY_LOCALE = { ru: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος' ] }; function toMonthKey(year, month) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); } function toDateKey(year, month, day) { return "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0')); } function SchedulePage() { var _session_user; const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const now = new Date(); const [viewYear, setViewYear] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getFullYear()); const [viewMonth, setViewMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(now.getMonth()); // availability map: 'YYYY-MM-DD' → 'available'|'busy' const [avail, setAvail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null) // date being saved ; // Range selection state const [rangeStart, setRangeStart] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [rangeMode, setRangeMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [rangeStatus, setRangeStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('available'); // Google Calendar state const [gcalStatus, setGcalStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [gcalLoading, setGcalLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [gcalToast, setGcalToast] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const today = new Date().toISOString().slice(0, 10); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user, _session_user1; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'specialist' && ((_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.role) !== 'admin') router.push('/profile'); }, [ session, isPending ]); // Load Google Calendar status const loadGcalStatus = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/status').then(setGcalStatus).catch(()=>setGcalStatus({ connected: false })); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadGcalStatus(); // Handle callback redirect params const gcalParam = searchParams.get('gcal'); if (gcalParam === 'connected') { setGcalToast(t('schedule.gcalConnected')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } else if (gcalParam === 'error') { setGcalToast(t('schedule.gcalError')); setTimeout(()=>setGcalToast(null), 5000); router.replace('/schedule'); } }, [ session ]); const loadMonth = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((year, month)=>{ const key = toMonthKey(year, month); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyAvailability */ .iN)(key).then((rows)=>{ setAvail((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; loadMonth(viewYear, viewMonth); // preload next month too const next = new Date(viewYear, viewMonth + 1, 1); loadMonth(next.getFullYear(), next.getMonth()); }, [ session, viewYear, viewMonth, loadMonth ]); function prevMonth() { if (viewMonth === 0) { setViewYear((y)=>y - 1); setViewMonth(11); } else setViewMonth((m)=>m - 1); } function nextMonth() { if (viewMonth === 11) { setViewYear((y)=>y + 1); setViewMonth(0); } else setViewMonth((m)=>m + 1); } async function toggleDay(dateKey) { if (dateKey < today) return; // past — ignore if (rangeMode) { if (!rangeStart) { setRangeStart(dateKey); return; } // Second click — apply range const from = rangeStart < dateKey ? rangeStart : dateKey; const to = rangeStart < dateKey ? dateKey : rangeStart; setRangeStart(null); setSaving('range'); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailabilityRange */ .D1)(from, to, rangeStatus); // Update local state setAvail((prev)=>{ const next = { ...prev }; const cur = new Date(from); const end = new Date(to); while(cur <= end){ const d = cur.toISOString().slice(0, 10); if (d >= today) next[d] = rangeStatus; cur.setDate(cur.getDate() + 1); } return next; }); } catch (e) {} setSaving(null); return; } var _avail_dateKey; const current = (_avail_dateKey = avail[dateKey]) !== null && _avail_dateKey !== void 0 ? _avail_dateKey : null; const next = current === null ? 'available' : STATUS_CYCLE[current]; setSaving(dateKey); // Optimistic setAvail((prev)=>({ ...prev, [dateKey]: next })); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .setAvailability */ .OM)(dateKey, next); } catch (e) { // Revert on error setAvail((prev)=>({ ...prev, [dateKey]: current })); } setSaving(null); } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const role = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (!session || role !== 'specialist' && role !== 'admin') return null; const apiBase = "https://api.canhelp.gr" || 0; async function connectGcal() { window.location.href = "".concat(apiBase, "/api/google/calendar/connect"); } async function disconnectGcal() { if (!confirm(t('schedule.gcalDisconnectConfirm'))) return; setGcalLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/disconnect', { method: 'DELETE' }); setGcalStatus({ connected: false }); } catch (e) {} setGcalLoading(false); } async function importFromGcal() { setGcalLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)('/google/calendar/import', { method: 'POST' }); var _res_imported; setGcalToast(t('schedule.gcalImportDone').replace('{n}', String((_res_imported = res.imported) !== null && _res_imported !== void 0 ? _res_imported : 0))); setTimeout(()=>setGcalToast(null), 5000); // Refresh calendar display loadMonth(viewYear, viewMonth); } catch (e) {} setGcalLoading(false); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ gcalToast && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs", children: gcalToast }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('schedule.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/70 mt-1", children: t('schedule.subtitle') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs", children: "✓" }), t('schedule.available') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs", children: "✗" }), t('schedule.busy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-white/80", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-6 h-6 rounded-lg bg-white/20 border border-white/30" }), t('schedule.unset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-white/50 self-center", children: t('schedule.click_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { onClick: ()=>{ setRangeMode((v)=>!v); setRangeStart(null); }, className: "w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(rangeMode ? 'bg-green-500' : 'bg-gray-200'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(rangeMode ? 'translate-x-5' : 'translate-x-1') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-700", children: t('schedule.range_mode') }) ] }), rangeMode && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 ml-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('available'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'available' ? 'bg-emerald-100 border-emerald-400 text-emerald-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.available') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setRangeStatus('busy'), className: "px-3 py-1 rounded-lg text-sm font-medium border transition ".concat(rangeStatus === 'busy' ? 'bg-red-100 border-red-400 text-red-700' : 'bg-white border-gray-200 text-gray-500'), children: t('schedule.busy') }), rangeStart && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-green-600", children: t('schedule.range_from').replace('{date}', rangeStart) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AvailCalendar, { year: viewYear, month: viewMonth, avail: avail, saving: saving, rangeStart: rangeStart, today: today, onToggle: toggleDay, onPrev: prevMonth, onNext: nextMonth }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "22", height: "22", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { width: "48", height: "48", rx: "8", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z", fill: "#4285F4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z", fill: "#fff" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "18", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "30", cy: "18", r: "2", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "17", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "29", y: "12", width: "2", height: "6", rx: "1", fill: "#DB4437" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: t('schedule.googleCalendar') }) ] }), gcalStatus === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('common.loading') }) : gcalStatus.connected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "#22c55e" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-gray-700", children: [ t('schedule.connectedAs'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: gcalStatus.email }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('schedule.gcalAutoSyncNote') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: importFromGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition", children: gcalLoading ? t('common.loading') : t('schedule.importFromGoogle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: disconnectGcal, disabled: gcalLoading, className: "px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('schedule.disconnectGoogle') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('schedule.gcalConnectDesc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: connectGcal, className: "flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 48 48", fill: "none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z", fill: "#FFC107" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z", fill: "#FF3D00" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z", fill: "#4CAF50" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z", fill: "#1976D2" }) ] }), t('schedule.connectGoogle') ] }) ] }) ] }) ] }); } function AvailCalendar(param) { let { year, month, avail, saving, rangeStart, today, onToggle, onPrev, onNext } = param; const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); // Monday-based: 0=Mon, 6=Sun const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; // Leading days from prev month for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } // Current month days for(let d = 1; d <= daysInMonth; d++){ cells.push({ day: d, cur: true, dateKey: toDateKey(year, month, d) }); } // Trailing days const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } // Count summary — only future dates (>= today) const monthPrefix = toDateKey(year, month, 1).slice(0, 7); const availCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; const busyCount = Object.entries(avail).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'busy'; }).length; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onPrev, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "‹" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "font-semibold text-gray-900", children: [ months[month], " ", year ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-emerald-600 font-medium", children: [ availCount, " ", t('schedule.free') ] }), ' · ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-red-500 font-medium", children: [ busyCount, " ", t('schedule.busy_count') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onNext, className: "w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition", children: "›" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7 border-b border-gray-100", children: weekDays.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-2 text-center text-xs font-medium text-gray-400", children: d }, d)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-7", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-1 h-12 flex items-center justify-center text-sm text-gray-200", children: cell.day }, "empty-".concat(idx)); } var _avail_cell_dateKey; const status = (_avail_cell_dateKey = avail[cell.dateKey]) !== null && _avail_cell_dateKey !== void 0 ? _avail_cell_dateKey : null; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; const isSaving = saving === cell.dateKey; const isRangeStart = rangeStart === cell.dateKey; let cellCls = 'h-12 flex flex-col items-center justify-center rounded-xl m-0.5 text-sm font-medium transition-all select-none '; if (isPast) { cellCls += 'text-gray-200 cursor-default '; } else if (status === 'available') { cellCls += 'bg-emerald-100 border-2 border-emerald-400 text-emerald-700 cursor-pointer hover:bg-emerald-200 '; } else if (status === 'busy') { cellCls += 'bg-red-100 border-2 border-red-400 text-red-700 cursor-pointer hover:bg-red-200 '; } else { cellCls += 'bg-gray-50 border border-gray-200 text-gray-700 cursor-pointer hover:bg-green-50 hover:border-green-300 '; } if (isToday) cellCls += 'ring-2 ring-blue-400 ring-offset-1 '; if (isRangeStart) cellCls += '!ring-2 !ring-green-500 !ring-offset-1 scale-105 '; if (isSaving) cellCls += 'opacity-60 pointer-events-none '; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: cellCls, onClick: ()=>onToggle(cell.dateKey), disabled: isPast || isSaving, title: status === 'available' ? t('schedule.available') : status === 'busy' ? t('schedule.busy') : t('schedule.click_to_set'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: cell.day }), !isPast && status === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-emerald-600", children: t('schedule.available').toLowerCase() }), !isPast && status === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[9px] leading-none text-red-500", children: t('schedule.busy').toLowerCase() }), isSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[8px] text-gray-400", children: "..." }) ] }, cell.dateKey); }) }) ] }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(2861))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  `)X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7826],{ /***/ 1592: , /***/ 2861: Vimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/schedule/page.tsx"); k083Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9807))undefined, /***/ 9807: var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(2861))); var __webpack_exports__ = __webpack_require__.O();  lwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource` webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5442],{ /***/ 1592: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) buffersourcesizemapshash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 5940:  /"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 H webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~V06@Clo"https://api.canhelp.gr"0(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(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 */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); 'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 6073:  mwebpack/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/RawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); `[Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699))undefined, /***/ 6699:  iwebpack/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 Awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource|__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = useState((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [categories, setCategories] = useState((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = useState((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } @b={}_46VXhk"&J M z }  _   mp8<TW'+%,QX#_+;Eo%, 0 i l !"!!!="@"####$$%_%J'M'(())))U-X-..S0W00011334 45566J8Q8t8{88_88899::4;7;;;<<= ===M@P@AAAAjBmBrDuDEFFFG_GGGH H0H7HEHMH]HmHHHHHLLMMMM~NN,O0OOOPP'Q+Q>R_AR3T7TTTWWYY[[]]5^8^!_$_bbccgcAdDd9f=fRgUgWgbg8hHhJj_MjImMm?nBn[p^prrRtYtuuDuKuYuauquu5xLxyy=y@yyyzzK{N{~_~TX36†VYmpeh/_3ɑ̑ {BKckܙW_՛؛15X),hk7:ߢEHƦɦ36(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em"https://api.canhelp.gr"00_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [phone, setPhone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUrl, setAvatarUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploading, setUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [desc, setDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [suggestions, setSuggestions] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW().then(setAllCategories).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── function SpecialistSetupPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [step, setStep] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [card, setCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepDone, { t: t }), step === 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource|__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = useState((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [categories, setCategories] = useState((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = useState((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined616619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12811284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15221525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19321935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22832287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23782381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25442548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29382941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33313334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35143517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36933696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40614064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42824285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47484752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined49484951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54155419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59255932(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59695976(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60156022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60706077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61246131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61616166(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61796187(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined62036213_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined70237053"https://api.canhelp.gr"undefined705870800undefined73607390"https://api.canhelp.gr"undefined739574170undefined74517461_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78887898_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined82368240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82978300(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84798482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86538657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87658768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89868990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91419144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93879390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96259629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005810061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1026210265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1062710631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1073610739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1193411937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237112375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1248312486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1271212715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1322913233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1334113344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1357213575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404314046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1441014417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1445214459(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1449814505(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1454514552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1481014833_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1509515099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1515615159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533815341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1551215516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1562415627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1585515858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1646116464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1666016664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1677216775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1700217005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1752217525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1791617923(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1809618103(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1817618183(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1837818385(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1843418441(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1848018487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1850118509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1852518541_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1859918607(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1862318645_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1962319646_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1985119855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1991219915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009420097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2026820272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2038020383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2063320636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2077520779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2105421057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155521559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169721700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247122474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2294222945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2342523429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2400524009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2411724120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2435324356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2533425338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2544325447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2566525668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616926173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2645026453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2645526466_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2668026696(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2721027213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2797727981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2822328226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2876328766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937129374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2977829785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2997429981(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3002030027(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3004130049(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3006530080_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined3077330796_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined3097630980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3103731040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3121931222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3139331396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156331566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3250332507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3259632600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3279432797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325433257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3358733590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3427334277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3449534498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3498234985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3546635469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3582635830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3592635929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3609236095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3646136464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3660536608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3678736790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3696536968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3716737171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3732137324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3764237645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816838172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3826738271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3863838641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3914539159undefined3923439243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3926739275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3930639314(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3934739354(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3938839395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3951139519(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3970039703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3989339896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3998539989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4009740101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4023340236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4047240475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4080840811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4095440958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4114141144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127141274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4145741460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4169541698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4198241985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4230942312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269442697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4280342806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) 3/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [phone, setPhone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUrl, setAvatarUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploading, setUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [desc, setDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [suggestions, setSuggestions] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW().then(setAllCategories).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── function SpecialistSetupPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [step, setStep] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [card, setCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepDone, { t: t }), step === 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } /***/ })   |__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ _jsx("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ _jsx("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsxs("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ _jsx("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ _jsxs("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ _jsx("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = useState(''); const [phone, setPhone] = useState(''); const [saving, setSaving] = useState(false); const [avatarUrl, setAvatarUrl] = useState(null); const [uploading, setUploading] = useState(false); const fileRef = useRef(null); useEffect(()=>{ api.request('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ _jsx("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ _jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ _jsx("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = useState(''); const [desc, setDesc] = useState(''); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await api.createSpecialistCard({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ _jsx("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ _jsx("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ _jsx("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = useState((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [categories, setCategories] = useState((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = useState([]); const [suggestions, setSuggestions] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getCategories().then(setAllCategories).catch(()=>{}); }, []); useEffect(()=>{ api.getSkillSuggestions(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mb-6", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = useState((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = useState([]); const [saving, setSaving] = useState(false); useEffect(()=>{ api.getLocations().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await api.updateSpecialistCard(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ _jsx(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ _jsxs("div", { className: "text-center py-4", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ _jsx("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ _jsx("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ _jsx("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── export default function SpecialistSetupPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [step, setStep] = useState(1); const [card, setCard] = useState(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ _jsx("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ _jsx(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ _jsx(StepDone, { t: t }), step === 1 && /*#__PURE__*/ _jsx(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ _jsx(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ _jsx(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ _jsx(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ _jsx(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ _jsx("div", { className: "text-center mt-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } .61123undefined125176undefined178221undefined223262undefined264308undefined310342undefined344419undefined616619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12811284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15221525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19321935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22832287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23782381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25442548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined29382941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30943097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33313334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35143517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36933696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined40614064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42824285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47484752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined49484951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54155419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59255932(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined59695976(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60156022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined60706077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61246131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined61616166(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined61796187(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined62036213_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined70237053"https://api.canhelp.gr"undefined705870800undefined73607390"https://api.canhelp.gr"undefined739574170undefined74517461_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined78887898_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined82368240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82978300(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84798482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined86538657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87658768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89868990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91419144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93879390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96259629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005810061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1026210265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1062710631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1073610739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160511608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1193411937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1237112375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1248312486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1271212715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1322913233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1334113344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1357213575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1404314046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1441014417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1445214459(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1449814505(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1454514552(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1481014833_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined1509515099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1515615159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533815341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1551215516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1562415627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1585515858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1646116464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1666016664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1677216775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1700217005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1752217525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1791617923(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1809618103(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1817618183(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1837818385(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1843418441(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1848018487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1850118509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1852518541_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined1859918607(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1862318645_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined1962319646_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1985119855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1991219915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009420097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2026820272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2038020383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2063320636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2077520779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2105421057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2155521559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2169721700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247122474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2294222945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2342523429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2400524009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2411724120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2435324356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2533425338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2544325447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2566525668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616926173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2645026453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2645526466_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined2668026696(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined2721027213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2797727981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2822328226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2876328766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937129374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2977829785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2997429981(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3002030027(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3004130049(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3006530080_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined3077330796_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined3097630980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3103731040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3121931222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3139331396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156331566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3250332507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3259632600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3279432797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3325433257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3358733590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3427334277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3449534498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3498234985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3546635469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3582635830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3592635929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3609236095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3646136464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3660536608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3678736790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3696536968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3716737171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3732137324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3764237645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816838172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3826738271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3863838641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3914539159undefined3923439243(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined3926739275(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3930639314(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined3934739354(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3938839395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3951139519(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3970039703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3989339896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3998539989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4009740101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4023340236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4047240475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4080840811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4095440958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4114141144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4127141274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4145741460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4169541698(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4198241985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4230942312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269442697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4280342806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(6073))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]);  (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5442],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 5940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📦' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }), /***/ 6073: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699)); /***/ }), /***/ 6699: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SpecialistSetupPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TOTAL_STEPS = 5; // ─── Step indicator ──────────────────────────────────────────────────────── function StepIndicator(param) { let { current, total } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-center gap-2 mb-8", children: Array.from({ length: total }, (_, i)=>i + 1).map((n)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(n < current ? 'bg-green-500 text-white' : n === current ? 'bg-green-600 text-white ring-4 ring-blue-200' : 'bg-gray-200 text-gray-400'), children: n < current ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M2 7l4 4 6-6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : n }), n < total && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-0.5 ".concat(n < current ? 'bg-green-500' : 'bg-gray-200') }) ] }, n)) }); } // ─── Step 1: Welcome ─────────────────────────────────────────────────────── function Step1Welcome(param) { let { t, onNext } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#2563eb", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.step1.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.step1.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.step1.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-5 text-left mb-8 max-w-sm mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-700 mb-3", children: t('specialist_setup.step1.what_next') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "space-y-2", children: [ t('specialist_setup.step1.item1'), t('specialist_setup.step1.item2'), t('specialist_setup.step1.item3'), t('specialist_setup.step1.item4'), t('specialist_setup.step1.item5') ].map((item, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "flex items-center gap-2 text-sm text-gray-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0", children: i + 1 }), item ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: onNext, className: "w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition", children: [ t('specialist_setup.next'), " →" ] }) ] }); } // ─── Step 2: Basic profile ───────────────────────────────────────────────── function Step2Profile(param) { let { t, onNext, onBack } = param; const [bio, setBio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [phone, setPhone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUrl, setAvatarUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploading, setUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', {}).then((u)=>{ var _u_bio; setBio((_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : ''); var _u_phone; setPhone((_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : ''); var _u_image; setAvatarUrl((_u_image = u.image) !== null && _u_image !== void 0 ? _u_image : null); }).catch(()=>{}); }, []); async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setAvatarUrl(fullUrl); } catch (e) {} finally{ setUploading(false); if (fileRef.current) fileRef.current.value = ''; } } async function handleSave() { setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ bio: bio || undefined, phone: phone || undefined }) }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step2.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step2.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step2.photo_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center", children: avatarUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: avatarUrl, alt: "", className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#9ca3af", strokeWidth: "2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "7", r: "4" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: uploading, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition", children: uploading ? t('specialist_setup.step2.photo_uploading') : t('specialist_setup.step2.photo_btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('specialist_setup.step2.photo_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.bio_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: bio, onChange: (e)=>setBio(e.target.value), rows: 4, maxLength: 1000, placeholder: t('specialist_setup.step2.bio_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step2.phone_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: phone, onChange: (e)=>setPhone(e.target.value), placeholder: t('specialist_setup.step2.phone_placeholder'), 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 3: Service card ────────────────────────────────────────────────── function Step3Card(param) { let { t, onNext, onBack, onCardCreated } = param; const [title, setTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [desc, setDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSave() { if (!title.trim()) { setError(t('specialist_setup.step3.title_required')); return; } setError(''); setSaving(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: title.trim(), description: desc || undefined }); onCardCreated(card); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step3.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step3.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: title, onChange: (e)=>{ setTitle(e.target.value); if (error) setError(''); }, maxLength: 200, placeholder: t('specialist_setup.step3.title_placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(error ? 'border-red-400' : 'border-gray-300') }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-red-500 text-xs mt-1", children: error }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('specialist_setup.step3.desc_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: desc, onChange: (e)=>setDesc(e.target.value), rows: 5, maxLength: 1000, placeholder: t('specialist_setup.step3.desc_placeholder'), 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 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 4: Skills & Categories ────────────────────────────────────────── function Step4Skills(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_skills; const [skills, setSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card === null || card === void 0 ? void 0 : card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card === null || card === void 0 ? void 0 : card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); const [allCategories, setAllCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [suggestions, setSuggestions] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW().then(setAllCategories).catch(()=>{}); }, []); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(categories.length > 0 ? categories : undefined).then(setSuggestions).catch(()=>{}); }, [ categories ]); function addSkill(s) { const trimmed = s.trim(); if (trimmed && !skills.includes(trimmed)) setSkills([ ...skills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (categories.includes(slug)) { setCategories(categories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setCategories([ ...new Set([ ...categories, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { skills, categories }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step4.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-6", children: t('specialist_setup.step4.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.skills_label') }), skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 mb-2", children: skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSkills(skills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none text-base", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('specialist_setup.step4.skills_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: t('specialist_setup.step4.skills_add') }) ] }), suggestions.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mt-2", children: suggestions.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !skills.includes(name)).slice(0, 12).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('specialist_setup.step4.categories_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3", children: allCategories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: categories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving }) ] }); } // ─── Step 5: Geography ───────────────────────────────────────────────────── function Step5Geography(param) { let { t, onNext, onBack, card, catLocale } = param; var _card_locations; const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card === null || card === void 0 ? void 0 : card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs().then(setLocationTree).catch(()=>{}); }, []); function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (locations.includes(slug)) { setLocations(locations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocations([ ...new Set([ ...locations, slug, ...childSlugs ]) ]); } } async function handleSave() { if (!card) { onNext(); return; } setSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { locations }); onNext(); } catch (e) {} finally{ setSaving(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: t('specialist_setup.step5.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: t('specialist_setup.step5.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-5", children: t('specialist_setup.step5.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-1.5 space-y-1.5", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NavButtons, { t: t, onBack: onBack, onNext: handleSave, loading: saving, isLast: true }) ] }); } // ─── Done screen ─────────────────────────────────────────────────────────── function StepDone(param) { let { t } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: "#16a34a", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M20 6L9 17l-5-5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: t('specialist_setup.done.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-600 font-medium mb-4", children: t('specialist_setup.done.subtitle') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto", children: t('specialist_setup.done.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/profile", className: "px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center", children: t('specialist_setup.go_to_profile') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/tasks", className: "px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center", children: t('specialist_setup.browse_tasks') }) ] }) ] }); } // ─── Navigation buttons ──────────────────────────────────────────────────── function NavButtons(param) { let { t, onBack, onNext, loading, isLast } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onBack, className: "flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition", children: [ "← ", t('specialist_setup.back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onNext, disabled: loading, className: "flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: loading ? '...' : isLast ? t('specialist_setup.finish') : "".concat(t('specialist_setup.next'), " →") }) ] }); } // ─── Main page ───────────────────────────────────────────────────────────── function SpecialistSetupPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [step, setStep] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [card, setCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const catLocale = locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : locale === 'en' ? 'en' : 'el'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); if (isPending || !session) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const isDone = step > TOTAL_STEPS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen py-10 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-lg mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-lg font-semibold text-white/90", children: t('specialist_setup.page_title') }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-white/50 mt-0.5", children: t('specialist_setup.step_of').replace('{current}', String(step)).replace('{total}', String(TOTAL_STEPS)) }) ] }), !isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepIndicator, { current: step, total: TOTAL_STEPS }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-6 shadow-sm", children: [ isDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StepDone, { t: t }), step === 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step1Welcome, { t: t, onNext: ()=>setStep(2) }), step === 2 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step2Profile, { t: t, onNext: ()=>setStep(3), onBack: ()=>setStep(1) }), step === 3 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step3Card, { t: t, onNext: ()=>setStep(4), onBack: ()=>setStep(2), onCardCreated: setCard }), step === 4 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step4Skills, { t: t, onNext: ()=>setStep(5), onBack: ()=>setStep(3), card: card, catLocale: catLocale }), step === 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Step5Geography, { t: t, onNext: ()=>setStep(6), onBack: ()=>setStep(4), card: card, catLocale: catLocale }) ] }), step >= 2 && step <= TOTAL_STEPS && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setStep(step + 1), className: "text-sm text-white/50 hover:text-white/80 transition", children: t('specialist_setup.skip') }) }) ] }) }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(6073))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]);  `4X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5442],{ /***/ 1592: , /***/ 6073: ^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/specialist-setup/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6699))undefined, /***/ 6699: var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(6073))); var __webpack_exports__ = __webpack_require__.O();  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource` webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1755],{ /***/ 1592: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) buffersourcesizemapshash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 2773:  9webpack/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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceP"/* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-700 font-medium' : 'text-gray-700'), onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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_  OQt{58kn0_3swAD    x{ @ (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 */ .VbuffersourcesizemapshashI)/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); /* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; 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' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-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-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); ReplaceSourceRawSourceP"/* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-700 font-medium' : 'text-gray-700'), onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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 }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11891197(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12281236(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13961403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37673771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38933896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39473950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43234327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44004403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46004603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46054622_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined49794983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50565059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52565259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52615278_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined56205624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56975700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58985901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61536157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63646367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67766779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70627065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76087611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81488151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84228425(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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); /* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; 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' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-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-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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 }) ] }); } /***/ })   #/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); P"/* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-700 font-medium' : 'text-gray-700'), onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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 }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11891197(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12281236(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13961403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37673771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38933896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39473950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43234327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44004403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46004603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46054622_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined49794983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50565059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52565259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52615278_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined56205624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56975700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58985901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61536157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63646367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67766779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70627065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76087611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81488151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84228425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 3932:  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/RawSource2/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); 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(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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}R5<0;>(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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ConcatSourceRawSource2/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); 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(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined450459(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined504511(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined565572(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined793816(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined914934(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10831086(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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); } /***/ })   2/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982);  /* __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(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); }  78125undefined127159undefined161200undefined202277undefined279285undefined450459(0,_lib_auth__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .wV)undefined504511(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined565572(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined793816(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .removeSpecialistFavorite */ .sD)undefined914934(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .addSpecialistFavorite */ .V)undefined10831086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 4736:   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__, 3932))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))buffersourcesizemapshash-Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 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"); N0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23)); /***/ })  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"); N0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(4736))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); m9(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1755],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2773: /***/ ((__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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); /* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; 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' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-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-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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 }) ] }); } /***/ }), /***/ 3932: /***/ ((__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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ FavoriteSpecialistButton auto */ function FavoriteSpecialistButton(param) { let { specialistId, initialFavorite = false, favoriteLabel, unfavoriteLabel } = param; 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 (e) {} 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 ".concat(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 ? '❤️' : '🤍' }); } /***/ }), /***/ 4736: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(4736))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); x `4X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1755],{ /***/ 1592: yz{|}~}, /***/ 2773: x#/* 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__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2818); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3119); P"/* __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(param) { let { catTree, locations, initialQ, initialCategory, initialLocation, initialLanguages = [] } = param; const router = useRouter(); const { t, locale } = useLocale(); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const [selectedCategory, setSelectedCategory] = useState(initialCategory !== null && initialCategory !== void 0 ? initialCategory : ''); const [selectedLocation, setSelectedLocation] = useState(initialLocation !== null && initialLocation !== void 0 ? 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".concat(qs.toString() ? '?' + qs.toString() : '')); }; const handleCategoryChange = (slug)=>{ setSelectedCategory(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', slug, selectedLocation, selectedLanguages); }; const handleLocationChange = (slug)=>{ setSelectedLocation(slug); navigate(initialQ !== null && initialQ !== void 0 ? initialQ : '', selectedCategory, slug, selectedLanguages); }; const toggleLanguage = (code)=>{ const next = selectedLanguages.includes(code) ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]; setSelectedLanguages(next); navigate(initialQ !== null && initialQ !== void 0 ? 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 ".concat(checked ? 'bg-green-600 border-green-600' : 'border-gray-300 group-hover:border-green-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 ".concat(checked ? 'text-green-700 font-medium' : 'text-gray-700'), onClick: ()=>toggleLanguage(lang.code), children: lang.label }) ] }, lang.code); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", className: "w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-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 }) ] }); } 78140undefined142174undefined176219undefined221265undefined267335undefined337405undefined10131019undefined11891197(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined12281236(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined13961403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16801687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37673771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38933896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39473950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43234327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined44004403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46004603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46054622_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_4__/* .TaskCategoryPicker */ .Wundefined49794983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50565059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52565259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52615278_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_5__/* .TaskLocationPicker */ .Vundefined56205624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56975700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58985901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61536157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63646367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67766779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70627065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76087611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81488151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84228425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedyzy, /***/ 3932: txyx, /***/ 4736: zimport(/* 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"); N0147Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3932))undefined152299Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2773))undefined304440Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9664, 23))undefineduvu|}~uvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(4736))); var __webpack_exports__ = __webpack_require__.O(); t pXwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource` webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6174],{ /***/ 2928: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Pwebpack/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 // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource `:webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; `_@XX4 4 Q Q ] ] o o z z j j IISs!s!!!""##$$22-4-44444z55__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._buffersourcesizemapshash`</* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((param, n)=>{ let { as: e = "div", ...t } = param; return __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(F()), R = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(null), [z, B] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1), V = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(void 0), H = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(!1), U = O || "cf-turnstile", W = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>typeof window < "u" && !!window.turnstile, []); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ L(F()); }, [ d.execution, P, J ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ !K || typeof D != "function" || D(); }, [ K ]), __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; {"finalSource":false}mapbufferedMap ReplaceSourceRawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefined`_9n*  n DVdF%%%7&M2'''L()Y*88:r::;k;;(0,react.forwardRef)(0,jsx_runtime.jsx)(0,react.useState)(0,react.useEffect)(0,react.useCallback)(0,react.useRef)(0,react.useMemo)(0,react.useImperativeHandle)$ ;// ./src/components/Turnstile.tsx  Mwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } `UL.W?E"0x4AAAAAAC_FtTQJ0_6Cp9-9"__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); }  /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefinedCOSbuffersourcesizemapshashx; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefinedN157245(0,react.forwardRef)undefined313387(0,jsx_runtime.jsx)undefined19021986(0,react.useState)undefined20042090(0,react.useEffect)undefined27572845(0,react.forwardRef)undefined31823272(0,react.useCallback)undefined34763560(0,react.useState)undefined35723652(0,react.useRef)undefined36703754(0,react.useState)undefined37653845(0,react.useRef)undefined38603940(0,react.useRef)undefined39764056(0,react.useRef)undefined42454331(0,react.useEffect)undefined48104892(0,react.useMemo)undefined95429632(0,react.useCallback)undefined96979783(0,react.useEffect)undefined1003410120(0,react.useEffect)undefined1023010316(0,react.useEffect)undefined1073510841(0,react.useImperativeHandle)undefined1446314549(0,react.useEffect)undefined1487614962(0,react.useEffect)undefined1504515131(0,react.useEffect)undefined1521115285(0,jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined2591665(0,jsx_runtime.jsx)undefined667748Sundefined /***/ }) buffersourcesizemapshash;/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /***/ }) {"finalSource":true}mapbufferedMap `ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict";  // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefinedN157245(0,react.forwardRef)undefined313387(0,jsx_runtime.jsx)undefined19021986(0,react.useState)undefined20042090(0,react.useEffect)undefined27572845(0,react.forwardRef)undefined31823272(0,react.useCallback)undefined34763560(0,react.useState)undefined35723652(0,react.useRef)undefined36703754(0,react.useState)undefined37653845(0,react.useRef)undefined38603940(0,react.useRef)undefined39764056(0,react.useRef)undefined42454331(0,react.useEffect)undefined48104892(0,react.useMemo)undefined95429632(0,react.useCallback)undefined96979783(0,react.useEffect)undefined1003410120(0,react.useEffect)undefined1023010316(0,react.useEffect)undefined1073510841(0,react.useImperativeHandle)undefined1446314549(0,react.useEffect)undefined1487614962(0,react.useEffect)undefined1504515131(0,react.useEffect)undefined1521115285(0,jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined2591665(0,jsx_runtime.jsx)undefined667748Sundefined RawSource /***/ }), /***/ 5739:  [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 Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); `RPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Uimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633))undefined, /***/ 7541:  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 import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map `/buffersourcesizemapshash/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); ReplaceSourceRawSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined /***/ }) H/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ })   /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); Xexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined, /***/ 9633:  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 */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource6/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } c8={}_46j@NC J o v   M T z H __ TXptvyy|#&ad:>\_EI2_6z~ d!g!{"~"%%&&&')) **+ +-L--.0.2.@.o/r//020&1)111(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(next_link__WEBPACK_IMPORTED_MODULE_2___default())_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$buffersourcesizemapshashA__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; function SupportPage() { const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: point }) ] }, point)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSource6/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24152422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24632470(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25052512(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25632570(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25722586_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined26372644(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26822689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27292736(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28882911(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined35803583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36683672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38553858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39523956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39583961(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44734476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46434646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47784782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52175220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54345438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59805983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62136217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64506454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65516554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68116814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71217125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72907294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74077410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76857688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84318435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85488551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88278830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96329636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97339736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99829985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1066410668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1076510768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101411017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1175511758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182111824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182611840_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1214312146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1233512338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1258212585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1269212706_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined /***/ }) 8B/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; function SupportPage() { const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: point }) ] }, point)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } /***/ })   __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); 6/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import Link from 'next/link'; import { useLocale } from '@/context/locale'; import { CAPTCHA_ENABLED, TurnstileWidget } from '@/components/Turnstile'; import { sendPublicSupportMessage } from '@/lib/api'; const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; export default function SupportPage() { const { locale, t } = useLocale(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await sendPublicSupportMessage({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-6", children: /*#__PURE__*/ _jsxs(Link, { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ _jsx("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ _jsx("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ _jsxs("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ _jsx("span", { children: point }) ] }, point)) }), /*#__PURE__*/ _jsxs("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ _jsx("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ _jsx("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ _jsx("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || CAPTCHA_ENABLED && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } F61123undefined125157undefined159187undefined189233undefined235308undefined310362undefined21122126undefined21782186(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined23712378(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24152422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24632470(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25052512(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25632570(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25722586_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined26372644(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26822689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27292736(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28882911(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)undefined35803583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36683672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38553858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39523956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined39583961(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined42894292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44734476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46434646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47784782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined50215024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52175220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54345438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56065609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59805983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62136217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64506454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65516554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68116814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined71217125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72907294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74077410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76857688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84318435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85488551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88278830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined96329636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined97339736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99829985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1066410668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1076510768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101411017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1175511758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182111824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1182611840_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$undefined1214312146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1233512338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1258212585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1269212706_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .lundefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(5739))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); x(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6174],{ /***/ 2928: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /***/ }), /***/ 5739: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633)); /***/ }), /***/ 7541: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3041); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useParams")) __webpack_require__.d(__webpack_exports__, { useParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useParams; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "usePathname")) __webpack_require__.d(__webpack_exports__, { usePathname: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.usePathname; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ }), /***/ 9633: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2928); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ const SUPPORT_EMAIL = 'info@canhelp.gr'; const CONTENT = { el: { title: 'Υποστήριξη CanHelp', intro: 'Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.', points: [ 'Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.', 'Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.', 'Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες.' ] }, en: { title: 'CanHelp Support', intro: 'If you need help with the app, email us or use the in-app contact form.', points: [ 'Briefly describe the issue and attach a screenshot if possible.', 'If it is a login problem, include your device and app version.', 'We usually reply within 1-2 business days.' ] }, ru: { title: 'Поддержка CanHelp', intro: 'Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.', points: [ 'Кратко опишите проблему и, если возможно, приложите скриншот.', 'Если проблема со входом, укажите устройство и версию приложения.', 'Обычно мы отвечаем в течение 1-2 рабочих дней.' ] }, uk: { title: 'Підтримка CanHelp', intro: 'Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.', points: [ 'Коротко опишіть проблему та, якщо можливо, додайте скріншот.', 'Якщо проблема зі входом, вкажіть пристрій і версію додатка.', 'Зазвичай ми відповідаємо протягом 1-2 робочих днів.' ] } }; function SupportPage() { const { locale, t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); var _CONTENT_locale; const content = (_CONTENT_locale = CONTENT[locale]) !== null && _CONTENT_locale !== void 0 ? _CONTENT_locale : CONTENT.en; const [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [email, setEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendPublicSupportMessage */ .O8)({ name: name.trim(), email: email.trim(), subject: subject.trim(), body: body.trim(), captchaToken }); setSent(true); } catch (err) { if (((err === null || err === void 0 ? void 0 : err.message) || '').toLowerCase().includes('captcha')) { setError('Security check failed. Please try again.'); setCaptchaToken(''); } else { setError('Failed to send message. Please try again.'); } } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("main", { className: "py-12 px-4 sm:px-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/", className: "text-sm text-green-600 hover:underline", children: [ "← ", t('nav.home') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl font-extrabold text-gray-900 mb-3", children: content.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-600 leading-relaxed", children: content.intro }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-8 space-y-3", children: content.points.map((point)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: point }) ] }, point)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-8 flex flex-col sm:flex-row gap-3 sm:items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "mailto:".concat(SUPPORT_EMAIL), className: "inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition", children: SUPPORT_EMAIL }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('nav.privacy') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-semibold text-gray-900 mb-1", children: "Send a message to support" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "We will forward it directly to the admin team." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: "Name" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: name, onChange: (e)=>setName(e.target.value), required: true, minLength: 2, maxLength: 100, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "Your name" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: email, onChange: (e)=>setEmail(e.target.value), required: true, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "name@example.com" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Subject" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500", placeholder: "What do you need help with?" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: "Message" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 6, className: "w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none", placeholder: "Describe the problem in detail" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }) }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), sent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800", children: "Your message has been sent." }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || _components_Turnstile__WEBPACK_IMPORTED_MODULE_4__/* .CAPTCHA_ENABLED */ .l && !captchaToken, className: "inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50", children: loading ? 'Sending...' : 'Send message' }) ] }) ] }) }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(5739))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); h| `<}X(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6174],{ /***/ 2928: |i| // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js -}5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefinedN157245(0,react.forwardRef)undefined313387(0,jsx_runtime.jsx)undefined19021986(0,react.useState)undefined20042090(0,react.useEffect)undefined27572845(0,react.forwardRef)undefined31823272(0,react.useCallback)undefined34763560(0,react.useState)undefined35723652(0,react.useRef)undefined36703754(0,react.useState)undefined37653845(0,react.useRef)undefined38603940(0,react.useRef)undefined39764056(0,react.useRef)undefined42454331(0,react.useEffect)undefined48104892(0,react.useMemo)undefined95429632(0,react.useCallback)undefined96979783(0,react.useEffect)undefined1003410120(0,react.useEffect)undefined1023010316(0,react.useEffect)undefined1073510841(0,react.useImperativeHandle)undefined1446314549(0,react.useEffect)undefined1487614962(0,react.useEffect)undefined1504515131(0,react.useEffect)undefined1521115285(0,jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx )y/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined2591665(0,jsx_runtime.jsx)undefined667748Sundefinedefe, /***/ 5739: sguUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/support/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9633))undefinedbcbq^qsbcb, /***/ 9633: p]pqrstabahijavar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9664,9906,2982,587,18,7358], () => (__webpack_exec__(5739))); var __webpack_exports__ = __webpack_require__.O(); `klm =webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[9478],{ /***/ 1258: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource dwebpack/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 */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CTZbuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) buffersourcesizemapshash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSource/** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:   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 wwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE"https://api.canhelp.gr"0(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) 5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504);  import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; 052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined, /***/ 2928:  Pwebpack/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 // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource `:webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; `_@XX4 4 Q Q ] ] o o z z j j IISs!s!!!""##$$22-4-44444z55__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._buffersourcesizemapshash`</* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((param, n)=>{ let { as: e = "div", ...t } = param; return __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(F()), R = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(null), [z, B] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(!1), V = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(void 0), H = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._(!1), U = O || "cf-turnstile", W = __WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>typeof window < "u" && !!window.turnstile, []); return __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ L(F()); }, [ d.execution, P, J ]), __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ !K || typeof D != "function" || D(); }, [ K ]), __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; {"finalSource":false}mapbufferedMap ReplaceSourceRawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefined`_9n*  n DVdF%%%7&M2'''L()Y*88:r::;k;;(0,react.forwardRef)(0,jsx_runtime.jsx)(0,react.useState)(0,react.useEffect)(0,react.useCallback)(0,react.useRef)(0,react.useMemo)(0,react.useImperativeHandle)$ ;// ./src/components/Turnstile.tsx  Mwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } `UL.W?E"0x4AAAAAAC_FtTQJ0_6Cp9-9"__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); }  /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefinedCOSbuffersourcesizemapshashx; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSourceReplaceSourceRawSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefinedN157245(0,react.forwardRef)undefined313387(0,jsx_runtime.jsx)undefined19021986(0,react.useState)undefined20042090(0,react.useEffect)undefined27572845(0,react.forwardRef)undefined31823272(0,react.useCallback)undefined34763560(0,react.useState)undefined35723652(0,react.useRef)undefined36703754(0,react.useState)undefined37653845(0,react.useRef)undefined38603940(0,react.useRef)undefined39764056(0,react.useRef)undefined42454331(0,react.useEffect)undefined48104892(0,react.useMemo)undefined95429632(0,react.useCallback)undefined96979783(0,react.useEffect)undefined1003410120(0,react.useEffect)undefined1023010316(0,react.useEffect)undefined1073510841(0,react.useImperativeHandle)undefined1446314549(0,react.useEffect)undefined1487614962(0,react.useEffect)undefined1504515131(0,react.useEffect)undefined1521115285(0,jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined2591665(0,jsx_runtime.jsx)undefined667748Sundefined /***/ }) ;/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /***/ })  ` // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js  ReplaceSource5/* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react"; import { jsx as s } from "react/jsx-runtime"; var c = /*#__PURE__*/ e((param, n)=>{ let { as: e = "div", ...t } = param; return s(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = o(!1); return n(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ e((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = t(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = o(F()), R = a(null), [z, B] = o(!1), V = a(void 0), H = a(!1), U = O || "cf-turnstile", W = a({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); n(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = i(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = t(()=>typeof window < "u" && !!window.turnstile, []); return n(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), n(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), n(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), r(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), n(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), n(()=>{ L(F()); }, [ d.execution, P, J ]), n(()=>{ !K || typeof D != "function" || D(); }, [ K ]), s(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; export { d as DEFAULT_CONTAINER_ID, f as DEFAULT_ONLOAD_NAME, u as DEFAULT_SCRIPT_ID, l as SCRIPT_URL, S as Turnstile }; s 133274undefined276320undefined344344__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined412412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19271927__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined19451945__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined26122612__WEBPACK_MODULE_REFERENCE__1_5b22666f7277617264526566225d_call_directImport_asiSafe1__._undefined29492949__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined31533153__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31653165__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined31833183__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31943194__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32093209__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined32453245__WEBPACK_MODULE_REFERENCE__1_5b22757365526566225d_call_directImport_asiSafe1__._undefined34343434__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined39133913__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined85638563__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined86288628__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined88798879__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined89898989__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined94089408__WEBPACK_MODULE_REFERENCE__1_5b22757365496d706572617469766548616e646c65225d_call_directImport_asiSafe1__._undefined1303013030__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1335713357__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1344013440__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined1352013520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369013809undefinedN157245(0,react.forwardRef)undefined313387(0,jsx_runtime.jsx)undefined19021986(0,react.useState)undefined20042090(0,react.useEffect)undefined27572845(0,react.forwardRef)undefined31823272(0,react.useCallback)undefined34763560(0,react.useState)undefined35723652(0,react.useRef)undefined36703754(0,react.useState)undefined37653845(0,react.useRef)undefined38603940(0,react.useRef)undefined39764056(0,react.useRef)undefined42454331(0,react.useEffect)undefined48104892(0,react.useMemo)undefined95429632(0,react.useCallback)undefined96979783(0,react.useEffect)undefined1003410120(0,react.useEffect)undefined1023010316(0,react.useEffect)undefined1073510841(0,react.useImperativeHandle)undefined1446314549(0,react.useEffect)undefined1487614962(0,react.useEffect)undefined1504515131(0,react.useEffect)undefined1521115285(0,jsx_runtime.jsx)undefinedRawSource$ ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { Turnstile } from '@marsidev/react-turnstile'; var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY) !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ export const CAPTCHA_ENABLED = !!SITE_KEY; export function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ _jsx(Turnstile, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } 85132undefined134187undefined302343"0x4AAAAAAC_FtTQJ0_6Cp9-9"undefined532538undefined575581undefined723726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined728736__WEBPACK_MODULE_REFERENCE__2_5b225475726e7374696c65225d_directImport_asiSafe1__._undefined2591665(0,jsx_runtime.jsx)undefined667748Sundefined, /***/ 4029:  .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 */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } aR^(4EL >H1;S V 4 : _ h (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)buffersourcesizemapshash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ReplaceSourceRawSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined /***/ })  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined, /***/ 5338:   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 */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceWexport 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)); } buffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); 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)); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); ReplaceSourceRawSourceWexport 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 /***/ }) S/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); 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)); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); 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, /***/ 6261:  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 */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg: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 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 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') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 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') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } @`=_#%LNz|57ln24lz_ 3AFMzIP(/  B I _   Z a }  K R u z  ~  _!!""""e#h###$$%%&&H'K'((((+ +++,,,,/_/00z1}122{5555b7e788x;|;;;== >>@@AAeChCEE(F_,FGGLHOH"J%JKKPPbSeSUUuWxW1Y4Y[[{_~_SbWbdd.f1f.h1hi_i jj8k;kllpprrrrssttv v2w5waxdxyyI{M{{{||}_}~~.24<χ҇ݍ֎َ~LPR_UY\\_ϡ+.~gj_}z~TW~"&il#'=AloWDZ"https://api.canhelp.gr"0(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(next_link__WEBPACK_IMPORTED_MODULE_3___default())buffersourcesizemapshash9__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); /* __next_internal_client_entry_do_not_use__ default auto */ const API = "https://api.canhelp.gr" || 0; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; function CreateTaskPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topSpecialists, setTopSpecialists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [deadline, setDeadline] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(30); const [calendarMonth, setCalendarMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const [specialistAvailMap, setSpecialistAvailMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [invitedIds, setInvitedIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const { locationSlug: ctxLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(preselectedCategory); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [photoUploading, setPhotoUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)().then(setCategories).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)().then(setLocations).catch(()=>{}); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = (0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource}__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); ReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg: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 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 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') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 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') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11761190undefined12601269(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12931301(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13311345(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined15531561(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined16061613(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16581665(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17061713(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17531760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18151822(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18651872(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20282035(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20882095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22462251(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined23162323(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23702377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24352442(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24442458_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined25172527(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined25842591(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26502657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26852693(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined28292836(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28912898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29332938(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29512959(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30343046(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30933104(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined31983206(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33203333(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined35453553(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined70787087(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined73997402(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85918595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87188721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89018905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90619064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91839187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined94659468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97099713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99239927(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005610059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1038610389(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1039110408_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1101411018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114711150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1147711480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1148211499_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1218512189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1230212306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1266612669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1302113024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1369113695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380813812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1417814181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1453314536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1522415228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1534115344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1563715641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1588515888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1655316557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1682316826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1725317256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1784317847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1796017964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1818018183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1850818511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1897818981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1933519338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2071820722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2134621349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2194321946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2238922392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283322836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2343223435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444324446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2517125175(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2581125814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2615826161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2667026673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2703127035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2714827151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2744827451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786527869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2883328836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920429208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2932129324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2962029624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2992729930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3021530218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3051430517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3081730820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3111631119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156131565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3167831681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3197431978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3221232216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3250832511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3291132914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3368733690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3460634610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3461234620react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3476734770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3509835101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3558735590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3608736091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3631736321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3656636569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3702037023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775837762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3789137894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3822038224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3848238485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900139004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3951639519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021340217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4034640349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4068040683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140441407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140941423_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4171441717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4228342286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4241842422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4262242625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4288742890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4314643149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4336743370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4365643670(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4441544428(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4466944673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492244926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492844931(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4539645399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4573345736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4620846212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4646246465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4682846832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4713847142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772147724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4816348167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4895748961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4963249636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5002850031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5063950643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5103151034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5195451957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5212052123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); /* __next_internal_client_entry_do_not_use__ default auto */ const API = "https://api.canhelp.gr" || 0; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; function CreateTaskPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topSpecialists, setTopSpecialists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [deadline, setDeadline] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(30); const [calendarMonth, setCalendarMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const [specialistAvailMap, setSpecialistAvailMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [invitedIds, setInvitedIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const { locationSlug: ctxLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(preselectedCategory); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [photoUploading, setPhotoUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)().then(setCategories).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)().then(setLocations).catch(()=>{}); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = (0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } /***/ })   }__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928);  /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { useLocation } from '@/context/location'; import { createTask, getCategories, getLocations, getSpecialists } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { TaskLocationPicker } from '@/components/TaskLocationPicker'; import { TaskCategoryPicker } from '@/components/TaskCategoryPicker'; import { TurnstileWidget } from '@/components/Turnstile'; import { CAPTCHA_ENABLED } from '@/components/Turnstile'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; export default function CreateTaskPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = useLocale(); const [categories, setCategories] = useState([]); const [locations, setLocations] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [topSpecialists, setTopSpecialists] = useState([]); const [deadline, setDeadline] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = useState(30); const [calendarMonth, setCalendarMonth] = useState(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = useRef(null); const [specialistAvailMap, setSpecialistAvailMap] = useState({}); const [invitedIds, setInvitedIds] = useState(new Set()); const [captchaToken, setCaptchaToken] = useState(CAPTCHA_ENABLED ? '' : 'dev'); const { locationSlug: ctxLocation } = useLocation(); const [selectedLocation, setSelectedLocation] = useState(''); const [selectedCategory, setSelectedCategory] = useState(preselectedCategory); useEffect(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = useState([]); const [photoUploading, setPhotoUploading] = useState(false); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); getCategories().then(setCategories).catch(()=>{}); getLocations().then(setLocations).catch(()=>{}); }, [ session, isPending ]); useEffect(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } getSpecialists({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); useEffect(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await createTask({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ _jsx("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ _jsx(TaskCategoryPicker, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ _jsx(TaskLocationPicker, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ _jsx("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ _jsx("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ _jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ _jsx("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ _jsx("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ _jsx("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ _jsxs("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ _jsx("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ _jsx("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ _jsx("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ _jsx("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ _jsxs("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ _jsx("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ _jsx("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ _jsx("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ _jsx(TurnstileWidget, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ _jsx("aside", { className: "hidden lg:block lg: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 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = formatShortName(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = formatLastSeen(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ _jsx("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 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') ] }), avail === 'busy' && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 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') ] }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "px-2 pb-2", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } *61146undefined148199undefined201261undefined263291undefined293332undefined334378undefined380428undefined430513undefined515565undefined567620undefined622690undefined692760undefined762818undefined820876undefined890920"https://api.canhelp.gr"undefined9259470undefined11761190undefined12601269(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12931301(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined13311345(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined15531561(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined16061613(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16581665(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17061713(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17531760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18151822(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18651872(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20282035(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20882095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22462251(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined23162323(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23702377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24352442(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24442458_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .lundefined25172527(0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)undefined25842591(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26502657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26852693(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined28292836(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28912898(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29332938(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined29512959(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined30343046(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)undefined30933104(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)undefined31983206(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined33203333(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)undefined35453553(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined70787087(0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)undefined73997402(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85918595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87188721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89018905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90619064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined91839187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined94659468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97099713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99239927(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1005610059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1038610389(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1039110408_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .Wundefined1101411018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1114711150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1147711480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1148211499_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .Vundefined1218512189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1230212306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1266612669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1302113024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1369113695(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380813812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1417814181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1453314536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1522415228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1534115344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1563715641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1588515888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1655316557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1682316826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1725317256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1784317847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1796017964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1818018183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1850818511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1897818981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1933519338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2071820722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2134621349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2194321946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2238922392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283322836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2343223435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444324446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2517125175(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2581125814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2615826161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2667026673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2703127035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2714827151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2744827451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786527869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2883328836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2920429208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2932129324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2962029624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2992729930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3021530218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3051430517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3081730820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3111631119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3156131565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3167831681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3197431978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3221232216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3250832511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3291132914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3368733690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3460634610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3461234620react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3476734770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3509835101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3558735590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3608736091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3631736321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3656636569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3702037023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775837762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3789137894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3822038224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3848238485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900139004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3951639519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021340217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4034640349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4068040683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140441407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4140941423_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$undefined4171441717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4228342286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4241842422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4262242625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4288742890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4314643149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4336743370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4365643670(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)undefined4441544428(0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)undefined4466944673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492244926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4492844931(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined4539645399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4573345736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4620846212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4646246465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4682846832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4713847142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772147724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4816348167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4895748961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4963249636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5002850031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5063950643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5103151034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5195451957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5212052123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 7029:  _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 Xwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); `TPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Wimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261))undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(7029))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); d I(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[9478],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "Иван Петров" → "Иван П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(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 === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2928: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: () => (/* binding */ CAPTCHA_ENABLED), $: () => (/* binding */ TurnstileWidget) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); ;// ../../node_modules/@marsidev/react-turnstile/dist/index.js /* __next_internal_client_entry_do_not_use__ DEFAULT_CONTAINER_ID,DEFAULT_ONLOAD_NAME,DEFAULT_SCRIPT_ID,SCRIPT_URL,Turnstile auto */ var c = /*#__PURE__*/ (0,react.forwardRef)((param, n)=>{ let { as: e = "div", ...t } = param; return (0,jsx_runtime.jsx)(e, { ...t, ref: n }); }); const l = "https://challenges.cloudflare.com/turnstile/v0/api.js", u = "cf-turnstile-script", d = "cf-turnstile", f = "onloadTurnstileCallback", p = (e)=>!!document.getElementById(e), m = (param)=>{ let { render: e = "explicit", onLoadCallbackName: t = f, scriptOptions: { nonce: n = "", defer: r = !0, async: i = !0, id: a = "", appendTo: o, onError: s, crossOrigin: c = "" } = {} } = param; let u = a || "cf-turnstile-script"; if (p(u)) return; let d = document.createElement("script"); d.id = u, d.src = "".concat(l, "?onload=").concat(t, "&render=").concat(e), !document.querySelector('script[src="'.concat(d.src, '"]')) && (d.defer = !!r, d.async = !!i, n && (d.nonce = n), c && (d.crossOrigin = c), s && (d.onerror = s, delete window[t]), (o === "body" ? document.body : document.getElementsByTagName("head")[0]).appendChild(d)); }, h = { normal: { width: 300, height: 65 }, compact: { width: 150, height: 140 }, invisible: { width: 0, height: 0, overflow: "hidden" }, flexible: { minWidth: 300, width: "100%", height: 65 }, interactionOnly: { width: "fit-content", height: "auto", display: "flex" } }; function g(e) { if (e !== "invisible" && e !== "interactionOnly") return e; } function _() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : u; let [t, r] = (0,react.useState)(!1); return (0,react.useEffect)(()=>{ let t = ()=>{ p(e) && r(!0); }, n = new MutationObserver(t); return n.observe(document, { childList: !0, subtree: !0 }), t(), ()=>{ n.disconnect(); }; }, [ e ]), t; } let v = "unloaded", y; const b = new Promise((e, t)=>{ y = { resolve: e, reject: t }, v === "ready" && e(void 0); }), x = function() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f; return v === "unloaded" && (v = "loading", window[e] = ()=>{ y.resolve(), v = "ready", delete window[e]; }), b; }, S = /*#__PURE__*/ (0,react.forwardRef)((e, l)=>{ let { scriptOptions: u, options: d = {}, siteKey: f, onWidgetLoad: p, onSuccess: y, onExpire: b, onError: S, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E, onLoadScript: D, id: O, style: k, as: A = "div", injectScript: j = !0, rerenderOnCallbackChange: M = !1, ...N } = e, P = d.size, F = (0,react.useCallback)(()=>P === void 0 ? {} : d.execution === "execute" ? h.invisible : d.appearance === "interaction-only" ? h.interactionOnly : h[P], [ d.execution, P, d.appearance ]), [I, L] = (0,react.useState)(F()), R = (0,react.useRef)(null), [z, B] = (0,react.useState)(!1), V = (0,react.useRef)(void 0), H = (0,react.useRef)(!1), U = O || "cf-turnstile", W = (0,react.useRef)({ onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); (0,react.useEffect)(()=>{ M || (W.current = { onSuccess: y, onError: S, onExpire: b, onBeforeInteractive: C, onAfterInteractive: w, onUnsupported: T, onTimeout: E }); }); let G = (u === null || u === void 0 ? void 0 : u.id) || "cf-turnstile-script", K = _(G), q = (u === null || u === void 0 ? void 0 : u.onLoadCallbackName) || "onloadTurnstileCallback", J = d.appearance || "always", Y = (0,react.useMemo)(()=>{ var _d_feedbackEnabled; return { sitekey: f, action: d.action, cData: d.cData, theme: d.theme || "auto", language: d.language || "auto", tabindex: d.tabIndex, "response-field": d.responseField, "response-field-name": d.responseFieldName, size: g(P), retry: d.retry || "auto", "retry-interval": d.retryInterval || 8e3, "refresh-expired": d.refreshExpired || "auto", "refresh-timeout": d.refreshTimeout || "auto", execution: d.execution || "render", appearance: d.appearance || "always", "feedback-enabled": (_d_feedbackEnabled = d.feedbackEnabled) !== null && _d_feedbackEnabled !== void 0 ? _d_feedbackEnabled : !0, callback: (e)=>{ var _W_current_onSuccess, _W_current; H.current = !0, M ? y === null || y === void 0 ? void 0 : y(e) : (_W_current_onSuccess = (_W_current = W.current).onSuccess) === null || _W_current_onSuccess === void 0 ? void 0 : _W_current_onSuccess.call(_W_current, e); }, "error-callback": M ? S : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onError, _W_current; return (_W_current_onError = (_W_current = W.current).onError) === null || _W_current_onError === void 0 ? void 0 : _W_current_onError.call(_W_current, ...e); }, "expired-callback": M ? b : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onExpire, _W_current; return (_W_current_onExpire = (_W_current = W.current).onExpire) === null || _W_current_onExpire === void 0 ? void 0 : _W_current_onExpire.call(_W_current, ...e); }, "before-interactive-callback": M ? C : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onBeforeInteractive, _W_current; return (_W_current_onBeforeInteractive = (_W_current = W.current).onBeforeInteractive) === null || _W_current_onBeforeInteractive === void 0 ? void 0 : _W_current_onBeforeInteractive.call(_W_current, ...e); }, "after-interactive-callback": M ? w : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onAfterInteractive, _W_current; return (_W_current_onAfterInteractive = (_W_current = W.current).onAfterInteractive) === null || _W_current_onAfterInteractive === void 0 ? void 0 : _W_current_onAfterInteractive.call(_W_current, ...e); }, "unsupported-callback": M ? T : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onUnsupported, _W_current; return (_W_current_onUnsupported = (_W_current = W.current).onUnsupported) === null || _W_current_onUnsupported === void 0 ? void 0 : _W_current_onUnsupported.call(_W_current, ...e); }, "timeout-callback": M ? E : function() { for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ e[_key] = arguments[_key]; } var _W_current_onTimeout, _W_current; return (_W_current_onTimeout = (_W_current = W.current).onTimeout) === null || _W_current_onTimeout === void 0 ? void 0 : _W_current_onTimeout.call(_W_current, ...e); } }; }, [ d.action, d.appearance, d.cData, d.execution, d.language, d.refreshExpired, d.responseField, d.responseFieldName, d.retry, d.retryInterval, d.tabIndex, d.theme, d.feedbackEnabled, d.refreshTimeout, f, P, M, M ? y : null, M ? S : null, M ? b : null, M ? C : null, M ? w : null, M ? T : null, M ? E : null ]), X = (0,react.useCallback)(()=>typeof window < "u" && !!window.turnstile, []); return (0,react.useEffect)(function() { j && !z && (x(q), m({ onLoadCallbackName: q, scriptOptions: { ...u, id: G } })); }, [ j, z, u, G, q ]), (0,react.useEffect)(function() { v !== "ready" && x(q).then(()=>B(!0)).catch(console.error); }, [ q ]), (0,react.useEffect)(function() { if (!R.current || !z) return; let e = !1; return (async ()=>{ e || !R.current || (V.current = window.turnstile.render(R.current, Y), V.current && (p === null || p === void 0 ? void 0 : p(V.current))); })(), ()=>{ e = !0, V.current && (window.turnstile.remove(V.current), H.current = !1); }; }, [ U, z, Y ]), (0,react.useImperativeHandle)(l, ()=>{ let { turnstile: e } = window; return { getResponse () { if (!(e === null || e === void 0 ? void 0 : e.getResponse) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } return e.getResponse(V.current); }, async getResponsePromise () { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 3e4, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100; return new Promise((n, r)=>{ let i, a = async ()=>{ if (H.current && window.turnstile && V.current) try { let e = window.turnstile.getResponse(V.current); return i && clearTimeout(i), e ? n(e) : r(Error("No response received")); } catch (e) { return i && clearTimeout(i), console.warn("Failed to get response", e), r(Error("Failed to get response")); } i || (i = setTimeout(()=>{ i && clearTimeout(i), r(Error("Timeout")); }, e)), await new Promise((e)=>setTimeout(e, t)), await a(); }; a(); }); }, reset () { if (!(e === null || e === void 0 ? void 0 : e.reset) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } d.execution === "execute" && L(h.invisible); try { H.current = !1, e.reset(V.current); } catch (e) { console.warn("Failed to reset Turnstile widget ".concat(V.current), e); } }, remove () { if (!(e === null || e === void 0 ? void 0 : e.remove) || !V.current || !X()) { console.warn("Turnstile has not been loaded"); return; } L(h.invisible), H.current = !1, e.remove(V.current), V.current = null; }, render () { if (!(e === null || e === void 0 ? void 0 : e.render) || !R.current || !X() || V.current) { console.warn("Turnstile has not been loaded or container not found"); return; } let t = e.render(R.current, Y); return V.current = t, V.current && (p === null || p === void 0 ? void 0 : p(V.current)), d.execution !== "execute" && L(P ? h[P] : {}), t; }, execute () { if (d.execution !== "execute") { console.warn('Execution mode is not set to "execute"'); return; } if (!(e === null || e === void 0 ? void 0 : e.execute) || !R.current || !V.current || !X()) { console.warn("Turnstile has not been loaded or container not found"); return; } e.execute(R.current, Y), L(P ? h[P] : {}); }, isExpired () { return !(e === null || e === void 0 ? void 0 : e.isExpired) || !V.current || !X() ? (console.warn("Turnstile has not been loaded"), !1) : e.isExpired(V.current); } }; }, [ V, d.execution, P, Y, R, X, z, p ]), (0,react.useEffect)(()=>{ if (z || !K) return; if (window.turnstile) { B(!0); return; } let e = setInterval(()=>{ window.turnstile && (B(!0), clearInterval(e)); }, 50); return ()=>{ clearInterval(e); }; }, [ z, K ]), (0,react.useEffect)(()=>{ L(F()); }, [ d.execution, P, J ]), (0,react.useEffect)(()=>{ !K || typeof D != "function" || D(); }, [ K ]), (0,jsx_runtime.jsx)(c, { ref: R, as: A, id: U, style: { ...I, ...k }, ...N }); }); S.displayName = "Turnstile"; ;// ./src/components/Turnstile.tsx /* __next_internal_client_entry_do_not_use__ CAPTCHA_ENABLED,TurnstileWidget auto */ var _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY; const SITE_KEY = (_process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY = "0x4AAAAAAC_FtTQJ0_6Cp9-9") !== null && _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY !== void 0 ? _process_env_NEXT_PUBLIC_TURNSTILE_SITE_KEY : ''; /** false in dev when NEXT_PUBLIC_TURNSTILE_SITE_KEY is not set */ const CAPTCHA_ENABLED = !!SITE_KEY; function TurnstileWidget(param) { let { onSuccess, onError, onExpire } = param; if (!SITE_KEY) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)(S, { siteKey: SITE_KEY, onSuccess: onSuccess, onError: onError, onExpire: onExpire, options: { theme: 'light', language: 'auto' } }); } /***/ }), /***/ 4029: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ }), /***/ 5338: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); 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)); } /***/ }), /***/ 6261: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CreateTaskPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _context_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4029); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1258); /* harmony import */ var _lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5338); /* harmony import */ var _components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3119); /* harmony import */ var _components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2818); /* harmony import */ var _components_Turnstile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2928); /* __next_internal_client_entry_do_not_use__ default auto */ const API = "https://api.canhelp.gr" || 0; const localISO = (d)=>{ const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); return "".concat(y, "-").concat(m, "-").concat(day); }; function CreateTaskPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); var _searchParams_get; const preselectedCategory = (_searchParams_get = searchParams.get('category')) !== null && _searchParams_get !== void 0 ? _searchParams_get : ''; const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locations, setLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topSpecialists, setTopSpecialists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [deadline, setDeadline] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d); }); const [expiresAtDays, setExpiresAtDays] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(30); const [calendarMonth, setCalendarMonth] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(()=>{ const d = new Date(); d.setDate(d.getDate() + 1); return localISO(d).slice(0, 7); }); const calendarInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const [specialistAvailMap, setSpecialistAvailMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [invitedIds, setInvitedIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [captchaToken, setCaptchaToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .CAPTCHA_ENABLED */ .l ? '' : 'dev'); const { locationSlug: ctxLocation } = (0,_context_location__WEBPACK_IMPORTED_MODULE_6__/* .useLocation */ .z)(); const [selectedLocation, setSelectedLocation] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [selectedCategory, setSelectedCategory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(preselectedCategory); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (ctxLocation) setSelectedLocation(ctxLocation); }, [ ctxLocation ]); const [images, setImages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [photoUploading, setPhotoUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getCategories */ .bW)().then(setCategories).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getLocations */ .Vs)().then(setLocations).catch(()=>{}); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!selectedCategory) { setTopSpecialists([]); return; } (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .getSpecialists */ .F7)({ limit: '5', category: selectedCategory, locale }).then((r)=>setTopSpecialists(r.data)).catch(()=>{}); }, [ selectedCategory, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!deadline || topSpecialists.length === 0) return; const month = deadline.slice(0, 7); const ids = topSpecialists.map((u)=>u.id); Promise.all(ids.map((id)=>fetch("".concat(API, "/api/availability/user/").concat(id, "?month=").concat(month), { credentials: 'include' }).then((r)=>r.ok ? r.json() : []).then((rows)=>{ const row = rows.find((r)=>r.date === deadline); var _row_status; return { id, status: (_row_status = row === null || row === void 0 ? void 0 : row.status) !== null && _row_status !== void 0 ? _row_status : null }; }).catch(()=>({ id, status: null })))).then((results)=>{ const map = {}; results.forEach((param)=>{ let { id, status } = param; map[id] = status; }); setSpecialistAvailMap(map); }); }, [ deadline, topSpecialists ]); async function handlePhotoChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPhotoUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(API, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); setImages((prev)=>[ ...prev, "".concat(API).concat(url) ]); } catch (e) { setError(t('profile.upload.error')); } finally{ setPhotoUploading(false); if (fileInputRef.current) fileInputRef.current.value = ''; } } async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); const form = new FormData(e.currentTarget); const data = { title: form.get('title'), description: form.get('description'), category: form.get('category') || undefined, location: form.get('location') || undefined, budget: form.get('budget') ? Number(form.get('budget')) : undefined, budgetNegotiable: form.get('budgetNegotiable') === 'on', deadline: form.get('deadline') ? new Date(form.get('deadline')).toISOString() : undefined, expiresAt: (()=>{ const d = new Date(); d.setDate(d.getDate() + Number(form.get('expiresAtDays') || 30)); return d.toISOString(); })(), timeSlot: form.get('timeSlot') || undefined, district: form.get('district') || undefined, street: form.get('street') || undefined, houseNumber: form.get('houseNumber') || undefined, confidentialNote: form.get('confidentialNote') || undefined, images: images.length > 0 ? images : undefined, status: 'open', locale: locale, inviteSpecialistIds: invitedIds.size > 0 ? [ ...invitedIds ] : undefined }; try { const task = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_7__/* .createTask */ .UT)({ ...data, captchaToken }); router.push("/tasks/".concat(task.id)); } catch (err) { setError(err.message || t('create.error')); } finally{ setLoading(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const todayMidnight = new Date(); todayMidnight.setHours(0, 0, 0, 0); const [cmYear, cmMonth] = calendarMonth.split('-').map(Number); const daysInMonth = new Date(cmYear, cmMonth, 0).getDate(); const calendarDates = []; for(let day = 1; day <= daysInMonth; day++){ const d = new Date(cmYear, cmMonth - 1, day); if (d >= todayMidnight) calendarDates.push(d); } const monthOptions = Array.from({ length: 12 }, (_, i)=>{ const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() + i); return { value: localISO(d).slice(0, 7), label: d.toLocaleDateString(dateLocale, { month: 'long', year: 'numeric' }) }; }); const sidebarTitle = t('tasks.new.top_specialists'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6", children: t('create.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col lg:flex-row gap-6 lg:gap-8 items-start", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 min-w-0 w-full", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4", children: [ /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.category') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskCategoryPicker__WEBPACK_IMPORTED_MODULE_9__/* .TaskCategoryPicker */ .W, { categories: categories, locale: catLocale, value: selectedCategory, onChange: setSelectedCategory, placeholder: t('create.field.category.select') }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_TaskLocationPicker__WEBPACK_IMPORTED_MODULE_8__/* .TaskLocationPicker */ .V, { locations: locations, value: selectedLocation, onChange: setSelectedLocation, anyLabel: t('create.field.location.any'), allLabel: t('create.field.location.all') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "title", required: true, minLength: 5, maxLength: 200, placeholder: t('create.field.title.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "description", required: true, minLength: 20, rows: 4, placeholder: t('create.field.description.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "budget", type: "number", min: 1, step: 1, placeholder: t('create.field.budget.placeholder'), className: "w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer select-none", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", name: "budgetNegotiable", className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm font-medium text-gray-700 shrink-0", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("select", { value: calendarMonth, onChange: (e)=>setCalendarMonth(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: monthOptions.map((mo)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: mo.value, children: mo.label }, mo.value)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", title: "Открыть календарь", onClick: ()=>{ try { var _calendarInputRef_current; (_calendarInputRef_current = calendarInputRef.current) === null || _calendarInputRef_current === void 0 ? void 0 : _calendarInputRef_current.showPicker(); } catch (e) { var _calendarInputRef_current1; (_calendarInputRef_current1 = calendarInputRef.current) === null || _calendarInputRef_current1 === void 0 ? void 0 : _calendarInputRef_current1.click(); } }, className: "shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: calendarInputRef, type: "date", min: localISO(todayMidnight), value: deadline, onChange: (e)=>{ if (!e.target.value) return; setDeadline(e.target.value); setCalendarMonth(e.target.value.slice(0, 7)); }, className: "absolute w-0 h-0 opacity-0 pointer-events-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory", children: calendarDates.map((d)=>{ const iso = localISO(d); const isSelected = deadline === iso; const dayName = d.toLocaleDateString(dateLocale, { weekday: 'short' }); const dayNum = d.getDate(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setDeadline(iso), className: "flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(isSelected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium uppercase leading-none mb-0.5", children: dayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl font-bold leading-none", children: dayNum }) ] }, iso); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "deadline", value: deadline }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-2", children: [ 7, 14, 30, 60 ].map((days)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setExpiresAtDays(days), className: "flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(expiresAtDays === days ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-700 hover:border-green-300'), children: [ days, " ", t('create.field.expires_at.days').replace('{n}', '') ] }, days)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "expiresAtDays", value: expiresAtDays }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { name: "timeSlot", className: "w-full border border-gray-300 rounded-lg px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('create.field.time_slot.any') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "morning", children: t('create.field.time_slot.morning') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "afternoon", children: t('create.field.time_slot.afternoon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "evening", children: t('create.field.time_slot.evening') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "weekend", children: t('create.field.time_slot.weekend') }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.photos') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-2 mb-2", children: [ images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setImages((prev)=>prev.filter((_, j)=>j !== i)), className: "absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70", children: "\xd7" }) ] }, i)), images.length < 5 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: photoUploading, className: "w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50", children: photoUploading ? '...' : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl leading-none", children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('create.field.photos.add') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/*", className: "hidden", onChange: handlePhotoChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), "\uD83D\uDD12 ", t('create.field.confidential.hint') ] }), /*#__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-sm font-medium text-gray-700 mb-2", children: t('create.field.address') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "district", placeholder: t('create.field.address.district'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "street", placeholder: t('create.field.address.street'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "houseNumber", placeholder: t('create.field.address.house'), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white" }) ] }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "confidentialNote", rows: 2, placeholder: t('create.field.confidential.placeholder'), 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 resize-none bg-white" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_Turnstile__WEBPACK_IMPORTED_MODULE_10__/* .TurnstileWidget */ .$, { onSuccess: setCaptchaToken, onError: ()=>setCaptchaToken(''), onExpire: ()=>setCaptchaToken('') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading || !captchaToken, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed", children: loading ? t('create.submitting') : t('create.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "hidden lg:block lg:w-64 shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 sticky top-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 mb-4 text-sm", children: sidebarTitle }), !selectedCategory ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('tasks.new.select_category') }) : topSpecialists.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center py-4", children: t('specialists.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: topSpecialists.map((u)=>{ var _u_firstName, _u_lastName, _u_name_, _u_name; const name = (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_11__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name); var _u_firstName_, _u_lastName_; const initials = "".concat((_u_firstName_ = (_u_firstName = u.firstName) === null || _u_firstName === void 0 ? void 0 : _u_firstName[0]) !== null && _u_firstName_ !== void 0 ? _u_firstName_ : '').concat((_u_lastName_ = (_u_lastName = u.lastName) === null || _u_lastName === void 0 ? void 0 : _u_lastName[0]) !== null && _u_lastName_ !== void 0 ? _u_lastName_ : '').toUpperCase() || ((_u_name = u.name) === null || _u_name === void 0 ? void 0 : (_u_name_ = _u_name[0]) === null || _u_name_ === void 0 ? void 0 : _u_name_.toUpperCase()) || '?'; const seen = (0,_lib_formatLastSeen__WEBPACK_IMPORTED_MODULE_12__/* .formatLastSeen */ .V)(u.lastSeenAt, t); const avail = specialistAvailMap[u.id]; const isInvited = invitedIds.has(u.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-gray-100 hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(u.id), target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100", children: u.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: u.image, alt: name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-900 truncate", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [ u.rating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ "★ ", Number(u.rating).toFixed(1) ] }) : seen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: seen }) : null, typeof u.reviewCount === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ u.reviewCount, " ", t('reviews.count') ] }), typeof u.positivePercent === 'number' && u.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-green-600", children: [ u.positivePercent, "% \uD83D\uDC4D" ] }), avail === 'available' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 inline-block" }), t('schedule.available') ] }), avail === 'busy' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-red-500 inline-block" }), t('schedule.busy') ] }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setInvitedIds((prev)=>{ const next = new Set(prev); if (next.has(u.id)) next.delete(u.id); else next.add(u.id); return next; }), className: "w-full text-xs font-medium py-1 rounded-lg transition ".concat(isInvited ? 'bg-green-600 text-white hover:bg-green-700' : 'bg-gray-100 text-gray-700 hover:bg-gray-200'), children: isInvited ? t('tasks.new.invited') : t('tasks.new.invite') }) }) ] }, u.id); }) }) ] }) }) ] }) ] }); } /***/ }), /***/ 7029: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(7029))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); Th `]iX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[9478],{ /***/ 1258: hUhzj{|YZY}hUhVjWXYZY, /***/ 2928: gTgiiXYXgTgiXYX, /***/ 5338: fSf/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); gWexport 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)); }  06undefinedTUT, /***/ 6261: bObdSTS, /***/ 7029: aUcWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/new/page.tsx"); k084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6261))undefinedPQPWXYPvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,1530,587,18,7358], () => (__webpack_exec__(7029))); var __webpack_exports__ = __webpack_require__.O(); OZ[\ *:webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ _// The module cache var __webpack_module_cache__ = {}; // The require function function __webpack_require__(moduleId) { // Check if module is in cache var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== undefined) { return cachedModule.exports; } // Create a new module (and put it into the cache) var module = __webpack_module_cache__[moduleId] = { // no module.id needed // no module.loaded needed exports: {} }; // Execute the module function var threw = true; try { __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); threw = false; } finally { if(threw) delete __webpack_module_cache__[moduleId]; } // Return the exports of the module return module.exports; } // expose the modules object (__webpack_modules__) __webpack_require__.m = __webpack_modules__; K/************************************************************************/ `!,/* webpack/runtime/chunk loaded */ (() => {  vvar deferred = []; __webpack_require__.O = (result, chunkIds, fn, priority) => { if(chunkIds) { priority = priority || 0; for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; deferred[i] = [chunkIds, fn, priority]; return; } var notFulfilled = Infinity; for (var i = 0; i < deferred.length; i++) { var [chunkIds, fn, priority] = deferred[i]; var fulfilled = true; for (var j = 0; j < chunkIds.length; j++) { if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { chunkIds.splice(j--, 1); } else { fulfilled = false; if(priority < notFulfilled) notFulfilled = priority; } } if(fulfilled) { deferred.splice(i--, 1) var r = fn(); if (r !== undefined) result = r; } } return result; }; A })(); /* webpack/runtime/compat get default export */ (() => {   // getDefaultExport function for compatibility with non-harmony modules __webpack_require__.n = (module) => { var getter = module && module.__esModule ? () => (module['default']) : () => (module); __webpack_require__.d(getter, { a: getter }); return getter; }; D })(); /* webpack/runtime/create fake namespace object */ (() => {  uvar getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); var leafPrototypes; // create a fake namespace object // mode & 1: value is a module id, require it // mode & 2: merge all properties of value into the ns // mode & 4: return value when already ns object // mode & 16: return value when it's Promise-like // mode & 8|1: behave like require __webpack_require__.t = function(value, mode) { if(mode & 1) value = this(value); if(mode & 8) return value; if(typeof value === 'object' && value) { if((mode & 4) && value.__esModule) return value; if((mode & 16) && typeof value.then === 'function') return value; } var ns = Object.create(null); __webpack_require__.r(ns); var def = {}; leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); } def['default'] = () => (value); __webpack_require__.d(ns, def); return ns; }; ? })(); /* webpack/runtime/define property getters */ (() => {  4// define getter functions for harmony exports __webpack_require__.d = (exports, definition) => { for(var key in definition) { if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); } } }; 4 })(); /* webpack/runtime/ensure chunk */ (() => {  F__webpack_require__.f = {}; // This file contains only the entry chunk. // The chunk loading function for additional chunks __webpack_require__.e = (chunkId) => { return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { __webpack_require__.f[key](chunkId, promises); return promises; }, [])); }; E })(); /* webpack/runtime/get javascript chunk filename */ (() => {  R// This function allow to reference async chunks __webpack_require__.u = (chunkId) => { // return url for filenames based on template return "static/chunks/" + (chunkId === 9031 ? "e89fb3a8" : chunkId) + "." + {"3542":"bb9abe76cf68d932","6467":"06a1c0ca06759ccf","7797":"7f09b625f84a88e2","9031":"7ade5d06ffa9957d"}[chunkId] + ".js"; }; C })(); /* webpack/runtime/get mini-css chunk filename */ (() => {  // This function allow to reference async chunks __webpack_require__.miniCssF = (chunkId) => { // return url for filenames based on template return "static/css/" + "93ad12acbd6e0cbd" + ".css"; }; . })(); /* webpack/runtime/global */ (() => {  __webpack_require__.g = (function() { if (typeof globalThis === 'object') return globalThis; try { return this || new Function('return this')(); } catch (e) { if (typeof window === 'object') return window; } })(); @ })(); /* webpack/runtime/hasOwnProperty shorthand */ (() => {  X__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 3 })(); /* webpack/runtime/load script */ (() => {  var inProgress = {}; var dataWebpackPrefix = "_N_E:"; // loadScript function to load a script via script tag __webpack_require__.l = (url, done, key, chunkId) => { if(inProgress[url]) { inProgress[url].push(done); return; } var script, needAttach; if(key !== undefined) { var scripts = document.getElementsByTagName("script"); for(var i = 0; i < scripts.length; i++) { var s = scripts[i]; if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } } } if(!script) { needAttach = true; script = document.createElement('script'); script.charset = 'utf-8'; script.timeout = 120; if (__webpack_require__.nc) { script.setAttribute("nonce", __webpack_require__.nc); } script.setAttribute("data-webpack", dataWebpackPrefix + key); script.src = __webpack_require__.tu(url); } inProgress[url] = [done]; var onScriptComplete = (prev, event) => { // avoid mem leaks in IE. script.onerror = script.onload = null; clearTimeout(timeout); var doneFns = inProgress[url]; delete inProgress[url]; script.parentNode && script.parentNode.removeChild(script); doneFns && doneFns.forEach((fn) => (fn(event))); if(prev) return prev(event); } var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); script.onerror = onScriptComplete.bind(null, script.onerror); script.onload = onScriptComplete.bind(null, script.onload); needAttach && document.head.appendChild(script); }; = })(); /* webpack/runtime/make namespace object */ (() => {  // define __esModule on exports __webpack_require__.r = (exports) => { if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); } Object.defineProperty(exports, '__esModule', { value: true }); }; < })(); /* webpack/runtime/trusted types policy */ (() => {  var policy; __webpack_require__.tt = () => { // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet. if (policy === undefined) { policy = { createScriptURL: (url) => (url) }; if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) { policy = trustedTypes.createPolicy("nextjs#bundler", policy); } } return policy; }; @ })(); /* webpack/runtime/trusted types script url */ (() => {  R__webpack_require__.tu = (url) => (__webpack_require__.tt().createScriptURL(url)); 2 })(); /* webpack/runtime/publicPath */ (() => {  "__webpack_require__.p = "/_next/"; 3 })(); /* webpack/runtime/css loading */ (() => {   var createStylesheet = (chunkId, fullhref, resolve, reject) => { var linkTag = document.createElement("link"); linkTag.rel = "stylesheet"; linkTag.type = "text/css"; var onLinkComplete = (event) => { // avoid mem leaks. linkTag.onerror = linkTag.onload = null; if (event.type === 'load') { resolve(); } else { var errorType = event && (event.type === 'load' ? 'missing' : event.type); var realHref = event && event.target && event.target.href || fullhref; var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + realHref + ")"); err.code = "CSS_CHUNK_LOAD_FAILED"; err.type = errorType; err.request = realHref; linkTag.parentNode.removeChild(linkTag) reject(err); } } linkTag.onerror = linkTag.onload = onLinkComplete; linkTag.href = fullhref; (function(linkTag) { if (typeof _N_E_STYLE_LOAD === 'function') { const { href, onload, onerror } = linkTag; _N_E_STYLE_LOAD(href.indexOf(window.location.origin) === 0 ? new URL(href).pathname : href).then(()=>onload == null ? void 0 : onload.call(linkTag, { type: 'load' }), ()=>onerror == null ? void 0 : onerror.call(linkTag, {})); } else { document.head.appendChild(linkTag); } })(linkTag) return linkTag; }; var findStylesheet = (href, fullhref) => { var existingLinkTags = document.getElementsByTagName("link"); for(var i = 0; i < existingLinkTags.length; i++) { var tag = existingLinkTags[i]; var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; } var existingStyleTags = document.getElementsByTagName("style"); for(var i = 0; i < existingStyleTags.length; i++) { var tag = existingStyleTags[i]; var dataHref = tag.getAttribute("data-href"); if(dataHref === href || dataHref === fullhref) return tag; } }; var loadStylesheet = (chunkId) => { return new Promise((resolve, reject) => { var href = __webpack_require__.miniCssF(chunkId); var fullhref = __webpack_require__.p + href; if(findStylesheet(href, fullhref)) return resolve(); createStylesheet(chunkId, fullhref, resolve, reject); }); } // object to store loaded CSS chunks var installedCssChunks = { 8068: 0 }; __webpack_require__.f.miniCss = (chunkId, promises) => { var cssChunks = {"2012":1}; if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]); else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) { promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => { installedCssChunks[chunkId] = 0; }, (e) => { delete installedCssChunks[chunkId]; throw e; })); } }; // no hmr ; })(); /* webpack/runtime/jsonp chunk loading */ (() => {  u // no baseURI // object to store loaded and loading chunks // undefined = chunk not loaded, null = chunk preloaded/prefetched // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded var installedChunks = { 8068: 0, 9950: 0 }; __webpack_require__.f.j = (chunkId, promises) => { // JSONP chunk loading for javascript var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; if(installedChunkData !== 0) { // 0 means "already installed". // a Promise means "currently loading". if(installedChunkData) { promises.push(installedChunkData[2]); } else { if(!/^(2012|8068|9950)$/.test(chunkId)) { // setup Promise in chunk cache var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); promises.push(installedChunkData[2] = promise); // start chunk loading var url = __webpack_require__.p + __webpack_require__.u(chunkId); // create error before stack unwound to get useful stacktrace later var error = new Error(); var loadingEnded = (event) => { if(__webpack_require__.o(installedChunks, chunkId)) { installedChunkData = installedChunks[chunkId]; if(installedChunkData !== 0) installedChunks[chunkId] = undefined; if(installedChunkData) { var errorType = event && (event.type === 'load' ? 'missing' : event.type); var realSrc = event && event.target && event.target.src; error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; error.name = 'ChunkLoadError'; error.type = errorType; error.request = realSrc; installedChunkData[1](error); } } }; __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); } else installedChunks[chunkId] = 0; } } }; // no prefetching // no preloaded // no HMR // no HMR manifest __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); // install a JSONP callback for chunk loading var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { var [chunkIds, moreModules, runtime] = data; // add "moreModules" to the modules object, // then flag all "chunkIds" as loaded and fire callback var moduleId, chunkId, i = 0; if(chunkIds.some((id) => (installedChunks[id] !== 0))) { for(moduleId in moreModules) { if(__webpack_require__.o(moreModules, moduleId)) { __webpack_require__.m[moduleId] = moreModules[moduleId]; } } if(runtime) var result = runtime(__webpack_require__); } if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); for(;i < chunkIds.length; i++) { chunkId = chunkIds[i]; if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { installedChunks[chunkId][0](); } installedChunks[chunkId] = 0; } return __webpack_require__.O(result); } var chunkLoadingGlobal = self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []; chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));  })();       /******/ })() ; SI/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ var threw = true; /******/ try { /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ threw = false; /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ } /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ /******/ /* webpack/runtime/chunk loaded */ /******/ (() => { /******/ var deferred = []; /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { /******/ if(chunkIds) { /******/ priority = priority || 0; /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; /******/ deferred[i] = [chunkIds, fn, priority]; /******/ return; /******/ } /******/ var notFulfilled = Infinity; /******/ for (var i = 0; i < deferred.length; i++) { /******/ var [chunkIds, fn, priority] = deferred[i]; /******/ var fulfilled = true; /******/ for (var j = 0; j < chunkIds.length; j++) { /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { /******/ chunkIds.splice(j--, 1); /******/ } else { /******/ fulfilled = false; /******/ if(priority < notFulfilled) notFulfilled = priority; /******/ } /******/ } /******/ if(fulfilled) { /******/ deferred.splice(i--, 1) /******/ var r = fn(); /******/ if (r !== undefined) result = r; /******/ } /******/ } /******/ return result; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 16: return value when it's Promise-like /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = this(value); /******/ if(mode & 8) return value; /******/ if(typeof value === 'object' && value) { /******/ if((mode & 4) && value.__esModule) return value; /******/ if((mode & 16) && typeof value.then === 'function') return value; /******/ } /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } /******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/ensure chunk */ /******/ (() => { /******/ __webpack_require__.f = {}; /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __webpack_require__.e = (chunkId) => { /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { /******/ __webpack_require__.f[key](chunkId, promises); /******/ return promises; /******/ }, [])); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get javascript chunk filename */ /******/ (() => { /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames based on template /******/ return "static/chunks/" + (chunkId === 9031 ? "e89fb3a8" : chunkId) + "." + {"3542":"bb9abe76cf68d932","6467":"06a1c0ca06759ccf","7797":"7f09b625f84a88e2","9031":"7ade5d06ffa9957d"}[chunkId] + ".js"; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get mini-css chunk filename */ /******/ (() => { /******/ // This function allow to reference async chunks /******/ __webpack_require__.miniCssF = (chunkId) => { /******/ // return url for filenames based on template /******/ return "static/css/" + "93ad12acbd6e0cbd" + ".css"; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ /******/ (() => { /******/ var inProgress = {}; /******/ var dataWebpackPrefix = "_N_E:"; /******/ // loadScript function to load a script via script tag /******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { /******/ var scripts = document.getElementsByTagName("script"); /******/ for(var i = 0; i < scripts.length; i++) { /******/ var s = scripts[i]; /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } /******/ } /******/ } /******/ if(!script) { /******/ needAttach = true; /******/ script = document.createElement('script'); /******/ /******/ script.charset = 'utf-8'; /******/ script.timeout = 120; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); /******/ /******/ script.src = __webpack_require__.tu(url); /******/ } /******/ inProgress[url] = [done]; /******/ var onScriptComplete = (prev, event) => { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; /******/ clearTimeout(timeout); /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); /******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); /******/ script.onerror = onScriptComplete.bind(null, script.onerror); /******/ script.onload = onScriptComplete.bind(null, script.onload); /******/ needAttach && document.head.appendChild(script); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/trusted types policy */ /******/ (() => { /******/ var policy; /******/ __webpack_require__.tt = () => { /******/ // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet. /******/ if (policy === undefined) { /******/ policy = { /******/ createScriptURL: (url) => (url) /******/ }; /******/ if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) { /******/ policy = trustedTypes.createPolicy("nextjs#bundler", policy); /******/ } /******/ } /******/ return policy; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/trusted types script url */ /******/ (() => { /******/ __webpack_require__.tu = (url) => (__webpack_require__.tt().createScriptURL(url)); /******/ })(); /******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "/_next/"; /******/ })(); /******/ /******/ /* webpack/runtime/css loading */ /******/ (() => { /******/ var createStylesheet = (chunkId, fullhref, resolve, reject) => { /******/ var linkTag = document.createElement("link"); /******/ /******/ linkTag.rel = "stylesheet"; /******/ linkTag.type = "text/css"; /******/ var onLinkComplete = (event) => { /******/ // avoid mem leaks. /******/ linkTag.onerror = linkTag.onload = null; /******/ if (event.type === 'load') { /******/ resolve(); /******/ } else { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realHref = event && event.target && event.target.href || fullhref; /******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + realHref + ")"); /******/ err.code = "CSS_CHUNK_LOAD_FAILED"; /******/ err.type = errorType; /******/ err.request = realHref; /******/ linkTag.parentNode.removeChild(linkTag) /******/ reject(err); /******/ } /******/ } /******/ linkTag.onerror = linkTag.onload = onLinkComplete; /******/ linkTag.href = fullhref; /******/ /******/ (function(linkTag) { /******/ if (typeof _N_E_STYLE_LOAD === 'function') { /******/ const { href, onload, onerror } = linkTag; /******/ _N_E_STYLE_LOAD(href.indexOf(window.location.origin) === 0 ? new URL(href).pathname : href).then(()=>onload == null ? void 0 : onload.call(linkTag, { /******/ type: 'load' /******/ }), ()=>onerror == null ? void 0 : onerror.call(linkTag, {})); /******/ } else { /******/ document.head.appendChild(linkTag); /******/ } /******/ })(linkTag) /******/ return linkTag; /******/ }; /******/ var findStylesheet = (href, fullhref) => { /******/ var existingLinkTags = document.getElementsByTagName("link"); /******/ for(var i = 0; i < existingLinkTags.length; i++) { /******/ var tag = existingLinkTags[i]; /******/ var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); /******/ if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; /******/ } /******/ var existingStyleTags = document.getElementsByTagName("style"); /******/ for(var i = 0; i < existingStyleTags.length; i++) { /******/ var tag = existingStyleTags[i]; /******/ var dataHref = tag.getAttribute("data-href"); /******/ if(dataHref === href || dataHref === fullhref) return tag; /******/ } /******/ }; /******/ var loadStylesheet = (chunkId) => { /******/ return new Promise((resolve, reject) => { /******/ var href = __webpack_require__.miniCssF(chunkId); /******/ var fullhref = __webpack_require__.p + href; /******/ if(findStylesheet(href, fullhref)) return resolve(); /******/ createStylesheet(chunkId, fullhref, resolve, reject); /******/ }); /******/ } /******/ // object to store loaded CSS chunks /******/ var installedCssChunks = { /******/ 8068: 0 /******/ }; /******/ /******/ __webpack_require__.f.miniCss = (chunkId, promises) => { /******/ var cssChunks = {"2012":1}; /******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]); /******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) { /******/ promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => { /******/ installedCssChunks[chunkId] = 0; /******/ }, (e) => { /******/ delete installedCssChunks[chunkId]; /******/ throw e; /******/ })); /******/ } /******/ }; /******/ /******/ // no hmr /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 8068: 0, /******/ 9950: 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; /******/ if(installedChunkData !== 0) { // 0 means "already installed". /******/ /******/ // a Promise means "currently loading". /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { /******/ if(!/^(2012|8068|9950)$/.test(chunkId)) { /******/ // setup Promise in chunk cache /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); /******/ // create error before stack unwound to get useful stacktrace later /******/ var error = new Error(); /******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; /******/ if(installedChunkData) { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.name = 'ChunkLoadError'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ installedChunkData[1](error); /******/ } /******/ } /******/ }; /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } /******/ }; /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ // no HMR /******/ /******/ // no HMR manifest /******/ /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { /******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { /******/ for(moduleId in moreModules) { /******/ if(__webpack_require__.o(moreModules, moduleId)) { /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(runtime) var result = runtime(__webpack_require__); /******/ } /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ installedChunks[chunkId][0](); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); /******/ /************************************************************************/ /******/ /******/ /******/ })() ; CW `VX/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ PrefixSourceRawSource_// The module cache var __webpack_module_cache__ = {}; // The require function function __webpack_require__(moduleId) { // Check if module is in cache var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== undefined) { return cachedModule.exports; } // Create a new module (and put it into the cache) var module = __webpack_module_cache__[moduleId] = { // no module.id needed // no module.loaded needed exports: {} }; // Execute the module function var threw = true; try { __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); threw = false; } finally { if(threw) delete __webpack_module_cache__[moduleId]; } // Return the exports of the module return module.exports; } // expose the modules object (__webpack_modules__) __webpack_require__.m = __webpack_modules__; /******/ RawSourceK/************************************************************************/ L,/* webpack/runtime/chunk loaded */ (() => { vvar deferred = []; __webpack_require__.O = (result, chunkIds, fn, priority) => { if(chunkIds) { priority = priority || 0; for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; deferred[i] = [chunkIds, fn, priority]; return; } var notFulfilled = Infinity; for (var i = 0; i < deferred.length; i++) { var [chunkIds, fn, priority] = deferred[i]; var fulfilled = true; for (var j = 0; j < chunkIds.length; j++) { if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { chunkIds.splice(j--, 1); } else { fulfilled = false; if(priority < notFulfilled) notFulfilled = priority; } } if(fulfilled) { deferred.splice(i--, 1) var r = fn(); if (r !== undefined) result = r; } } return result; }; RawSourceA })(); /* webpack/runtime/compat get default export */ (() => {  // getDefaultExport function for compatibility with non-harmony modules __webpack_require__.n = (module) => { var getter = module && module.__esModule ? () => (module['default']) : () => (module); __webpack_require__.d(getter, { a: getter }); return getter; };D })(); /* webpack/runtime/create fake namespace object */ (() => { uvar getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); var leafPrototypes; // create a fake namespace object // mode & 1: value is a module id, require it // mode & 2: merge all properties of value into the ns // mode & 4: return value when already ns object // mode & 16: return value when it's Promise-like // mode & 8|1: behave like require __webpack_require__.t = function(value, mode) { if(mode & 1) value = this(value); if(mode & 8) return value; if(typeof value === 'object' && value) { if((mode & 4) && value.__esModule) return value; if((mode & 16) && typeof value.then === 'function') return value; } var ns = Object.create(null); __webpack_require__.r(ns); var def = {}; leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); } def['default'] = () => (value); __webpack_require__.d(ns, def); return ns; };? })(); /* webpack/runtime/define property getters */ (() => { 4// define getter functions for harmony exports __webpack_require__.d = (exports, definition) => { for(var key in definition) { if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); } } };4 })(); /* webpack/runtime/ensure chunk */ (() => { F__webpack_require__.f = {}; // This file contains only the entry chunk. // The chunk loading function for additional chunks __webpack_require__.e = (chunkId) => { return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { __webpack_require__.f[key](chunkId, promises); return promises; }, [])); };E })(); /* webpack/runtime/get javascript chunk filename */ (() => { +C })(); /* webpack/runtime/get mini-css chunk filename */ (() => { // This function allow to reference async chunks __webpack_require__.miniCssF = (chunkId) => { // return url for filenames based on template return "static/css/" + "93ad12acbd6e0cbd" + ".css"; };. })(); /* webpack/runtime/global */ (() => { __webpack_require__.g = (function() { if (typeof globalThis === 'object') return globalThis; try { return this || new Function('return this')(); } catch (e) { if (typeof window === 'object') return window; } })();@ })(); /* webpack/runtime/hasOwnProperty shorthand */ (() => { X__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))3 })(); /* webpack/runtime/load script */ (() => { var inProgress = {}; var dataWebpackPrefix = "_N_E:"; // loadScript function to load a script via script tag __webpack_require__.l = (url, done, key, chunkId) => { if(inProgress[url]) { inProgress[url].push(done); return; } var script, needAttach; if(key !== undefined) { var scripts = document.getElementsByTagName("script"); for(var i = 0; i < scripts.length; i++) { var s = scripts[i]; if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } } } if(!script) { needAttach = true; script = document.createElement('script'); script.charset = 'utf-8'; script.timeout = 120; if (__webpack_require__.nc) { script.setAttribute("nonce", __webpack_require__.nc); } script.setAttribute("data-webpack", dataWebpackPrefix + key); script.src = __webpack_require__.tu(url); } inProgress[url] = [done]; var onScriptComplete = (prev, event) => { // avoid mem leaks in IE. script.onerror = script.onload = null; clearTimeout(timeout); var doneFns = inProgress[url]; delete inProgress[url]; script.parentNode && script.parentNode.removeChild(script); doneFns && doneFns.forEach((fn) => (fn(event))); if(prev) return prev(event); } var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); script.onerror = onScriptComplete.bind(null, script.onerror); script.onload = onScriptComplete.bind(null, script.onload); needAttach && document.head.appendChild(script); };= })(); /* webpack/runtime/make namespace object */ (() => { // define __esModule on exports __webpack_require__.r = (exports) => { if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); } Object.defineProperty(exports, '__esModule', { value: true }); };< })(); /* webpack/runtime/trusted types policy */ (() => { var policy; __webpack_require__.tt = () => { // Create Trusted Type policy if Trusted Types are available and the policy doesn't exist yet. if (policy === undefined) { policy = { createScriptURL: (url) => (url) }; if (typeof trustedTypes !== "undefined" && trustedTypes.createPolicy) { policy = trustedTypes.createPolicy("nextjs#bundler", policy); } } return policy; };@ })(); /* webpack/runtime/trusted types script url */ (() => { R__webpack_require__.tu = (url) => (__webpack_require__.tt().createScriptURL(url));2 })(); /* webpack/runtime/publicPath */ (() => { "__webpack_require__.p = "/_next/";3 })(); /* webpack/runtime/css loading */ (() => {  var createStylesheet = (chunkId, fullhref, resolve, reject) => { var linkTag = document.createElement("link"); linkTag.rel = "stylesheet"; linkTag.type = "text/css"; var onLinkComplete = (event) => { // avoid mem leaks. linkTag.onerror = linkTag.onload = null; if (event.type === 'load') { resolve(); } else { var errorType = event && (event.type === 'load' ? 'missing' : event.type); var realHref = event && event.target && event.target.href || fullhref; var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + realHref + ")"); err.code = "CSS_CHUNK_LOAD_FAILED"; err.type = errorType; err.request = realHref; linkTag.parentNode.removeChild(linkTag) reject(err); } } linkTag.onerror = linkTag.onload = onLinkComplete; linkTag.href = fullhref; (function(linkTag) { if (typeof _N_E_STYLE_LOAD === 'function') { const { href, onload, onerror } = linkTag; _N_E_STYLE_LOAD(href.indexOf(window.location.origin) === 0 ? new URL(href).pathname : href).then(()=>onload == null ? void 0 : onload.call(linkTag, { type: 'load' }), ()=>onerror == null ? void 0 : onerror.call(linkTag, {})); } else { document.head.appendChild(linkTag); } })(linkTag) return linkTag; }; var findStylesheet = (href, fullhref) => { var existingLinkTags = document.getElementsByTagName("link"); for(var i = 0; i < existingLinkTags.length; i++) { var tag = existingLinkTags[i]; var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href"); if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag; } var existingStyleTags = document.getElementsByTagName("style"); for(var i = 0; i < existingStyleTags.length; i++) { var tag = existingStyleTags[i]; var dataHref = tag.getAttribute("data-href"); if(dataHref === href || dataHref === fullhref) return tag; } }; var loadStylesheet = (chunkId) => { return new Promise((resolve, reject) => { var href = __webpack_require__.miniCssF(chunkId); var fullhref = __webpack_require__.p + href; if(findStylesheet(href, fullhref)) return resolve(); createStylesheet(chunkId, fullhref, resolve, reject); }); } // object to store loaded CSS chunks var installedCssChunks = { 8068: 0 }; __webpack_require__.f.miniCss = (chunkId, promises) => { var cssChunks = {"2012":1}; if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]); else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) { promises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => { installedCssChunks[chunkId] = 0; }, (e) => { delete installedCssChunks[chunkId]; throw e; })); } }; // no hmr; })(); /* webpack/runtime/jsonp chunk loading */ (() => { u // no baseURI // object to store loaded and loading chunks // undefined = chunk not loaded, null = chunk preloaded/prefetched // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded var installedChunks = { 8068: 0, 9950: 0 }; __webpack_require__.f.j = (chunkId, promises) => { // JSONP chunk loading for javascript var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; if(installedChunkData !== 0) { // 0 means "already installed". // a Promise means "currently loading". if(installedChunkData) { promises.push(installedChunkData[2]); } else { if(!/^(2012|8068|9950)$/.test(chunkId)) { // setup Promise in chunk cache var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); promises.push(installedChunkData[2] = promise); // start chunk loading var url = __webpack_require__.p + __webpack_require__.u(chunkId); // create error before stack unwound to get useful stacktrace later var error = new Error(); var loadingEnded = (event) => { if(__webpack_require__.o(installedChunks, chunkId)) { installedChunkData = installedChunks[chunkId]; if(installedChunkData !== 0) installedChunks[chunkId] = undefined; if(installedChunkData) { var errorType = event && (event.type === 'load' ? 'missing' : event.type); var realSrc = event && event.target && event.target.src; error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; error.name = 'ChunkLoadError'; error.type = errorType; error.request = realSrc; installedChunkData[1](error); } } }; __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); } else installedChunks[chunkId] = 0; } } }; // no prefetching // no preloaded // no HMR // no HMR manifest __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); // install a JSONP callback for chunk loading var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { var [chunkIds, moreModules, runtime] = data; // add "moreModules" to the modules object, // then flag all "chunkIds" as loaded and fire callback var moduleId, chunkId, i = 0; if(chunkIds.some((id) => (installedChunks[id] !== 0))) { for(moduleId in moreModules) { if(__webpack_require__.o(moreModules, moduleId)) { __webpack_require__.m[moduleId] = moreModules[moduleId]; } } if(runtime) var result = runtime(__webpack_require__); } if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); for(;i < chunkIds.length; i++) { chunkId = chunkIds[i]; if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { installedChunks[chunkId][0](); } installedChunks[chunkId] = 0; } return __webpack_require__.O(result); } var chunkLoadingGlobal = self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []; chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); })(); +" !!!/******/ })() ; 7 webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcef"use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6467],{ /***/ 6467: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource swebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 0webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceI__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceV*/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useLocale } from '@/context/locale'; import { createSupportTicket } from '@/lib/api'; export default function SupportModal(param) { let { onClose } = param; const { t } = useLocale(); const [type, setType] = useState('bug'); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await createSupportTicket({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ _jsxs("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ _jsx("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } c,={}_ [c>EmtEWeh.2x| _" e h KNY\9<  RV orloT*-.1!!h!k!i"l"J%M%&&&&>(A((0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)buffersourcesizemapshash93__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function SupportModal(param) { let { onClose } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); const [type, setType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('bug'); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSourceI__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); ReplaceSourceRawSourceV*/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useLocale } from '@/context/locale'; import { createSupportTicket } from '@/lib/api'; export default function SupportModal(param) { let { onClose } = param; const { t } = useLocale(); const [type, setType] = useState('bug'); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await createSupportTicket({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ _jsxs("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ _jsx("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); }  61123undefined125157undefined159203undefined205252undefined254268undefined347355(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined388395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined439446(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined574581(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined621628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13491367(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)undefined16371640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18381842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19801984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21682172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23352338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27022705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined31733176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34683471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36593662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39873990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43774381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined45194522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46974700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51295132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54585462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56425646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57435746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59965999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62946298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68366839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73657369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74667469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77267729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84518455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85528555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88098812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95469549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97319735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98909893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1030210305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) buffersourcesizemapshash3/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function SupportModal(param) { let { onClose } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); const [type, setType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('bug'); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { I__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); ReplaceSourceRawSourceV*/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { useLocale } from '@/context/locale'; import { createSupportTicket } from '@/lib/api'; export default function SupportModal(param) { let { onClose } = param; const { t } = useLocale(); const [type, setType] = useState('bug'); const [subject, setSubject] = useState(''); const [body, setBody] = useState(''); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await createSupportTicket({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ _jsxs("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ _jsx("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ _jsx("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ _jsx("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); }  61123undefined125157undefined159203undefined205252undefined254268undefined347355(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined388395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined439446(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined481488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined529536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined574581(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined621628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13491367(0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)undefined16371640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18381842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined19801984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined21682172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23352338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27022705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined31733176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34683471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined36593662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39873990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43774381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined45194522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined46974700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49214924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51295132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54585462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56425646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined57435746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59965999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62946298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined68366839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73657369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined74667469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77267729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84518455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85528555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88098812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95469549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97319735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined98909893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1030210305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ }) }]); $4"use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6467],{ /***/ 6467: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SupportModal) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function SupportModal(param) { let { onClose } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); const [type, setType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('bug'); const [subject, setSubject] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [body, setBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [sent, setSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const TYPES = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' } ]; async function handleSubmit(e) { e.preventDefault(); setError(''); setLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_3__/* .createSupportTicket */ .mq)({ type, subject, body }); setSent(true); } catch (e) { setError(t('support.error')); } finally{ setLoading(false); } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", onClick: (e)=>e.target === e.currentTarget && onClose(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-900", children: t('support.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), sent ? /* Success state */ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-6 py-10 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-5xl mb-4", children: "✅" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: t('support.sent.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-6", children: t('support.sent.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onClose, className: "bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700", children: t('support.sent.close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "px-6 py-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('support.type.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-2", children: TYPES.map((param)=>{ let { value, label, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setType(value), className: "flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(type === value ? color + ' border-opacity-100' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl", children: icon }), label ] }, value); }) }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.subject') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: subject, onChange: (e)=>setSubject(e.target.value), required: true, minLength: 3, maxLength: 200, placeholder: t('support.subject.placeholder'), 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" }) ] }), /*#__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-sm font-medium text-gray-700 mb-1", children: t('support.body') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: body, onChange: (e)=>setBody(e.target.value), required: true, minLength: 10, maxLength: 5000, rows: 5, placeholder: t('support.body.placeholder'), 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 resize-none" }) ] }), error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onClose, className: "flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50", children: t('support.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: loading, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: loading ? '...' : t('support.submit') }) ] }) ] }) ] }) }); } /***/ }) }]); ( ` )f"use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6467],{ /***/ 6467: (Q/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { ') }]); g'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcef"use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2982],{ /***/ 2982: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 7webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 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 */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceu// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "object" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if ("object" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; export const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request("/tasks/".concat(id)); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); export const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); export const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); export const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); export const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); export const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); export const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); export const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; export const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); export const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); export const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request("/admin/users/".concat(id)); export const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); export const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; export const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); export const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; export const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); export const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; export const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; export const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; export const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; export const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; export const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; export const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; export const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; export const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; export const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; export const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; export const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); export const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; export const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); export const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); _25;jp 9?.4jp_ms    q w  + 1 }  <B_CIGM OU"(QW_<B$\bou{_!!""u"{"*#0#q#w###$$"&(&&&8'>'((e)k)))T+Z+,,,_,..002222;3A3}33!4'455B5H555a6g67%7Y7_777h8n89_$9^9d9998:>:::;;;;^=d=>>??x@~@=ACABBCCDDFFG_GGGHHIIOIII:K@KKK?LELLLLLrMxMNNNN OOOORPXPP_QQQ(R.RRRSSST1U7UUUV VVVWWQYWYYZZZ[[a[[[\_\W\]\]]^!^^^&_,_` `P`V```2a8aaaDbJbbb ccycc(d.dzdPdddee:f@fffNgTg hhhh'i-i false0"https://api.canhelp.gr"0false{}buffersourcesizemapshash%/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = false ? 0 : "https://api.canhelp.gr" || 0; async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if (false) {} const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request("/tasks/".concat(id)); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request("/admin/users/".concat(id)); const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); {"finalSource":true}mapbufferedMap ConcatSourceRawSource&/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ ReplaceSourceRawSourceu// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "object" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if ("object" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; export const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request("/tasks/".concat(id)); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); export const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); export const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); export const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); export const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); export const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); export const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); export const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; export const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); export const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); export const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request("/admin/users/".concat(id)); export const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); export const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; export const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); export const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; export const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); export const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; export const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; export const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; export const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; export const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; export const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; export const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; export const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; export const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; export const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; export const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; export const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); export const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; export const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); export const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) });  164187 falseundefined1912450undefined249279"https://api.canhelp.gr"undefined2843060undefined309315undefined415438falseundefined441476{}undefined11301136undefined12741280undefined14411447undefined15411547undefined15931599undefined17571763undefined18381844undefined18981904undefined20192025undefined21572163undefined22682274undefined24542460undefined25322538undefined25862592undefined27092715undefined28182824undefined29292935undefined30843090undefined32463252undefined33713377undefined34533459undefined35883594undefined36443650undefined37323738undefined38173823undefined39073913undefined41674173undefined43014307undefined43644370undefined44314437undefined45424548undefined46424648undefined47534759undefined49454951undefined50135019undefined52655271undefined53475353undefined55175523undefined56525658undefined57855791undefined58405846undefined59485954undefined60616067undefined61386144undefined62806286undefined65856591undefined66536659undefined67896795undefined69426948undefined71337139undefined72607266undefined73897395undefined75357541undefined76407646undefined78037809undefined80948100undefined81528158undefined85838589undefined87048710undefined88218827undefined90029008undefined90739079undefined91889194undefined93589364undefined97629768undefined99119917undefined1004010046undefined1047910485undefined1059710603undefined1070510711undefined1109211098undefined1128511291undefined1148411490undefined1202012026undefined1249312499undefined1297212978undefined1304813054undefined1311513121undefined1318113187undefined1334513351undefined1356813574undefined1363413640undefined1376913775undefined1392113927undefined1411114117undefined1416914175undefined1429614302undefined1444014446undefined1462214628undefined1468614692undefined1482414830undefined1490414910undefined1507515081undefined1524215248undefined1534615352undefined1571015716undefined1605116057undefined1612916135undefined1650416510undefined1670116707undefined1708517091undefined1738617392undefined1763417640undefined1806218068undefined1817818184undefined1839118397undefined1861118617undefined1876118767undefined1882118827undefined1925819264undefined1940919415undefined1951919525undefined1961119617undefined1968419690undefined1982619832undefined1998519991undefined2011920125undefined2023720243undefined2040820414undefined2056220568undefined2073320739undefined2090320909undefined2103221038undefined2121021216undefined2137621382undefined2150121507undefined2180921815undefined2197521981undefined2204222048undefined2224622252undefined2244422450undefined2286522871undefined2303723043undefined2321523221undefined2338723393undefined2351523521undefined2357523581undefined2363923645undefined2403324039undefined2409124097undefined2428824294undefined2435824364undefined2458124587undefined2465624662undefined2472724733undefined2488224888undefined2496724973undefined2515625162undefined2523525241undefined2535325359undefined2546525471undefined2564025646undefined2572225728undefined2578725793undefined2600826014undefined2617026176undefined2631426320undefined2644626452undefined2663426640undefined2675926765undefined2691926925undefined /***/ }) buffersourcesizemapshash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = false ? 0 : "https://api.canhelp.gr" || 0; async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if (false) {} const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request("/tasks/".concat(id)); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request("/admin/users/".concat(id)); const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { &/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ ReplaceSourceRawSourceu// SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = "object" === 'undefined' ? process.env.INTERNAL_API_URL || 'http://localhost:4000' : process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if ("object" === 'undefined') console.log('[api] SSR fetch', url); const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── export const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; export const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; export const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); export const getMyTasks = ()=>request('/tasks/my'); export const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; export const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); export const getTask = (id)=>request("/tasks/".concat(id)); export const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); export const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); export const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── export const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); export const getMyOffers = ()=>request('/offers/my'); export const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); export const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); export const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); export const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; export const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); export const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); export const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── export const getChatRooms = ()=>request('/chat/rooms'); export const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); export const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); export const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); export const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── export const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); export const getNotifications = ()=>request('/notifications'); export const getUnreadCount = ()=>request('/notifications/count'); export const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); export const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); export const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); export const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── export const getMyReferralInfo = ()=>request('/users/me/referral'); export const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── export const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); export const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── export const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── export const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── export const getFavorites = ()=>request('/favorites'); export const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); export const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); export const getSpecialistFavorites = ()=>request('/favorites/specialists'); export const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); export const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── export const getAdminCategories = ()=>request('/admin/categories'); export const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); export const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── export const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); export const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); export const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); export const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); export const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── export const getAdminStats = ()=>request('/admin/stats'); export const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; export const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); export const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); export const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); export const getAdminUser = (id)=>request("/admin/users/".concat(id)); export const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); export const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; export const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); export const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; export const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); export const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); export const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; export const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); export const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; export const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; export const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; export const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; export const getAdminNotifStats = ()=>request('/admin/notification-stats'); export const getAdminMailStats = ()=>request('/admin/mail-stats'); export const getAdminReferrals = ()=>request('/admin/referrals'); export const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); export const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── export const getAdminLocations = ()=>request('/admin/locations'); export const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); export const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── export const getAdminPlans = ()=>request('/admin/plans'); export const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); export const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── export const getAdminSettings = ()=>request('/admin/settings'); export const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); export const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); export const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); export const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); export const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); export const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); export const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); export const getTranslationsStats = ()=>request('/admin/translations/stats'); export const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; export const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); export const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; export const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; export const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; export const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── export const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); export const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); export const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); export const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); export const getMyPortfolio = ()=>request('/portfolio/my'); export const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); export const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); export const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); export const getMySpecialistCards = ()=>request('/specialist-cards/my'); export const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); export const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); export const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); export const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); export const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); export const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); export const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); export const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); export const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); export const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; export const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); export const getPaymentHistory = ()=>request('/payments/history'); export const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; export const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; export const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; export const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); export const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); export const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); export const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; export const getMyDashboard = ()=>request('/dashboard/me'); export const getDailyUsage = ()=>request('/plans/daily-usage'); export const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── export const getMyStatuses = ()=>request('/statuses/me'); export const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); export const getAutoResponseSettings = ()=>request('/auto-response'); export const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── export const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); export const getCustomerFomoDashboard = ()=>request('/fomo/customer'); export const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── export const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); export const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── export const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); export const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); export const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); export const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── export const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); export const getSiteStats = ()=>request('/users/me/site-stats'); export const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── export const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── export const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); export const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); export const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; export const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); export const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); export const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) });  164187 falseundefined1912450undefined249279"https://api.canhelp.gr"undefined2843060undefined309315undefined415438falseundefined441476{}undefined11301136undefined12741280undefined14411447undefined15411547undefined15931599undefined17571763undefined18381844undefined18981904undefined20192025undefined21572163undefined22682274undefined24542460undefined25322538undefined25862592undefined27092715undefined28182824undefined29292935undefined30843090undefined32463252undefined33713377undefined34533459undefined35883594undefined36443650undefined37323738undefined38173823undefined39073913undefined41674173undefined43014307undefined43644370undefined44314437undefined45424548undefined46424648undefined47534759undefined49454951undefined50135019undefined52655271undefined53475353undefined55175523undefined56525658undefined57855791undefined58405846undefined59485954undefined60616067undefined61386144undefined62806286undefined65856591undefined66536659undefined67896795undefined69426948undefined71337139undefined72607266undefined73897395undefined75357541undefined76407646undefined78037809undefined80948100undefined81528158undefined85838589undefined87048710undefined88218827undefined90029008undefined90739079undefined91889194undefined93589364undefined97629768undefined99119917undefined1004010046undefined1047910485undefined1059710603undefined1070510711undefined1109211098undefined1128511291undefined1148411490undefined1202012026undefined1249312499undefined1297212978undefined1304813054undefined1311513121undefined1318113187undefined1334513351undefined1356813574undefined1363413640undefined1376913775undefined1392113927undefined1411114117undefined1416914175undefined1429614302undefined1444014446undefined1462214628undefined1468614692undefined1482414830undefined1490414910undefined1507515081undefined1524215248undefined1534615352undefined1571015716undefined1605116057undefined1612916135undefined1650416510undefined1670116707undefined1708517091undefined1738617392undefined1763417640undefined1806218068undefined1817818184undefined1839118397undefined1861118617undefined1876118767undefined1882118827undefined1925819264undefined1940919415undefined1951919525undefined1961119617undefined1968419690undefined1982619832undefined1998519991undefined2011920125undefined2023720243undefined2040820414undefined2056220568undefined2073320739undefined2090320909undefined2103221038undefined2121021216undefined2137621382undefined2150121507undefined2180921815undefined2197521981undefined2204222048undefined2224622252undefined2244422450undefined2286522871undefined2303723043undefined2321523221undefined2338723393undefined2351523521undefined2357523581undefined2363923645undefined2403324039undefined2409124097undefined2428824294undefined2435824364undefined2458124587undefined2465624662undefined2472724733undefined2488224888undefined2496724973undefined2515625162undefined2523525241undefined2535325359undefined2546525471undefined2564025646undefined2572225728undefined2578725793undefined2600826014undefined2617026176undefined2631426320undefined2644626452undefined2663426640undefined2675926765undefined2691926925undefined RawSource /***/ }) }]); "use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2982],{ /***/ 2982: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $7: () => (/* binding */ updateCategory), /* harmony export */ $H: () => (/* binding */ acceptOffer), /* harmony export */ $M: () => (/* binding */ getUnreadCount), /* harmony export */ Bb: () => (/* binding */ getMySpecialistCards), /* harmony export */ Bm: () => (/* binding */ getUserRating), /* harmony export */ Bq: () => (/* binding */ getSpecialistCards), /* harmony export */ Br: () => (/* binding */ getAdminNotifLogs), /* harmony export */ C0: () => (/* binding */ applyMyReferral), /* harmony export */ CX: () => (/* binding */ updateAdminSettings), /* harmony export */ Ck: () => (/* binding */ getPriceList), /* harmony export */ Cs: () => (/* binding */ previewPlanChange), /* harmony export */ D1: () => (/* binding */ setAvailabilityRange), /* harmony export */ Em: () => (/* binding */ request), /* harmony export */ F7: () => (/* binding */ getSpecialists), /* harmony export */ F9: () => (/* binding */ getTaskInvite), /* harmony export */ FI: () => (/* binding */ sendTestEmail), /* harmony export */ Fu: () => (/* binding */ getMyTasks), /* harmony export */ GB: () => (/* binding */ deleteTaskAdmin), /* harmony export */ GE: () => (/* binding */ getSkillDedup), /* harmony export */ Gp: () => (/* binding */ getAutoResponseSettings), /* harmony export */ H: () => (/* binding */ getMyDashboard), /* harmony export */ H6: () => (/* binding */ getTaskReviews), /* harmony export */ He: () => (/* binding */ activateUser), /* harmony export */ I: () => (/* binding */ autoTranslateTasks), /* harmony export */ Ic: () => (/* binding */ deletePriceListGroup), /* harmony export */ Ip: () => (/* binding */ markRead), /* harmony export */ Je: () => (/* binding */ purchasePlan), /* harmony export */ K7: () => (/* binding */ deleteCategory), /* harmony export */ KD: () => (/* binding */ getAdminCategories), /* harmony export */ KZ: () => (/* binding */ getAdminSupportTickets), /* harmony export */ Lb: () => (/* binding */ declineOffer), /* harmony export */ Lp: () => (/* binding */ getAdminEmailTemplates), /* harmony export */ ML: () => (/* binding */ getCustomerFomoDashboard), /* harmony export */ Mm: () => (/* binding */ changeUserRole), /* harmony export */ NL: () => (/* binding */ markAllRead), /* harmony export */ Nt: () => (/* binding */ updateLocation), /* harmony export */ O8: () => (/* binding */ sendPublicSupportMessage), /* harmony export */ OM: () => (/* binding */ setAvailability), /* harmony export */ OV: () => (/* binding */ runAutoMatch), /* harmony export */ OX: () => (/* binding */ getAdminPlans), /* harmony export */ On: () => (/* binding */ getCanMessage), /* harmony export */ P0: () => (/* binding */ adminTopUpUserBalance), /* harmony export */ QN: () => (/* binding */ getOrCreateDirectRoom), /* harmony export */ QY: () => (/* binding */ getTasksTranslationPreview), /* harmony export */ RN: () => (/* binding */ getSiteStats), /* harmony export */ RQ: () => (/* binding */ updateAutoResponseSettings), /* harmony export */ Rt: () => (/* binding */ completeTask), /* harmony export */ S$: () => (/* binding */ getPublicSiteProfile), /* harmony export */ S9: () => (/* binding */ createSkill), /* harmony export */ Sw: () => (/* binding */ getOffers), /* harmony export */ T9: () => (/* binding */ getPlans), /* harmony export */ Tr: () => (/* binding */ getNotifications), /* harmony export */ U9: () => (/* binding */ deletePriceListItem), /* harmony export */ UE: () => (/* binding */ trackSiteMessage), /* harmony export */ UT: () => (/* binding */ createTask), /* harmony export */ Uq: () => (/* binding */ mergeSkillDuplicates), /* harmony export */ V: () => (/* binding */ addSpecialistFavorite), /* harmony export */ V7: () => (/* binding */ adminBroadcastPush), /* harmony export */ VL: () => (/* binding */ getMessages), /* harmony export */ VM: () => (/* binding */ getUserProfile), /* harmony export */ Vs: () => (/* binding */ getLocations), /* harmony export */ Wi: () => (/* binding */ deactivateUser), /* harmony export */ Xz: () => (/* binding */ getSpecialistAvailability), /* harmony export */ YQ: () => (/* binding */ getTranslationsStats), /* harmony export */ Yj: () => (/* binding */ getAdminTasks), /* harmony export */ Z2: () => (/* binding */ createPriceListItem), /* harmony export */ Zp: () => (/* binding */ getChatRooms), /* harmony export */ _z: () => (/* binding */ sendMessage), /* harmony export */ aT: () => (/* binding */ getMyOffers), /* harmony export */ bR: () => (/* binding */ deletePlan), /* harmony export */ bW: () => (/* binding */ getCategories), /* harmony export */ bc: () => (/* binding */ toggleStatus), /* harmony export */ bi: () => (/* binding */ getAdminNotifStats), /* harmony export */ bx: () => (/* binding */ createReview), /* harmony export */ cJ: () => (/* binding */ getAdminReferrals), /* harmony export */ cS: () => (/* binding */ getAdminUsers), /* harmony export */ cl: () => (/* binding */ verifyTelegramToken), /* harmony export */ cp: () => (/* binding */ autoTranslate), /* harmony export */ dE: () => (/* binding */ getAdminStats), /* harmony export */ eR: () => (/* binding */ createSpecialistCard), /* harmony export */ eU: () => (/* binding */ updateReportStatus), /* harmony export */ ew: () => (/* binding */ getPlanHistory), /* harmony export */ f5: () => (/* binding */ deleteSpecialistCard), /* harmony export */ fP: () => (/* binding */ updateSkill), /* harmony export */ fm: () => (/* binding */ getBalanceHistory), /* harmony export */ fu: () => (/* binding */ autoTranslateEmailTemplates), /* harmony export */ g0: () => (/* binding */ getAdminBalanceHistory), /* harmony export */ g1: () => (/* binding */ adminSendPushToUser), /* harmony export */ gg: () => (/* binding */ getTask), /* harmony export */ hD: () => (/* binding */ adminWithdrawUserBalance), /* harmony export */ hl: () => (/* binding */ updatePortfolioItem), /* harmony export */ hp: () => (/* binding */ deleteSkill), /* harmony export */ iN: () => (/* binding */ getMyAvailability), /* harmony export */ i_: () => (/* binding */ getAdminSkills), /* harmony export */ j_: () => (/* binding */ getAdminAiLogs), /* harmony export */ jd: () => (/* binding */ getAdminUser), /* harmony export */ jg: () => (/* binding */ updateAdminEmailTemplate), /* harmony export */ k_: () => (/* binding */ getAdminLocations), /* harmony export */ lC: () => (/* binding */ updateTask), /* harmony export */ mq: () => (/* binding */ createSupportTicket), /* harmony export */ nT: () => (/* binding */ replyToSupportTicket), /* harmony export */ nf: () => (/* binding */ cancelTaskAdmin), /* harmony export */ oD: () => (/* binding */ updatePriceListGroup), /* harmony export */ oh: () => (/* binding */ initiateTopUp), /* harmony export */ oq: () => (/* binding */ adminUpdateSpecialistCard), /* harmony export */ pD: () => (/* binding */ getSpecialistFavorites), /* harmony export */ pK: () => (/* binding */ getPaymentHistory), /* harmony export */ q7: () => (/* binding */ getMyReviews), /* harmony export */ qT: () => (/* binding */ createPlan), /* harmony export */ qX: () => (/* binding */ testTelegramConnection), /* harmony export */ qt: () => (/* binding */ getAdminMailLogs), /* harmony export */ rC: () => (/* binding */ getAdminSettings), /* harmony export */ rl: () => (/* binding */ getSkillSuggestions), /* harmony export */ sD: () => (/* binding */ removeSpecialistFavorite), /* harmony export */ s_: () => (/* binding */ getAdminSpecialistCards), /* harmony export */ st: () => (/* binding */ getMyReferralInfo), /* harmony export */ td: () => (/* binding */ updatePlan), /* harmony export */ ts: () => (/* binding */ createOffer), /* harmony export */ u0: () => (/* binding */ setSupportTicketStatus), /* harmony export */ u4: () => (/* binding */ getAdminMailStats), /* harmony export */ uQ: () => (/* binding */ verifyAdminUserEmail), /* harmony export */ v9: () => (/* binding */ getUserReviews), /* harmony export */ vD: () => (/* binding */ createPriceListGroup), /* harmony export */ vh: () => (/* binding */ getTaskStats), /* harmony export */ vy: () => (/* binding */ getAdminUserSpecialistCards), /* harmony export */ wc: () => (/* binding */ translateAdminEmailTemplate), /* harmony export */ wl: () => (/* binding */ updateAdminUser), /* harmony export */ yJ: () => (/* binding */ createLocation), /* harmony export */ yO: () => (/* binding */ getAdminActivityLogs), /* harmony export */ yk: () => (/* binding */ dismissNotification), /* harmony export */ z4: () => (/* binding */ getDailyUsage), /* harmony export */ z5: () => (/* binding */ getAdminReports), /* harmony export */ z6: () => (/* binding */ getMyStatuses), /* harmony export */ zB: () => (/* binding */ deletePortfolioItem), /* harmony export */ zR: () => (/* binding */ deleteLocation), /* harmony export */ zZ: () => (/* binding */ createCategory), /* harmony export */ zc: () => (/* binding */ updateSpecialistCard), /* harmony export */ zk: () => (/* binding */ getSpecialistFomoDashboard) /* harmony export */ }); /* unused harmony exports getTasks, getTaskBudgetRange, searchTasks, getTasksForSpecialist, getTaskCountsByCategory, cancelTask, updateNotifSettings, getFavorites, addFavorite, removeFavorite, getTranslationsMissing, saveTranslations, getMyPortfolio, addPortfolioItem, getSpecialistPortfolio, saveSiteSeo, updatePriceListItem, getFomoRecommendations, getAutoMatchResults, getGoogleCalendarStatus, disconnectGoogleCalendar, importFromGoogleCalendar, getGoogleCalendarConnectUrl, getMySupportTickets */ // SSR: use INTERNAL_API_URL (http://localhost:4000) to avoid external DNS/SSL round-trip // Browser: use NEXT_PUBLIC_API_URL (https://api.canhelp.gr) const BASE = false ? 0 : "https://api.canhelp.gr" || 0; async function request(path, init) { const url = "".concat(BASE, "/api").concat(path); if (false) {} const res = await fetch(url, { ...init, credentials: 'include', headers: { 'Content-Type': 'application/json', ...init === null || init === void 0 ? void 0 : init.headers } }); if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); const msg = typeof err.error === 'string' ? err.error : typeof err.message === 'string' ? err.message : res.statusText || 'Request failed'; throw new Error(msg); } return res.json(); } // ─── Tasks ──────────────────────────────────────────────────────────────── const getTasks = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks".concat(qs)); }; const getTaskBudgetRange = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/budget-range".concat(qs)); }; const searchTasks = (params)=>request("/tasks/search?".concat(new URLSearchParams(params))); const getMyTasks = ()=>request('/tasks/my'); const getTasksForSpecialist = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/tasks/for-me".concat(qs)); }; const getTaskCountsByCategory = ()=>request('/tasks/counts-by-category'); const getTask = (id)=>request("/tasks/".concat(id)); const createTask = (data)=>request('/tasks', { method: 'POST', body: JSON.stringify(data) }); const updateTask = (id, data)=>request("/tasks/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const completeTask = (id)=>request("/tasks/".concat(id, "/complete"), { method: 'PATCH' }); const cancelTask = (id)=>request("/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); // ─── Offers ──────────────────────────────────────────────────────────────── const getOffers = (taskId)=>request("/offers?taskId=".concat(taskId)); const getMyOffers = ()=>request('/offers/my'); const createOffer = (data)=>request('/offers', { method: 'POST', body: JSON.stringify(data) }); const acceptOffer = (id)=>request("/offers/".concat(id, "/accept"), { method: 'PATCH' }); const declineOffer = (id)=>request("/offers/".concat(id, "/decline"), { method: 'PATCH' }); const getUserProfile = (id, locale)=>request("/users/".concat(id, "/profile").concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getSpecialists = (params)=>{ const qs = params ? '?' + new URLSearchParams(params) : ''; return request("/users/specialists".concat(qs)); }; const createReview = (data)=>request('/reviews', { method: 'POST', body: JSON.stringify(data) }); const getTaskReviews = (taskId)=>request("/reviews/task/".concat(taskId)); const getMyReviews = ()=>request('/reviews/my'); // ─── Chat ────────────────────────────────────────────────────────────────── const getChatRooms = ()=>request('/chat/rooms'); const getOrCreateDirectRoom = (userId)=>request("/chat/direct/".concat(userId)); const getCanMessage = (userId)=>request("/chat/can-message/".concat(userId)); const getMessages = (roomId)=>request("/chat/rooms/".concat(roomId, "/messages")); const sendMessage = (roomId, body)=>request('/chat/messages', { method: 'POST', body: JSON.stringify({ roomId, body }) }); // ─── Notifications ──────────────────────────────────────────────────────── const updateNotifSettings = (data)=>request('/users/me', { method: 'PATCH', body: JSON.stringify(data) }); const getNotifications = ()=>request('/notifications'); const getUnreadCount = ()=>request('/notifications/count'); const markRead = (id)=>request("/notifications/".concat(id, "/read"), { method: 'PATCH' }); const markAllRead = ()=>request('/notifications/read-all', { method: 'PATCH' }); const getTaskInvite = (taskId)=>request("/notifications?type=task_invite&referenceId=".concat(taskId)); const dismissNotification = (id)=>request("/notifications/".concat(id), { method: 'DELETE' }); // ─── Referral ───────────────────────────────────────────────────────────── const getMyReferralInfo = ()=>request('/users/me/referral'); const applyMyReferral = (refCode)=>request('/users/me/referral/apply', { method: 'POST', body: JSON.stringify({ refCode }) }); // ─── Reviews ────────────────────────────────────────────────────────────── const getUserReviews = (userId)=>request("/reviews/user/".concat(userId)); const getUserRating = (userId)=>request("/reviews/user/".concat(userId, "/rating")); // ─── Categories ─────────────────────────────────────────────────────────── const getCategories = ()=>request('/categories'); // ─── Locations ──────────────────────────────────────────────────────────── const getLocations = ()=>request('/locations'); // ─── Favorites ──────────────────────────────────────────────────────────── const getFavorites = ()=>request('/favorites'); const addFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'POST' }); const removeFavorite = (taskId)=>request("/favorites/".concat(taskId), { method: 'DELETE' }); const getSpecialistFavorites = ()=>request('/favorites/specialists'); const addSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'POST' }); const removeSpecialistFavorite = (specialistId)=>request("/favorites/specialists/".concat(specialistId), { method: 'DELETE' }); // ─── Admin ───────────────────────────────────────────────────────────────── // ─── Admin Categories ────────────────────────────────────────────────────── const getAdminCategories = ()=>request('/admin/categories'); const createCategory = (data)=>request('/admin/categories', { method: 'POST', body: JSON.stringify(data) }); const updateCategory = (id, data)=>request("/admin/categories/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteCategory = (id)=>request("/admin/categories/".concat(id), { method: 'DELETE' }); // ─── Admin Skills ────────────────────────────────────────────────────────── const getAdminSkills = (categorySlug)=>request("/admin/skills?categorySlug=".concat(encodeURIComponent(categorySlug))); const createSkill = (data)=>request('/admin/skills', { method: 'POST', body: JSON.stringify(data) }); const updateSkill = (id, data)=>request("/admin/skills/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteSkill = (id)=>request("/admin/skills/".concat(id), { method: 'DELETE' }); const getSkillDedup = (categorySlug)=>request("/admin/skills/dedup".concat(categorySlug ? "?categorySlug=".concat(encodeURIComponent(categorySlug)) : '')); const mergeSkillDuplicates = (keepId, deleteIds)=>request('/admin/skills/dedup/merge', { method: 'POST', body: JSON.stringify({ keepId, deleteIds }) }); // ─── Admin ───────────────────────────────────────────────────────────────── const getAdminStats = ()=>request('/admin/stats'); const getAdminUsers = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, role = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (role) p.set('role', role); return request("/admin/users?".concat(p)); }; const deactivateUser = (id)=>request("/admin/users/".concat(id, "/deactivate"), { method: 'PATCH' }); const activateUser = (id)=>request("/admin/users/".concat(id, "/activate"), { method: 'PATCH' }); const changeUserRole = (id, role)=>request("/admin/users/".concat(id, "/role"), { method: 'PATCH', body: JSON.stringify({ role }) }); const getAdminUser = (id)=>request("/admin/users/".concat(id)); const getAdminUserSpecialistCards = (userId)=>request("/admin/users/".concat(userId, "/specialist-cards")); const adminUpdateSpecialistCard = (id, data)=>request("/admin/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const getAdminSpecialistCards = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/specialist-cards?".concat(p)); }; const updateAdminUser = (id, data)=>request("/admin/users/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const verifyAdminUserEmail = (id)=>request("/admin/users/".concat(id, "/verify-email"), { method: 'PATCH' }); const getAdminTasks = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, q = arguments.length > 1 ? arguments[1] : void 0, status = arguments.length > 2 ? arguments[2] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (q) p.set('q', q); if (status) p.set('status', status); return request("/admin/tasks?".concat(p)); }; const cancelTaskAdmin = (id)=>request("/admin/tasks/".concat(id, "/cancel"), { method: 'PATCH' }); const deleteTaskAdmin = (id)=>request("/admin/tasks/".concat(id), { method: 'DELETE' }); const getAdminReports = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, status = arguments.length > 1 ? arguments[1] : void 0; const p = new URLSearchParams({ page: String(page), limit: '20' }); if (status && status !== 'all') p.set('status', status); return request("/admin/reports?".concat(p)); }; const updateReportStatus = (id, status)=>request("/admin/reports/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); const getAdminAiLogs = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/admin/ai-logs?page=".concat(page, "&limit=50")); }; const getAdminActivityLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.userId) p.set('userId', params.userId); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/activity-logs?".concat(p)); }; const getAdminMailLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.event) p.set('event', params.event); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/mail-logs?".concat(p)); }; const getAdminNotifLogs = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.type) p.set('type', params.type); if (params.dateFrom) p.set('dateFrom', params.dateFrom); if (params.dateTo) p.set('dateTo', params.dateTo); p.set('limit', '50'); return request("/admin/notification-logs?".concat(p)); }; const getAdminNotifStats = ()=>request('/admin/notification-stats'); const getAdminMailStats = ()=>request('/admin/mail-stats'); const getAdminReferrals = ()=>request('/admin/referrals'); const adminSendPushToUser = (userId, data)=>request("/admin/push/user/".concat(userId), { method: 'POST', body: JSON.stringify(data) }); const adminBroadcastPush = (data)=>request('/admin/push/broadcast', { method: 'POST', body: JSON.stringify(data) }); // ─── Admin Locations ─────────────────────────────────────────────────────── const getAdminLocations = ()=>request('/admin/locations'); const createLocation = (data)=>request('/admin/locations', { method: 'POST', body: JSON.stringify(data) }); const updateLocation = (id, data)=>request("/admin/locations/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deleteLocation = (id)=>request("/admin/locations/".concat(id), { method: 'DELETE' }); // ─── Admin Plans ─────────────────────────────────────────────────────────── const getAdminPlans = ()=>request('/admin/plans'); const createPlan = (data)=>request('/admin/plans', { method: 'POST', body: JSON.stringify(data) }); const updatePlan = (id, data)=>request("/admin/plans/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePlan = (id)=>request("/admin/plans/".concat(id), { method: 'DELETE' }); // ─── Admin Settings ──────────────────────────────────────────────────────── const getAdminSettings = ()=>request('/admin/settings'); const updateAdminSettings = (data)=>request('/admin/settings', { method: 'PUT', body: JSON.stringify(data) }); const getAdminEmailTemplates = ()=>request('/admin/settings/templates'); const updateAdminEmailTemplate = (key, data)=>request("/admin/settings/templates/".concat(key), { method: 'PUT', body: JSON.stringify(data) }); const translateAdminEmailTemplate = (data)=>request('/admin/settings/templates/translate', { method: 'POST', body: JSON.stringify(data) }); const sendTestEmail = ()=>request('/admin/settings/test-email', { method: 'POST' }); const testTelegramConnection = (botToken, chatId)=>fetch("".concat(BASE, "/api/admin/settings/test-telegram"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken, chatId }) }).then((r)=>r.json()); const verifyTelegramToken = (botToken)=>fetch("".concat(BASE, "/api/admin/settings/verify-telegram-token"), { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ botToken }) }).then((r)=>r.json()); const getTranslationsStats = ()=>request('/admin/translations/stats'); const getTranslationsMissing = function(table, missingLang) { let page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, limit = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 50; return request("/admin/translations/".concat(table, "?missingLang=").concat(missingLang, "&page=").concat(page, "&limit=").concat(limit)); }; const saveTranslations = (table, items)=>request("/admin/translations/".concat(table, "/save"), { method: 'POST', body: JSON.stringify({ items }) }); const autoTranslate = function(table, missingLang, fromLang) { let batchSize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 500; return request('/admin/translations/auto-translate', { method: 'POST', body: JSON.stringify({ table, missingLang, fromLang, batchSize }) }); }; const autoTranslateTasks = function() { let batchSize = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 500; return request('/admin/translations/auto-translate-tasks', { method: 'POST', body: JSON.stringify({ batchSize }) }); }; const getTasksTranslationPreview = function(lang) { let limit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 50; return request("/admin/translations/tasks-preview?lang=".concat(lang, "&limit=").concat(limit)); }; const autoTranslateEmailTemplates = function(missingLang) { let fromLang = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'el'; return request('/admin/translations/auto-translate-templates', { method: 'POST', body: JSON.stringify({ missingLang, fromLang }) }); }; // ─── Availability ────────────────────────────────────────────────────────── const getMyAvailability = (month)=>request("/availability/my".concat(month ? "?month=".concat(month) : '')); const setAvailability = (date, status, note)=>request('/availability/set', { method: 'POST', body: JSON.stringify({ date, status, note }) }); const setAvailabilityRange = (from, to, status)=>request('/availability/set-range', { method: 'POST', body: JSON.stringify({ from, to, status }) }); const getSpecialistAvailability = (userId, month)=>request("/availability/user/".concat(userId).concat(month ? "?month=".concat(month) : '')); const getMyPortfolio = ()=>request('/portfolio/my'); const addPortfolioItem = (formData)=>fetch("".concat(BASE, "/api/portfolio"), { method: 'POST', credentials: 'include', body: formData }).then(async (res)=>{ if (!res.ok) { const err = await res.json().catch(()=>({ error: res.statusText })); throw new Error(err.error || 'Upload failed'); } return res.json(); }); const updatePortfolioItem = (id, data)=>request("/portfolio/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const deletePortfolioItem = (id)=>request("/portfolio/".concat(id), { method: 'DELETE' }); const getSpecialistPortfolio = (userId)=>request("/portfolio/user/".concat(userId)); const getMySpecialistCards = ()=>request('/specialist-cards/my'); const createSpecialistCard = (data)=>request('/specialist-cards', { method: 'POST', body: JSON.stringify(data) }); const updateSpecialistCard = (id, data)=>request("/specialist-cards/".concat(id), { method: 'PATCH', body: JSON.stringify(data) }); const saveSiteSeo = (data)=>request('/users/me/site-seo', { method: 'POST', body: JSON.stringify(data) }); const deleteSpecialistCard = (id)=>request("/specialist-cards/".concat(id), { method: 'DELETE' }); const getSpecialistCards = (userId, locale)=>request("/specialist-cards/user/".concat(userId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const getPriceList = (cardId, locale)=>request("/price-list/".concat(cardId).concat(locale ? "?locale=".concat(encodeURIComponent(locale)) : '')); const createPriceListGroup = (cardId, data)=>request("/price-list/".concat(cardId, "/groups"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListGroup = (groupId, data)=>request("/price-list/groups/".concat(groupId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListGroup = (groupId)=>request("/price-list/groups/".concat(groupId), { method: 'DELETE' }); const createPriceListItem = (groupId, data)=>request("/price-list/groups/".concat(groupId, "/items"), { method: 'POST', body: JSON.stringify(data) }); const updatePriceListItem = (itemId, data)=>request("/price-list/items/".concat(itemId), { method: 'PATCH', body: JSON.stringify(data) }); const deletePriceListItem = (itemId)=>request("/price-list/items/".concat(itemId), { method: 'DELETE' }); const getSkillSuggestions = (categorySlugs)=>{ const params = (categorySlugs === null || categorySlugs === void 0 ? void 0 : categorySlugs.length) ? '?' + categorySlugs.map((s)=>"category=".concat(encodeURIComponent(s))).join('&') : ''; return request("/skill-suggestions".concat(params)); }; const initiateTopUp = (amount)=>request('/payments/topup/init', { method: 'POST', body: JSON.stringify({ amount }) }); const getPaymentHistory = ()=>request('/payments/history'); const getBalanceHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/payments/balance-history?limit=".concat(limit)); }; const getPlanHistory = function() { let limit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 50; return request("/users/me/plan-history?limit=".concat(limit)); }; const getAdminBalanceHistory = function() { let params = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const p = new URLSearchParams(); if (params.page) p.set('page', String(params.page)); if (params.userId) p.set('userId', params.userId); if (params.kind) p.set('kind', params.kind); p.set('limit', '50'); return request("/admin/balance-history?".concat(p)); }; const adminTopUpUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/topup"), { method: 'POST', body: JSON.stringify(data) }); const adminWithdrawUserBalance = (id, data)=>request("/admin/users/".concat(id, "/balance/withdraw"), { method: 'POST', body: JSON.stringify(data) }); const previewPlanChange = (planId)=>request('/payments/plan/preview', { method: 'POST', body: JSON.stringify({ planId }) }); const getPlans = (role)=>{ const qs = role ? "?role=".concat(role) : ''; return request("/plans".concat(qs)); }; const getMyDashboard = ()=>request('/dashboard/me'); const getDailyUsage = ()=>request('/plans/daily-usage'); const purchasePlan = function(planId) { let payFromBalance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return request('/payments/plan/purchase', { method: 'POST', body: JSON.stringify({ planId, payFromBalance }) }); }; // ─── Statuses ────────────────────────────────────────────────────────────── const getMyStatuses = ()=>request('/statuses/me'); const toggleStatus = (statusType, active)=>request('/statuses/toggle', { method: 'POST', body: JSON.stringify({ statusType, active }) }); const getAutoResponseSettings = ()=>request('/auto-response'); const updateAutoResponseSettings = (data)=>request('/auto-response', { method: 'PUT', body: JSON.stringify(data) }); // ─── FOMO ────────────────────────────────────────────────────────────────── const getSpecialistFomoDashboard = ()=>request('/fomo/specialist'); const getCustomerFomoDashboard = ()=>request('/fomo/customer'); const getFomoRecommendations = ()=>request('/fomo/recommendations'); // ─── Auto-match ──────────────────────────────────────────────────────────── const getAutoMatchResults = (taskId)=>request("/auto-match/".concat(taskId)); const runAutoMatch = (taskId)=>request("/auto-match/".concat(taskId), { method: 'POST' }); // ─── Google Calendar ─────────────────────────────────────────────────────── const getGoogleCalendarStatus = ()=>request('/google/calendar/status'); const disconnectGoogleCalendar = ()=>request('/google/calendar/disconnect', { method: 'DELETE' }); const importFromGoogleCalendar = ()=>request('/google/calendar/import', { method: 'POST' }); const getGoogleCalendarConnectUrl = ()=>"".concat(BASE, "/api/google/calendar/connect"); // ─── Personal site ───────────────────────────────────────────────────────── const getPublicSiteProfile = (slug)=>request("/users/site/".concat(slug)); const getSiteStats = ()=>request('/users/me/site-stats'); const trackSiteMessage = (slug)=>request("/users/site/".concat(slug, "/track-message"), { method: 'POST' }).catch(()=>{}); // ─── Task stats (FOMO) ───────────────────────────────────────────────────── const getTaskStats = (taskId)=>request("/tasks/".concat(taskId, "/stats")); // ─── Support tickets ─────────────────────────────────────────────────────── const sendPublicSupportMessage = (data)=>request('/support/public', { method: 'POST', body: JSON.stringify(data) }); const createSupportTicket = (data)=>request('/support', { method: 'POST', body: JSON.stringify(data) }); const getMySupportTickets = function() { let page = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; return request("/support/my?page=".concat(page)); }; const getAdminSupportTickets = (params)=>request("/support".concat(params ? '?' + new URLSearchParams(params) : '')); const replyToSupportTicket = (id, data)=>request("/support/".concat(id, "/reply"), { method: 'PATCH', body: JSON.stringify(data) }); const setSupportTicketStatus = (id, status)=>request("/support/".concat(id, "/status"), { method: 'PATCH', body: JSON.stringify({ status }) }); /***/ }) }]);   `  f"use strict"; (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2982],{ /***/ 2982: !^(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1240],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>c,Hh:()=>a,Jv:()=>l,wV:()=>n,yK:()=>i});let i=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:c,signUp:a,useSession:n}=i},9621:(e,t,s)=>{Promise.resolve().then(s.bind(s,9991))},9991:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var i=s(4568),l=s(7620),c=s(7541),a=s(1592),n=s(9906),r=s(2982);function x(){let{data:e,isPending:t}=(0,a.wV)(),s=(0,c.useRouter)(),{t:x}=(0,n.Y)(),[o,d]=(0,l.useState)(!1),[m,b]=(0,l.useState)("");async function p(){d(!0),b("");try{await (0,r.Em)("/users/me/offer-help",{method:"POST"}),s.push("/specialist-setup")}catch(e){b(x("common.error")),d(!1)}}if(t)return(0,i.jsx)("div",{className:"text-center py-20 text-white",children:x("common.loading")});let h=[{n:1,title:x("become_specialist.step1.title"),desc:x("become_specialist.step1.desc"),icon:"\uD83D\uDDC2️"},{n:2,title:x("become_specialist.step2.title"),desc:x("become_specialist.step2.desc"),icon:"\uD83D\uDD0D"},{n:3,title:x("become_specialist.step3.title"),desc:x("become_specialist.step3.desc"),icon:"\uD83D\uDCB0"}],g=[{icon:"\uD83C\uDFAF",text:x("become_specialist.benefit1")},{icon:"⭐",text:x("become_specialist.benefit2")},{icon:"\uD83D\uDCC5",text:x("become_specialist.benefit3")},{icon:"❤️",text:x("become_specialist.benefit4")}];return(0,i.jsxs)("div",{children:[(0,i.jsx)("section",{className:"bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4",children:(0,i.jsxs)("div",{className:"max-w-3xl mx-auto text-center",children:[(0,i.jsx)("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:x("become_specialist.hero.title")}),(0,i.jsx)("p",{className:"text-xl text-green-100 mb-8",children:x("become_specialist.hero.subtitle")})]})}),(0,i.jsxs)("section",{className:"max-w-4xl mx-auto px-4 py-16",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-white mb-10 text-center",children:x("become_specialist.how.title")}),(0,i.jsx)("div",{className:"grid md:grid-cols-3 gap-8",children:h.map(e=>(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4",children:e.icon}),(0,i.jsx)("div",{className:"w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3",children:e.n}),(0,i.jsx)("h3",{className:"font-semibold text-white text-lg mb-2",children:e.title}),(0,i.jsx)("p",{className:"text-green-100 text-sm leading-relaxed",children:e.desc})]},e.n))})]}),(0,i.jsx)("section",{className:"bg-gray-50 py-14 px-4",children:(0,i.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-8 text-center",children:x("become_specialist.benefits.title")}),(0,i.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:g.map((e,t)=>(0,i.jsxs)("div",{className:"flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5",children:[(0,i.jsx)("span",{className:"text-2xl shrink-0",children:e.icon}),(0,i.jsx)("p",{className:"text-gray-700 font-medium leading-snug",children:e.text})]},t))})]})}),(0,i.jsx)("section",{className:"py-16 px-4 text-center",children:(0,i.jsxs)("div",{className:"max-w-md mx-auto",children:[m&&(0,i.jsx)("p",{className:"text-red-500 text-sm mb-4",children:m}),e?(0,i.jsx)("button",{onClick:p,disabled:o,className:"w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition",children:o?x("common.loading"):x("profile.become_specialist")}):(0,i.jsx)("a",{href:"/register",className:"block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center",children:x("profile.become_specialist")})]})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=9621)),_N_E=e.O()}]);  (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4466],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>l,Hh:()=>n,Jv:()=>a,wV:()=>d,yK:()=>r});let r=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:l,signUp:n,useSession:d}=r},5845:(e,t,s)=>{Promise.resolve().then(s.bind(s,9623))},9623:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(4568),a=s(7620),l=s(9664),n=s.n(l),d=s(9906),c=s(1592),o=s(2982);function i(){let{t:e}=(0,d.Y)(),{data:t}=(0,c.wV)(),[s,l]=(0,a.useState)(""),[i,x]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),j=async e=>{if(e.preventDefault(),i&&!m){u(!0),p(null);try{await (0,o.mq)({type:"delete_account",subject:"Account deletion request",body:s.trim()||"No reason provided."}),b(!0)}catch(e){var t;p(null!=(t=null==e?void 0:e.message)?t:"Error")}finally{u(!1)}}};return(0,r.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,r.jsxs)("div",{className:"max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsxs)(n(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",e("nav.home")]})}),(0,r.jsx)("h1",{className:"text-2xl font-extrabold text-gray-900 mb-2",children:e("delete_account.title")}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-8",children:e("delete_account.subtitle")}),h?(0,r.jsxs)("div",{className:"rounded-xl bg-green-50 border border-green-200 p-6 text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,r.jsx)("h2",{className:"text-base font-semibold text-green-800 mb-1",children:e("delete_account.success_title")}),(0,r.jsx)("p",{className:"text-sm text-green-700",children:e("delete_account.success_body")})]}):(null==t?void 0:t.user)?(0,r.jsxs)("form",{onSubmit:j,className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,r.jsx)("p",{className:"text-sm text-red-700",children:e("delete_account.warning")})]}),(0,r.jsx)("div",{className:"rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700",children:(0,r.jsx)("span",{className:"font-medium",children:t.user.email})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:e("delete_account.reason_label")}),(0,r.jsx)("textarea",{value:s,onChange:e=>l(e.target.value),placeholder:e("delete_account.reason_placeholder"),rows:4,maxLength:2e3,className:"w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none"})]}),(0,r.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:i,onChange:e=>x(e.target.checked),className:"mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e("delete_account.confirm_label")})]}),g&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:g}),(0,r.jsx)("button",{type:"submit",disabled:!i||m,className:"w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition",children:e(m?"delete_account.submitting":"delete_account.submit")})]}):(0,r.jsxs)("div",{className:"rounded-xl bg-amber-50 border border-amber-200 p-6 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-amber-800 mb-4",children:e("delete_account.login_required")}),(0,r.jsx)(n(),{href:"/login",className:"inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition",children:e("delete_account.login_btn")})]})]})})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=5845)),_N_E=e.O()}]);   (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4040],{1258:(e,t,s)=>{"use strict";function i(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,s){if(null==e?void 0:e.trim()){let s=null==t?void 0:t.trim();return s?"".concat(e.trim()," ").concat(s[0].toUpperCase(),"."):e.trim()}return i(s)}s.d(t,{E:()=>i,H:()=>l})},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>a,yK:()=>i});let i=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:a}=i},3383:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var i=s(4568),l=s(7620),n=s(9664),r=s.n(n),a=s(7541),c=s(1592),o=s(9906),d=s(2982),m=s(1258);function u(){let{data:e,isPending:t}=(0,c.wV)(),s=(0,a.useRouter)(),{t:n}=(0,o.Y)(),[u,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(!0);async function f(e){await (0,d.sD)(e).catch(()=>{}),h(t=>t.filter(t=>{var s;return(null==(s=t.specialist)?void 0:s.id)!==e}))}return((0,l.useEffect)(()=>{if(!t&&!e)return void s.push("/login");e&&(0,d.pD)().then(h).catch(()=>{}).finally(()=>p(!1))},[e,t]),t||x)?(0,i.jsx)("div",{className:"text-center py-20 text-white",children:n("common.loading")}):(0,i.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-10",children:[(0,i.jsx)("h1",{className:"text-2xl font-bold text-white mb-6",children:n("favorites.specialists.title")}),0===u.length?(0,i.jsxs)("div",{className:"text-center py-20 text-white/70",children:[(0,i.jsx)("p",{className:"text-4xl mb-4",children:"\uD83E\uDD0D"}),(0,i.jsx)("p",{className:"text-lg",children:n("favorites.specialists.empty")}),(0,i.jsxs)(r(),{href:"/specialists",className:"mt-4 inline-block text-white hover:text-white/80 text-sm",children:[n("specialists.view")," →"]})]}):(0,i.jsx)("div",{className:"space-y-3",children:u.map(e=>{var t,s,l,a,c,o;let d=e.specialist;if(!d)return null;let u=(0,m.H)(d.firstName,d.lastName,d.name),h="".concat(null!=(c=null==(t=d.firstName)?void 0:t[0])?c:"").concat(null!=(o=null==(s=d.lastName)?void 0:s[0])?o:"").toUpperCase()||(null==(a=d.name)||null==(l=a[0])?void 0:l.toUpperCase())||"?";return(0,i.jsxs)("div",{className:"flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition",children:[(0,i.jsxs)(r(),{href:"/users/".concat(d.id),className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,i.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100",children:d.image?(0,i.jsx)("img",{src:d.image,alt:u,className:"w-full h-full object-cover"}):h}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"font-semibold text-gray-900 truncate",children:u}),d.bio&&(0,i.jsx)("p",{className:"text-sm text-gray-500 line-clamp-1",children:d.bio})]})]}),(0,i.jsx)("button",{onClick:()=>f(d.id),title:n("specialist.unfavorite"),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition",children:"❤️"})]},e.id)})})]})}},4381:(e,t,s)=>{Promise.resolve().then(s.bind(s,3383))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=4381)),_N_E=e.O()}]); |1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{912:(e,t,n)=>{"use strict";n.d(t,{ShareButton:()=>l});var s=n(4568),r=n(7620);function l(e){let{label:t,copiedLabel:n}=e,[l,a]=(0,r.useState)(!1),o=async()=>{let e=window.location.origin;if(navigator.share)try{await navigator.share({url:e,title:"CanHelp"});return}catch(e){}await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2500)};return(0,s.jsx)("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 bg-amber-500 text-white px-8 py-3.5 rounded-2xl font-bold text-base hover:bg-amber-600 transition shadow-md shadow-amber-500/25 active:scale-95",children:l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-lg",children:"✓"}),n]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-lg",children:"\uD83D\uDD17"}),t]})})}},1277:(e,t,n)=>{"use strict";n.d(t,{PromoCountdown:()=>c});var s=n(4568),r=n(7620),l=n(9664),a=n.n(l);function o(){let e=new Date,t=new Date(e.getFullYear(),11,31,23,59,59).getTime()-e.getTime();if(t<=0)return{d:0,h:0,m:0,s:0};let n=Math.floor(t/864e5),s=Math.floor(t%864e5/36e5);return{d:n,h:s,m:Math.floor(t%36e5/6e4),s:Math.floor(t%6e4/1e3)}}let i={d:0,h:0,m:0,s:0};function c(e){let{title:t,subtitle:n,cta:l,days:c,hours:d,minutes:u,seconds:m}=e,[x,h]=(0,r.useState)(i);return(0,r.useEffect)(()=>{h(o());let e=setInterval(()=>h(o()),1e3);return()=>clearInterval(e)},[]),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-3xl shadow-2xl bg-gradient-to-br from-green-700 via-green-800 to-green-900 text-white px-6 py-10 md:px-14 md:py-14 flex flex-col items-center text-center",children:[(0,s.jsx)("div",{className:"absolute -top-16 -right-16 w-64 h-64 rounded-full bg-green-500/20 blur-3xl pointer-events-none"}),(0,s.jsx)("div",{className:"absolute -bottom-16 -left-16 w-64 h-64 rounded-full bg-green-400/20 blur-3xl pointer-events-none"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 bg-green-500/90 text-white text-sm font-bold px-4 py-1.5 rounded-full mb-5 shadow-lg tracking-wide uppercase",children:[(0,s.jsx)("span",{children:"\uD83C\uDF81"})," Pro — Free"]}),(0,s.jsx)("h2",{className:"text-3xl md:text-4xl font-extrabold mb-3 tracking-tight drop-shadow-lg",children:t}),(0,s.jsx)("p",{className:"text-green-200 text-lg md:text-xl mb-8 max-w-xl font-medium",children:n}),(0,s.jsx)("div",{className:"flex items-end gap-3 md:gap-6 mb-8",children:[{value:x.d,label:c},{value:x.h,label:d},{value:x.m,label:u},{value:x.s,label:m}].map((e,t)=>(0,s.jsxs)("div",{className:"flex items-end gap-3 md:gap-6",children:[t>0&&(0,s.jsx)("span",{className:"text-3xl md:text-4xl font-extrabold text-gray-300 mb-2 leading-none select-none",children:":"}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{className:"bg-white/10 backdrop-blur border border-white/20 rounded-2xl w-16 md:w-20 h-16 md:h-20 flex items-center justify-center shadow-lg",children:(0,s.jsx)("span",{className:"text-3xl md:text-4xl font-extrabold tabular-nums",children:String(e.value).padStart(2,"0")})}),(0,s.jsx)("span",{className:"text-gray-300 text-xs font-semibold mt-1.5 uppercase tracking-widest",children:e.label})]})]},e.label))}),(0,s.jsx)(a(),{href:"/register",className:"btn-accent text-lg px-10 py-3 shadow-xl hover:scale-105 transition-transform duration-200",children:l})]})}},1386:(e,t,n)=>{"use strict";n.d(t,{HomeCategoryGrid:()=>o});var s=n(4568),r=n(7620),l=n(7541),a=n(5940);function o(e){var t,n;let{categories:o,locale:i,isSpecialist:c,allInLabel:d,categoryLabel:u,selectLabel:m,cancelLabel:x}=e,h=(0,l.useRouter)(),[g,p]=(0,r.useState)(null),b=(0,r.useMemo)(()=>{var e;return null!=(e=o.find(e=>e.slug===g))?e:null},[o,g]),f=null!=(t=null==b?void 0:b.children)?t:[];function v(e){h.push(c?"/tasks?category=".concat(e):"/tasks/new?category=".concat(e))}function j(){p(null)}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 gap-3 sm:gap-4",children:o.map(e=>{var t,n;return(0,s.jsxs)("button",{type:"button",onClick:()=>(function(e){let t=Array.isArray(e.children)&&e.children.length>0;if(c||!t)return void v(e.slug);p(e.slug)})(e),className:"modern-card flex flex-col items-center gap-1.5 p-3 sm:p-4 text-center group hover:bg-green-50/60 transition-all duration-200",children:[(0,s.jsx)(a.Ez,{icon:e.icon,alt:null!=(t=e.names[i])?t:e.names.el,className:"h-9 w-9 object-contain text-3xl sm:h-10 sm:w-10 sm:text-4xl transition-transform group-hover:scale-105 leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"text-xs font-semibold text-gray-900 group-hover:text-green-600 transition leading-tight",children:null!=(n=e.names[i])?n:e.names.el})]},e.id)})}),b&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4",children:[(0,s.jsx)("button",{type:"button",className:"absolute inset-0 bg-black/45",onClick:j,"aria-label":x}),(0,s.jsxs)("div",{className:"relative w-full sm:max-w-lg bg-white rounded-t-2xl sm:rounded-2xl shadow-2xl border border-gray-100 p-5 sm:p-6",children:[(0,s.jsx)("div",{className:"w-12 h-1.5 bg-gray-200 rounded-full mx-auto mb-4 sm:hidden"}),(0,s.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-1",children:u}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-4",children:m}),(0,s.jsxs)("div",{className:"space-y-2 max-h-[55vh] overflow-y-auto pr-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{v(b.slug),j()},className:"w-full text-left rounded-xl border border-green-200 bg-green-50 px-4 py-3 hover:bg-green-100 transition",children:(0,s.jsxs)("span",{className:"font-semibold text-green-700",children:[d," ",null!=(n=b.names[i])?n:b.names.el]})}),f.map(e=>{var t;return(0,s.jsx)("button",{type:"button",onClick:()=>{v(e.slug),j()},className:"w-full text-left rounded-xl border border-gray-200 bg-white px-4 py-3 hover:border-green-300 hover:bg-green-50 transition",children:(0,s.jsx)("span",{className:"font-medium text-gray-800",children:null!=(t=e.names[i])?t:e.names.el})},e.id)})]}),(0,s.jsx)("div",{className:"mt-5 flex justify-end",children:(0,s.jsx)("button",{type:"button",onClick:j,className:"px-4 py-2 rounded-lg border border-gray-200 text-gray-600 hover:bg-gray-50",children:x})})]})]})]})}},1592:(e,t,n)=>{"use strict";n.d(t,{CI:()=>l,Hh:()=>a,Jv:()=>r,wV:()=>o,yK:()=>s});let s=(0,n(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:l,signUp:a,useSession:o}=s},2294:(e,t,n)=>{"use strict";n.d(t,{HomeCityCloud:()=>o});var s=n(4568),r=n(7541),l=n(4029),a=n(9906);function o(e){let{locationTree:t,isSpecialist:n=!1}=e,o=(0,r.useRouter)(),{setLocation:i}=(0,l.z)(),{locale:c}=(0,a.Y)(),d=e=>{n?o.push("/tasks?location=".concat(e)):(i(e),o.push("/tasks/new"))};return t.length?(0,s.jsx)("div",{className:"flex flex-wrap justify-center gap-3",children:t.map(e=>{var t,n;return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e.slug),className:"inline-flex items-center gap-1 px-4 py-2 rounded-full bg-indigo-100 text-indigo-700 font-semibold text-sm hover:bg-indigo-200 transition cursor-pointer",children:["\uD83D\uDCCD ",null!=(t=e.names[c])?t:e.names.el]}),(null!=(n=e.children)?n:[]).map(e=>{var t;return(0,s.jsx)("button",{type:"button",onClick:()=>d(e.slug),className:"inline-flex items-center px-3 py-1.5 rounded-full bg-slate-100 text-slate-700 text-sm hover:bg-indigo-100 hover:text-indigo-700 transition cursor-pointer",children:null!=(t=e.names[c])?t:e.names.el},e.id)})]},e.id)})}):null}},4029:(e,t,n)=>{"use strict";n.d(t,{LocationProvider:()=>o,z:()=>i});var s=n(4568),r=n(7620),l=n(2982);let a=(0,r.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function o(e){let{children:t,initialSlug:n=""}=e,[o,i]=(0,r.useState)(n),[c,d]=(0,r.useState)([]),[u,m]=(0,r.useState)(!0);(0,r.useEffect)(()=>{i(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,r.useEffect)(()=>{(0,l.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>m(!1))},[]);let x=(0,r.useCallback)(e=>{i(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),h=(0,r.useCallback)(e=>{if(!o)return"";for(let r of c){var t,n,s;if(r.slug===o)return null!=(t=r.names[e])?t:r.names.el;for(let t of null!=(n=r.children)?n:[])if(t.slug===o)return null!=(s=t.names[e])?s:t.names.el}return o},[o,c]);return(0,s.jsx)(a.Provider,{value:{locationSlug:o,locationTree:c,locationLoading:u,setLocation:x,getLabel:h},children:t})}function i(){return(0,r.useContext)(a)}},5940:(e,t,n)=>{"use strict";n.d(t,{Ez:()=>a,V:()=>l});var s=n(4568),r=n(7620);function l(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function a(e){let{icon:t,alt:n="",className:a,fallback:o="\uD83D\uDCE6"}=e,i=(t||"").trim(),[c,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d(!1)},[i]);let u=(0,r.useMemo)(()=>l(i)?i.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(i):i:"",[i]),m="/category-icons/package.svg";return l(i)?c&&i!==m?(0,s.jsx)("img",{src:m,alt:n,className:a,loading:"lazy",onError:()=>d(!0)}):c&&i===m?(0,s.jsx)("span",{className:a,children:o}):(0,s.jsx)("img",{src:u,alt:n,className:a,loading:"lazy",onError:()=>d(!0)}):(0,s.jsx)("span",{className:a,children:i||o})}},6787:(e,t,n)=>{"use strict";n.d(t,{HeroSearch:()=>a});var s=n(4568),r=n(7620),l=n(7541);function a(e){let{placeholder:t,mode:n="customer"}=e,[a,o]=(0,r.useState)(""),i=(0,l.useRouter)();return(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=a.trim();"specialist"===n?t?i.push("/tasks?q=".concat(encodeURIComponent(t))):i.push("/tasks"):t?i.push("/specialists?q=".concat(encodeURIComponent(t))):i.push("/specialists")},className:"relative w-full mb-8",children:[(0,s.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:t,className:"w-full pl-5 pr-14 py-3.5 rounded-2xl border border-green-200 bg-white/90 text-gray-900 placeholder:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-400 text-base shadow-sm"}),(0,s.jsx)("button",{type:"submit",className:"absolute right-2 top-1/2 -translate-y-1/2 bg-green-600 hover:bg-green-700 text-white p-2.5 rounded-xl transition-colors duration-200","aria-label":"Search",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})})]})}},6811:(e,t,n)=>{"use strict";n.d(t,{BecomeSpecialistButton:()=>o});var s=n(4568),r=n(1592),l=n(7541),a=n(9906);function o(e){let{className:t}=e,{data:n,isPending:o}=(0,r.wV)(),i=(0,l.useRouter)(),{t:c}=(0,a.Y)();return(0,s.jsx)("button",{type:"button",onClick:function(){o||(n?i.push("/become-specialist"):i.push("/register"))},className:null!=t?t:"btn-outline w-full sm:w-auto text-center",children:c("hero.cta.browse")})}},7529:(e,t,n)=>{Promise.resolve().then(n.bind(n,6811)),Promise.resolve().then(n.bind(n,9869)),Promise.resolve().then(n.bind(n,6787)),Promise.resolve().then(n.bind(n,1386)),Promise.resolve().then(n.bind(n,2294)),Promise.resolve().then(n.bind(n,1277)),Promise.resolve().then(n.bind(n,912)),Promise.resolve().then(n.t.bind(n,9664,23))},9869:(e,t,n)=>{"use strict";n.d(t,{FaqAccordion:()=>l});var s=n(4568),r=n(7620);function l(e){let{items:t}=e,[n,l]=(0,r.useState)(null);return(0,s.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{let r=n===t;return(0,s.jsxs)("div",{className:"modern-card overflow-hidden transition-all duration-200",children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between gap-4 px-6 py-5 text-left",onClick:()=>l(r?null:t),children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900 text-base leading-snug",children:e.q}),(0,s.jsx)("span",{className:"shrink-0 w-6 h-6 rounded-full bg-green-50 flex items-center justify-center transition-transform ".concat(r?"rotate-45":""),children:(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,s.jsx)("path",{d:"M7 2v10M2 7h10",stroke:"#2563EB",strokeWidth:"2",strokeLinecap:"round"})})})]}),r&&(0,s.jsx)("div",{className:"px-6 pb-5 text-green-700 text-sm leading-relaxed border-t border-green-100 pt-4",children:e.a})]},t)})})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=7529)),_N_E=e.O()}]); (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8407],{2028:(e,t,r)=>{Promise.resolve().then(r.bind(r,3196))},3196:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(4568),s=r(7620),o=r(7541),c=r(9664),a=r.n(c),l=r(9906),i=r(2982);function d(){var e;let t=(0,o.useSearchParams)(),{t:r}=(0,l.Y)(),c=t.get("status"),d=t.get("ref"),[u,m]=(0,s.useState)("cancelled"===c?"cancelled":d?"loading":"pending");(0,s.useEffect)(()=>{if("cancelled"===c)return void m("cancelled");if(!d)return;let e=0,t=async()=>{e++;try{let e=(await i.pK()).find(e=>e.orderRef===d);if(e&&"pending"!==e.status)return void m(e.status)}catch(e){}e<12?setTimeout(t,2e3):m("pending")};setTimeout(t,2e3)},[d,c]);let h={success:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:r("payment.success.title"),desc:r("payment.success.desc"),color:"text-green-700",bg:"bg-green-50",border:"border-green-200"},cancelled:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})}),title:r("payment.cancelled.title"),desc:r("payment.cancelled.desc"),color:"text-yellow-700",bg:"bg-yellow-50",border:"border-yellow-200"},failed:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),title:r("payment.cancelled.title"),desc:r("payment.cancelled.desc"),color:"text-red-700",bg:"bg-red-50",border:"border-red-200"},pending:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:r("payment.pending.title"),desc:r("payment.pending.desc"),color:"text-green-700",bg:"bg-green-50",border:"border-green-200"},loading:{icon:(0,n.jsxs)("svg",{className:"w-16 h-16 text-gray-400 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),title:r("payment.pending.title"),desc:r("payment.pending.desc"),color:"text-gray-700",bg:"bg-gray-50",border:"border-gray-200"}},g=null!=(e=h[u])?e:h.pending;return(0,n.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,n.jsxs)("div",{className:"bg-white rounded-2xl border ".concat(g.border," shadow-sm p-10 max-w-sm w-full text-center"),children:[(0,n.jsx)("div",{className:"flex justify-center mb-5",children:g.icon}),(0,n.jsx)("h1",{className:"text-2xl font-bold mb-2 ".concat(g.color),children:g.title}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mb-8",children:g.desc}),(0,n.jsxs)(a(),{href:"/profile",className:"inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),r("payment.back_to_profile")]})]})})}},7541:(e,t,r)=>{"use strict";var n=r(3041);r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[9664,9906,2982,587,18,7358],()=>e(e.s=2028)),_N_E=e.O()}]); 74(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7826],{1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>n,Jv:()=>s,wV:()=>c,yK:()=>l});let l=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:n,useSession:c}=l},2861:(e,t,r)=>{Promise.resolve().then(r.bind(r,9807))},9807:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var l=r(4568),s=r(7620),a=r(7541),n=r(1592),c=r(9906),i=r(2982);let d={available:"busy",busy:null},o={ru:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],en:["Mo","Tu","We","Th","Fr","Sa","Su"],el:["Δε","Τρ","Τε","Πε","Πα","Σά","Κυ"]},x={ru:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],en:["January","February","March","April","May","June","July","August","September","October","November","December"],el:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]};function u(e,t,r){return"".concat(e,"-").concat(String(t+1).padStart(2,"0"),"-").concat(String(r).padStart(2,"0"))}function h(){var e;let{data:t,isPending:r}=(0,n.wV)(),o=(0,a.useRouter)(),x=(0,a.useSearchParams)(),{locale:u,t:h}=(0,c.Y)(),g=new Date,[b,f]=(0,s.useState)(g.getFullYear()),[y,p]=(0,s.useState)(g.getMonth()),[v,j]=(0,s.useState)({}),[w,N]=(0,s.useState)(null),[C,S]=(0,s.useState)(null),[D,k]=(0,s.useState)(!1),[E,M]=(0,s.useState)("available"),[_,F]=(0,s.useState)(null),[K,z]=(0,s.useState)(!1),[O,T]=(0,s.useState)(null),B=new Date().toISOString().slice(0,10);(0,s.useEffect)(()=>{var e,l;r||t||o.push("/login"),!r&&t&&(null==(e=t.user)?void 0:e.role)!=="specialist"&&(null==(l=t.user)?void 0:l.role)!=="admin"&&o.push("/profile")},[t,r]);let L=(0,s.useCallback)(()=>{(0,i.Em)("/google/calendar/status").then(F).catch(()=>F({connected:!1}))},[]);(0,s.useEffect)(()=>{if(!t)return;L();let e=x.get("gcal");"connected"===e?(T(h("schedule.gcalConnected")),setTimeout(()=>T(null),5e3),o.replace("/schedule")):"error"===e&&(T(h("schedule.gcalError")),setTimeout(()=>T(null),5e3),o.replace("/schedule"))},[t]);let A=(0,s.useCallback)((e,t)=>{let r="".concat(e,"-").concat(String(t+1).padStart(2,"0"));(0,i.iN)(r).then(e=>{j(t=>{let r={...t};return e.forEach(e=>{r[e.date]=e.status}),r})}).catch(()=>{})},[]);async function H(e){var t;if(e{let l={...e},s=new Date(t),a=new Date(r);for(;s<=a;){let e=s.toISOString().slice(0,10);e>=B&&(l[e]=E),s.setDate(s.getDate()+1)}return l})}catch(e){}return void N(null)}let r=null!=(t=v[e])?t:null,l=null===r?"available":d[r];N(e),j(t=>({...t,[e]:l}));try{await (0,i.OM)(e,l)}catch(t){j(t=>({...t,[e]:r}))}N(null)}if((0,s.useEffect)(()=>{if(!t)return;A(b,y);let e=new Date(b,y+1,1);A(e.getFullYear(),e.getMonth())},[t,b,y,A]),r)return(0,l.jsx)("div",{className:"text-center py-20 text-gray-500",children:h("common.loading")});let I=null==t||null==(e=t.user)?void 0:e.role;if(!t||"specialist"!==I&&"admin"!==I)return null;async function J(){window.location.href="".concat("https://api.canhelp.gr","/api/google/calendar/connect")}async function P(){if(confirm(h("schedule.gcalDisconnectConfirm"))){z(!0);try{await (0,i.Em)("/google/calendar/disconnect",{method:"DELETE"}),F({connected:!1})}catch(e){}z(!1)}}async function W(){z(!0);try{var e;let t=await (0,i.Em)("/google/calendar/import",{method:"POST"});T(h("schedule.gcalImportDone").replace("{n}",String(null!=(e=t.imported)?e:0))),setTimeout(()=>T(null),5e3),A(b,y)}catch(e){}z(!1)}return(0,l.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-10",children:[O&&(0,l.jsx)("div",{className:"fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs",children:O}),(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:h("schedule.title")}),(0,l.jsx)("p",{className:"text-sm text-white/70 mt-1",children:h("schedule.subtitle")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4 mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs",children:"✓"}),h("schedule.available")]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs",children:"✗"}),h("schedule.busy")]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-white/20 border border-white/30"}),h("schedule.unset")]}),(0,l.jsx)("div",{className:"text-xs text-white/50 self-center",children:h("schedule.click_hint")})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200",children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,l.jsx)("div",{onClick:()=>{k(e=>!e),S(null)},className:"w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(D?"bg-green-500":"bg-gray-200"),children:(0,l.jsx)("span",{className:"absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(D?"translate-x-5":"translate-x-1")})}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:h("schedule.range_mode")})]}),D&&(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,l.jsx)("button",{onClick:()=>M("available"),className:"px-3 py-1 rounded-lg text-sm font-medium border transition ".concat("available"===E?"bg-emerald-100 border-emerald-400 text-emerald-700":"bg-white border-gray-200 text-gray-500"),children:h("schedule.available")}),(0,l.jsx)("button",{onClick:()=>M("busy"),className:"px-3 py-1 rounded-lg text-sm font-medium border transition ".concat("busy"===E?"bg-red-100 border-red-400 text-red-700":"bg-white border-gray-200 text-gray-500"),children:h("schedule.busy")}),C&&(0,l.jsx)("span",{className:"text-xs text-green-600",children:h("schedule.range_from").replace("{date}",C)})]})]}),(0,l.jsx)(m,{year:b,month:y,avail:v,saving:w,rangeStart:C,today:B,onToggle:H,onPrev:function(){0===y?(f(e=>e-1),p(11)):p(e=>e-1)},onNext:function(){11===y?(f(e=>e+1),p(0)):p(e=>e+1)}}),(0,l.jsxs)("div",{className:"mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,l.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 48 48",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"48",rx:"8",fill:"#fff"}),(0,l.jsx)("path",{d:"M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z",fill:"#4285F4"}),(0,l.jsx)("path",{d:"M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z",fill:"#fff"}),(0,l.jsx)("circle",{cx:"18",cy:"18",r:"2",fill:"#DB4437"}),(0,l.jsx)("circle",{cx:"30",cy:"18",r:"2",fill:"#DB4437"}),(0,l.jsx)("rect",{x:"17",y:"12",width:"2",height:"6",rx:"1",fill:"#DB4437"}),(0,l.jsx)("rect",{x:"29",y:"12",width:"2",height:"6",rx:"1",fill:"#DB4437"})]}),(0,l.jsx)("h3",{className:"font-semibold text-gray-900 text-sm",children:h("schedule.googleCalendar")})]}),null===_?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:h("common.loading")}):_.connected?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,l.jsx)("circle",{cx:"8",cy:"8",r:"8",fill:"#22c55e"}),(0,l.jsx)("path",{d:"M5 8l2 2 4-4",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,l.jsxs)("span",{className:"text-sm text-gray-700",children:[h("schedule.connectedAs")," ",(0,l.jsx)("span",{className:"font-medium",children:_.email})]})]}),(0,l.jsx)("p",{className:"text-xs text-gray-400",children:h("schedule.gcalAutoSyncNote")}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)("button",{onClick:W,disabled:K,className:"px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition",children:K?h("common.loading"):h("schedule.importFromGoogle")}),(0,l.jsx)("button",{onClick:P,disabled:K,className:"px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition",children:h("schedule.disconnectGoogle")})]})]}):(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:h("schedule.gcalConnectDesc")}),(0,l.jsxs)("button",{onClick:J,className:"flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700",children:[(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 48 48",fill:"none",children:[(0,l.jsx)("path",{d:"M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z",fill:"#FFC107"}),(0,l.jsx)("path",{d:"M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z",fill:"#FF3D00"}),(0,l.jsx)("path",{d:"M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z",fill:"#4CAF50"}),(0,l.jsx)("path",{d:"M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z",fill:"#1976D2"})]}),h("schedule.connectGoogle")]})]})]})]})}function m(e){var t,r;let{year:s,month:a,avail:n,saving:i,rangeStart:d,today:h,onToggle:m,onPrev:g,onNext:b}=e,{locale:f,t:y}=(0,c.Y)(),p=null!=(t=o[f])?t:o.ru,v=null!=(r=x[f])?r:x.ru,j=(new Date(s,a,1).getDay()+6)%7,w=new Date(s,a+1,0).getDate(),N=new Date(s,a,0).getDate(),C=[];for(let e=j-1;e>=0;e--)C.push({day:N-e,cur:!1,dateKey:""});for(let e=1;e<=w;e++)C.push({day:e,cur:!0,dateKey:u(s,a,e)});let S=C.length%7;if(0!==S)for(let e=1;e<=7-S;e++)C.push({day:e,cur:!1,dateKey:""});let D=u(s,a,1).slice(0,7),k=Object.entries(n).filter(e=>{let[t,r]=e;return t.startsWith(D)&&t>=h&&"available"===r}).length,E=Object.entries(n).filter(e=>{let[t,r]=e;return t.startsWith(D)&&t>=h&&"busy"===r}).length;return(0,l.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,l.jsx)("button",{onClick:g,className:"w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition",children:"‹"}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsxs)("h2",{className:"font-semibold text-gray-900",children:[v[a]," ",s]}),(0,l.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:[(0,l.jsxs)("span",{className:"text-emerald-600 font-medium",children:[k," ",y("schedule.free")]})," \xb7 ",(0,l.jsxs)("span",{className:"text-red-500 font-medium",children:[E," ",y("schedule.busy_count")]})]})]}),(0,l.jsx)("button",{onClick:b,className:"w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition",children:"›"})]}),(0,l.jsx)("div",{className:"grid grid-cols-7 border-b border-gray-100",children:p.map(e=>(0,l.jsx)("div",{className:"py-2 text-center text-xs font-medium text-gray-400",children:e},e))}),(0,l.jsx)("div",{className:"grid grid-cols-7",children:C.map((e,t)=>{var r;if(!e.cur)return(0,l.jsx)("div",{className:"p-1 h-12 flex items-center justify-center text-sm text-gray-200",children:e.day},"empty-".concat(t));let s=null!=(r=n[e.dateKey])?r:null,a=e.dateKeym(e.dateKey),disabled:a||o,title:"available"===s?y("schedule.available"):"busy"===s?y("schedule.busy"):y("schedule.click_to_set"),children:[(0,l.jsx)("span",{children:e.day}),!a&&"available"===s&&(0,l.jsx)("span",{className:"text-[9px] leading-none text-emerald-600",children:y("schedule.available").toLowerCase()}),!a&&"busy"===s&&(0,l.jsx)("span",{className:"text-[9px] leading-none text-red-500",children:y("schedule.busy").toLowerCase()}),o&&(0,l.jsx)("span",{className:"text-[8px] text-gray-400",children:"..."})]},e.dateKey)})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=2861)),_N_E=e.O()}]); G(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5442],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>n,Hh:()=>i,Jv:()=>a,wV:()=>r,yK:()=>l});let l=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:n,signUp:i,useSession:r}=l},5940:(e,t,s)=>{"use strict";s.d(t,{Ez:()=>i,V:()=>n});var l=s(4568),a=s(7620);function n(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function i(e){let{icon:t,alt:s="",className:i,fallback:r="\uD83D\uDCE6"}=e,c=(t||"").trim(),[o,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{d(!1)},[c]);let u=(0,a.useMemo)(()=>n(c)?c.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(c):c:"",[c]),x="/category-icons/package.svg";return n(c)?o&&c!==x?(0,l.jsx)("img",{src:x,alt:s,className:i,loading:"lazy",onError:()=>d(!0)}):o&&c===x?(0,l.jsx)("span",{className:i,children:r}):(0,l.jsx)("img",{src:u,alt:s,className:i,loading:"lazy",onError:()=>d(!0)}):(0,l.jsx)("span",{className:i,children:c||r})}},6073:(e,t,s)=>{Promise.resolve().then(s.bind(s,6699))},6699:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var l=s(4568),a=s(7620),n=s(7541),i=s(1592),r=s(9906),c=s(2982),o=s(5940);function d(e){let{current:t,total:s}=e;return(0,l.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:Array.from({length:s},(e,t)=>t+1).map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-colors ".concat(e(0,l.jsxs)("li",{className:"flex items-center gap-2 text-sm text-gray-600",children:[(0,l.jsx)("span",{className:"w-5 h-5 bg-green-100 text-green-600 rounded-full flex items-center justify-center text-xs font-bold shrink-0",children:t+1}),e]},t))})]}),(0,l.jsxs)("button",{onClick:s,className:"w-full max-w-xs bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 transition",children:[t("specialist_setup.next")," →"]})]})}function x(e){let{t,onNext:s,onBack:n}=e,[i,r]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[u,x]=(0,a.useState)(!1),[p,m]=(0,a.useState)(null),[h,g]=(0,a.useState)(!1),f=(0,a.useRef)(null);async function j(e){var t;let s=null==(t=e.target.files)?void 0:t[0];if(s){g(!0);try{let e=new FormData;e.append("file",s);let t=await fetch("".concat("https://api.canhelp.gr","/api/uploads"),{method:"POST",credentials:"include",body:e});if(!t.ok)throw Error("Upload failed");let{url:l}=await t.json(),a="".concat("https://api.canhelp.gr").concat(l);await c.Em("/users/me",{method:"PATCH",body:JSON.stringify({image:a})}),m(a)}catch(e){}finally{g(!1),f.current&&(f.current.value="")}}}async function y(){x(!0);try{await c.Em("/users/me",{method:"PATCH",body:JSON.stringify({bio:i||void 0,phone:o||void 0})}),s()}catch(e){}finally{x(!1)}}return(0,a.useEffect)(()=>{c.Em("/users/me",{}).then(e=>{var t,s,l;r(null!=(t=e.bio)?t:""),d(null!=(s=e.phone)?s:""),m(null!=(l=e.image)?l:null)}).catch(()=>{})},[]),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:t("specialist_setup.step2.title")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm mb-6",children:t("specialist_setup.step2.subtitle")}),(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:t("specialist_setup.step2.photo_label")}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-full bg-gray-100 border-2 border-gray-200 overflow-hidden shrink-0 flex items-center justify-center",children:p?(0,l.jsx)("img",{src:p,alt:"",className:"w-full h-full object-cover"}):(0,l.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",children:[(0,l.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,l.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=f.current)?void 0:e.click()},disabled:h,className:"px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium text-gray-700 disabled:opacity-50 transition",children:t(h?"specialist_setup.step2.photo_uploading":"specialist_setup.step2.photo_btn")}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:t("specialist_setup.step2.photo_hint")})]}),(0,l.jsx)("input",{ref:f,type:"file",accept:"image/jpeg,image/png,image/webp",className:"hidden",onChange:j})]})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:t("specialist_setup.step2.bio_label")}),(0,l.jsx)("textarea",{value:i,onChange:e=>r(e.target.value),rows:4,maxLength:1e3,placeholder:t("specialist_setup.step2.bio_placeholder"),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 resize-none"})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:t("specialist_setup.step2.phone_label")}),(0,l.jsx)("input",{type:"tel",value:o,onChange:e=>d(e.target.value),placeholder:t("specialist_setup.step2.phone_placeholder"),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"})]}),(0,l.jsx)(b,{t:t,onBack:n,onNext:y,loading:u})]})}function p(e){let{t,onNext:s,onBack:n,onCardCreated:i}=e,[r,o]=(0,a.useState)(""),[d,u]=(0,a.useState)(""),[x,p]=(0,a.useState)(!1),[m,h]=(0,a.useState)("");async function g(){if(!r.trim())return void h(t("specialist_setup.step3.title_required"));h(""),p(!0);try{let e=await c.eR({title:r.trim(),description:d||void 0});i(e),s()}catch(e){}finally{p(!1)}}return(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:t("specialist_setup.step3.title")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm mb-6",children:t("specialist_setup.step3.subtitle")}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:t("specialist_setup.step3.title_label")}),(0,l.jsx)("input",{value:r,onChange:e=>{o(e.target.value),m&&h("")},maxLength:200,placeholder:t("specialist_setup.step3.title_placeholder"),className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(m?"border-red-400":"border-gray-300")}),m&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:m})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:t("specialist_setup.step3.desc_label")}),(0,l.jsx)("textarea",{value:d,onChange:e=>u(e.target.value),rows:5,maxLength:1e3,placeholder:t("specialist_setup.step3.desc_placeholder"),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 resize-none"})]}),(0,l.jsx)(b,{t:t,onBack:n,onNext:g,loading:x})]})}function m(e){var t,s;let{t:n,onNext:i,onBack:r,card:d,catLocale:u}=e,[x,p]=(0,a.useState)(null!=(t=null==d?void 0:d.skills)?t:[]),[m,h]=(0,a.useState)(""),[g,f]=(0,a.useState)(null!=(s=null==d?void 0:d.categories)?s:[]),[j,y]=(0,a.useState)([]),[v,N]=(0,a.useState)([]),[_,w]=(0,a.useState)(!1);function k(e){let t=e.trim();t&&!x.includes(t)&&p([...x,t]),h("")}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];g.includes(e)?f(g.filter(s=>s!==e&&!t.includes(s))):f([...new Set([...g,e,...t])])}async function C(){if(!d)return void i();w(!0);try{await c.zc(d.id,{skills:x,categories:g}),i()}catch(e){}finally{w(!1)}}return(0,a.useEffect)(()=>{c.bW().then(y).catch(()=>{})},[]),(0,a.useEffect)(()=>{c.rl(g.length>0?g:void 0).then(N).catch(()=>{})},[g]),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:n("specialist_setup.step4.title")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm mb-6",children:n("specialist_setup.step4.subtitle")}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("specialist_setup.step4.skills_label")}),x.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mb-2",children:x.map(e=>(0,l.jsxs)("span",{className:"flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full",children:[e,(0,l.jsx)("button",{type:"button",onClick:()=>p(x.filter(t=>t!==e)),className:"text-gray-400 hover:text-green-700 leading-none text-base",children:"\xd7"})]},e))}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("input",{value:m,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k(m))},placeholder:n("specialist_setup.step4.skills_placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,l.jsx)("button",{type:"button",onClick:()=>k(m),className:"px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium",children:n("specialist_setup.step4.skills_add")})]}),v.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-2",children:v.map(e=>{var t;return null!=(t=e.names[u])?t:e.names.el}).filter((e,t,s)=>s.indexOf(e)===t&&!x.includes(e)).slice(0,12).map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>k(e),className:"text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition",children:["+ ",e]},e))})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:n("specialist_setup.step4.categories_label")}),(0,l.jsx)("div",{className:"space-y-2 max-h-64 overflow-y-auto border border-gray-200 rounded-xl p-3",children:j.map(e=>{var t,s,a,n,i;let r=null!=(n=null!=(a=null==(t=e.names)?void 0:t[u])?a:null==(s=e.names)?void 0:s.el)?n:e.slug,c=null!=(i=e.children)?i:[],d=c.map(e=>e.slug);return(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:g.includes(e.slug),onChange:()=>S(e.slug,d),className:"w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400"}),(0,l.jsxs)("span",{className:"text-sm font-medium text-gray-800 inline-flex items-center gap-1",children:[e.icon&&(0,l.jsx)(o.Ez,{icon:e.icon,alt:r,className:(0,o.V)(e.icon)?"h-4 w-4 object-contain":"text-sm leading-none",fallback:"\uD83D\uDCE6"}),r]})]}),c.length>0&&(0,l.jsx)("div",{className:"ml-6 mt-1.5 space-y-1.5",children:c.map(e=>{var t,s,a,n;let i=null!=(n=null!=(a=null==(t=e.names)?void 0:t[u])?a:null==(s=e.names)?void 0:s.el)?n:e.slug;return(0,l.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:g.includes(e.slug),onChange:()=>S(e.slug),className:"w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400"}),(0,l.jsx)("span",{className:"text-sm text-gray-600",children:i})]},e.id)})})]},e.id)})})]}),(0,l.jsx)(b,{t:n,onBack:r,onNext:C,loading:_})]})}function h(e){var t;let{t:s,onNext:n,onBack:i,card:r,catLocale:o}=e,[d,u]=(0,a.useState)(null!=(t=null==r?void 0:r.locations)?t:[]),[x,p]=(0,a.useState)([]),[m,h]=(0,a.useState)(!1);function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];d.includes(e)?u(d.filter(s=>s!==e&&!t.includes(s))):u([...new Set([...d,e,...t])])}async function f(){if(!r)return void n();h(!0);try{await c.zc(r.id,{locations:d}),n()}catch(e){}finally{h(!1)}}return(0,a.useEffect)(()=>{c.Vs().then(p).catch(()=>{})},[]),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:s("specialist_setup.step5.title")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm mb-2",children:s("specialist_setup.step5.subtitle")}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-5",children:s("specialist_setup.step5.hint")}),(0,l.jsx)("div",{className:"space-y-3 max-h-72 overflow-y-auto border border-gray-200 rounded-xl p-3 mb-6",children:x.map(e=>{var t,s,a,n,i;let r=null!=(n=null!=(a=null==(t=e.names)?void 0:t[o])?a:null==(s=e.names)?void 0:s.el)?n:e.slug,c=null!=(i=e.children)?i:[],u=c.map(e=>e.slug);return(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:d.includes(e.slug),onChange:()=>g(e.slug,u),className:"w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400"}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-800",children:r})]}),c.length>0&&(0,l.jsx)("div",{className:"ml-6 mt-1.5 space-y-1.5",children:c.map(e=>{var t,s,a,n;let i=null!=(n=null!=(a=null==(t=e.names)?void 0:t[o])?a:null==(s=e.names)?void 0:s.el)?n:e.slug;return(0,l.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:d.includes(e.slug),onChange:()=>g(e.slug),className:"w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400"}),(0,l.jsx)("span",{className:"text-sm text-gray-600",children:i})]},e.id)})})]},e.id)})}),(0,l.jsx)(b,{t:s,onBack:i,onNext:f,loading:m,isLast:!0})]})}function g(e){let{t}=e;return(0,l.jsxs)("div",{className:"text-center py-4",children:[(0,l.jsx)("div",{className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,l.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"#16a34a",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("path",{d:"M20 6L9 17l-5-5"})})}),(0,l.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:t("specialist_setup.done.title")}),(0,l.jsx)("p",{className:"text-green-600 font-medium mb-4",children:t("specialist_setup.done.subtitle")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm leading-relaxed mb-8 max-w-sm mx-auto",children:t("specialist_setup.done.desc")}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,l.jsx)("a",{href:"/profile",className:"px-6 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 transition text-center",children:t("specialist_setup.go_to_profile")}),(0,l.jsx)("a",{href:"/tasks",className:"px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition text-center",children:t("specialist_setup.browse_tasks")})]})]})}function b(e){let{t,onBack:s,onNext:a,loading:n,isLast:i}=e;return(0,l.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,l.jsxs)("button",{type:"button",onClick:s,className:"flex-1 px-4 py-3 bg-gray-100 text-gray-700 rounded-xl font-semibold hover:bg-gray-200 transition",children:["← ",t("specialist_setup.back")]}),(0,l.jsx)("button",{type:"button",onClick:a,disabled:n,className:"flex-[2] px-4 py-3 bg-green-600 text-white rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition",children:n?"...":i?t("specialist_setup.finish"):"".concat(t("specialist_setup.next")," →")})]})}function f(){let{data:e,isPending:t}=(0,i.wV)(),s=(0,n.useRouter)(),{t:c,locale:o}=(0,r.Y)(),[b,f]=(0,a.useState)(1),[j,y]=(0,a.useState)(null),v="ru"===o?"ru":"uk"===o?"uk":"en"===o?"en":"el";if((0,a.useEffect)(()=>{t||e||s.push("/login")},[e,t]),t||!e)return(0,l.jsx)("div",{className:"text-center py-20 text-white",children:c("common.loading")});let N=b>5;return(0,l.jsx)("div",{className:"min-h-screen py-10 px-4",children:(0,l.jsxs)("div",{className:"max-w-lg mx-auto",children:[(0,l.jsxs)("div",{className:"text-center mb-6",children:[(0,l.jsx)("h1",{className:"text-lg font-semibold text-white/90",children:c("specialist_setup.page_title")}),!N&&(0,l.jsx)("p",{className:"text-sm text-white/50 mt-0.5",children:c("specialist_setup.step_of").replace("{current}",String(b)).replace("{total}",String(5))})]}),!N&&(0,l.jsx)(d,{current:b,total:5}),(0,l.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 p-6 shadow-sm",children:[N&&(0,l.jsx)(g,{t:c}),1===b&&(0,l.jsx)(u,{t:c,onNext:()=>f(2)}),2===b&&(0,l.jsx)(x,{t:c,onNext:()=>f(3),onBack:()=>f(1)}),3===b&&(0,l.jsx)(p,{t:c,onNext:()=>f(4),onBack:()=>f(2),onCardCreated:y}),4===b&&(0,l.jsx)(m,{t:c,onNext:()=>f(5),onBack:()=>f(3),card:j,catLocale:v}),5===b&&(0,l.jsx)(h,{t:c,onNext:()=>f(6),onBack:()=>f(4),card:j,catLocale:v})]}),b>=2&&b<=5&&(0,l.jsx)("div",{className:"text-center mt-4",children:(0,l.jsx)("button",{type:"button",onClick:()=>f(b+1),className:"text-sm text-white/50 hover:text-white/80 transition",children:c("specialist_setup.skip")})})]})})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=6073)),_N_E=e.O()}]); q(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1755],{1592:(e,t,l)=>{"use strict";l.d(t,{CI:()=>r,Hh:()=>n,Jv:()=>a,wV:()=>o,yK:()=>s});let s=(0,l(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:r,signUp:n,useSession:o}=s},2773:(e,t,l)=>{"use strict";l.d(t,{SpecialistsFiltersClient:()=>d});var s=l(4568),a=l(7620),r=l(7541),n=l(9906),o=l(2818),i=l(3119);let c=[{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 d(e){let{catTree:t,locations:l,initialQ:d,initialCategory:u,initialLocation:h,initialLanguages:b=[]}=e,g=(0,r.useRouter)(),{t:x,locale:p}=(0,n.Y)(),[m,f]=(0,a.useState)(null!=u?u:""),[y,k]=(0,a.useState)(null!=h?h:""),[v,j]=(0,a.useState)(b),w=!!(d||u||h||b.length),N=(e,t,l,s)=>{let a=new URLSearchParams;e&&a.set("q",e),t&&a.set("category",t),l&&a.set("location",l),s.length&&a.set("language",s.join(",")),g.push("/specialists".concat(a.toString()?"?"+a.toString():""))},C=e=>{let t=v.includes(e)?v.filter(t=>t!==e):[...v,e];j(t),N(null!=d?d:"",m,y,t)},S=x("create.field.location.any"),L=x("create.field.location.all"),_=x("filter.category.all"),D=x("create.field.category"),E=x("filter.location"),P=x("filter.language"),V=x("tasks.filter.reset");return(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),N(new FormData(e.currentTarget).get("q")||"",m,y,v)},className:"space-y-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)("input",{name:"q",defaultValue:d,placeholder:x("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"})}),t.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:D}),(0,s.jsx)(o.W,{categories:t,locale:"en"===p?"en":"ru"===p?"ru":"uk"===p?"uk":"el",value:m,onChange:e=>{f(e),N(null!=d?d:"",e,y,v)},placeholder:_})]}),l.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:E}),(0,s.jsx)(i.V,{locations:l,value:y,onChange:e=>{k(e),N(null!=d?d:"",m,e,v)},anyLabel:S,allLabel:L})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-2",children:P}),(0,s.jsx)("div",{className:"space-y-1",children:c.map(e=>{let t=v.includes(e.code);return(0,s.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer group py-0.5",children:[(0,s.jsx)("span",{className:"w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ".concat(t?"bg-green-600 border-green-600":"border-gray-300 group-hover:border-green-400"),onClick:()=>C(e.code),children:t&&(0,s.jsx)("svg",{className:"w-2.5 h-2.5 text-white",viewBox:"0 0 10 8",fill:"none",children:(0,s.jsx)("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,s.jsx)("span",{className:"text-sm select-none transition-colors ".concat(t?"text-green-700 font-medium":"text-gray-700"),onClick:()=>C(e.code),children:e.label})]},e.code)})})]}),(0,s.jsx)("button",{type:"submit",className:"w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:x("specialists.search.btn")}),w&&(0,s.jsx)("button",{type:"button",onClick:()=>{f(""),k(""),j([]),g.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:V})]})}},3932:(e,t,l)=>{"use strict";l.d(t,{FavoriteSpecialistButton:()=>o});var s=l(4568),a=l(7620),r=l(1592),n=l(2982);function o(e){let{specialistId:t,initialFavorite:l=!1,favoriteLabel:o,unfavoriteLabel:i}=e,{data:c}=(0,r.wV)(),[d,u]=(0,a.useState)(l),[h,b]=(0,a.useState)(!1);if(!c)return null;async function g(e){e.preventDefault(),e.stopPropagation(),b(!0);try{d?(await (0,n.sD)(t),u(!1)):(await (0,n.V)(t),u(!0))}catch(e){}b(!1)}return(0,s.jsx)("button",{onClick:g,disabled:h,title:d?i:o,className:"absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ".concat(d?"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:d?"❤️":"\uD83E\uDD0D"})}},4736:(e,t,l)=>{Promise.resolve().then(l.bind(l,3932)),Promise.resolve().then(l.bind(l,2773)),Promise.resolve().then(l.t.bind(l,9664,23))}},e=>{e.O(0,[1516,9664,9906,2982,1530,587,18,7358],()=>e(e.s=4736)),_N_E=e.O()}]); 9(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6174],{2928:(e,r,t)=>{"use strict";t.d(r,{l:()=>f,$:()=>h});var n=t(4568),a=t(7620),o=(0,a.forwardRef)((e,r)=>{let{as:t="div",...a}=e;return(0,n.jsx)(t,{...a,ref:r})});let i="onloadTurnstileCallback",l=e=>!!document.getElementById(e),s={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",u,d=new Promise((e,r)=>{u={resolve:e,reject:r},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return"unloaded"===c&&(c="loading",window[e]=()=>{u.resolve(),c="ready",delete window[e]}),d},p=(0,a.forwardRef)((e,r)=>{let{scriptOptions:t,options:u={},siteKey:d,onWidgetLoad:p,onSuccess:x,onExpire:f,onError:h,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y,onLoadScript:w,id:j,style:E,as:N="div",injectScript:k=!0,rerenderOnCallbackChange:S=!1,...T}=e,C=u.size,I=(0,a.useCallback)(()=>void 0===C?{}:"execute"===u.execution?s.invisible:"interaction-only"===u.appearance?s.interactionOnly:s[C],[u.execution,C,u.appearance]),[A,P]=(0,a.useState)(I()),L=(0,a.useRef)(null),[R,O]=(0,a.useState)(!1),F=(0,a.useRef)(void 0),_=(0,a.useRef)(!1),B=j||"cf-turnstile",q=(0,a.useRef)({onSuccess:x,onError:h,onExpire:f,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y});(0,a.useEffect)(()=>{S||(q.current={onSuccess:x,onError:h,onExpire:f,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y})});let D=(null==t?void 0:t.id)||"cf-turnstile-script",H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[r,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let r=()=>{l(e)&&t(!0)},n=new MutationObserver(r);return n.observe(document,{childList:!0,subtree:!0}),r(),()=>{n.disconnect()}},[e]),r}(D),W=(null==t?void 0:t.onLoadCallbackName)||"onloadTurnstileCallback",U=u.appearance||"always",z=(0,a.useMemo)(()=>{var e;return{sitekey:d,action:u.action,cData:u.cData,theme:u.theme||"auto",language:u.language||"auto",tabindex:u.tabIndex,"response-field":u.responseField,"response-field-name":u.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(C),retry:u.retry||"auto","retry-interval":u.retryInterval||8e3,"refresh-expired":u.refreshExpired||"auto","refresh-timeout":u.refreshTimeout||"auto",execution:u.execution||"render",appearance:u.appearance||"always","feedback-enabled":null==(e=u.feedbackEnabled)||e,callback:e=>{var r,t;_.current=!0,S?null==x||x(e):null==(r=(t=q.current).onSuccess)||r.call(t,e)},"error-callback":S?h:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a"u">typeof window&&!!window.turnstile,[]);return(0,a.useEffect)(function(){k&&!R&&(m(W),(e=>{let{render:r="explicit",onLoadCallbackName:t=i,scriptOptions:{nonce:n="",defer:a=!0,async:o=!0,id:s="",appendTo:c,onError:u,crossOrigin:d=""}={}}=e,m=s||"cf-turnstile-script";if(l(m))return;let p=document.createElement("script");p.id=m,p.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(t,"&render=").concat(r),document.querySelector('script[src="'.concat(p.src,'"]'))||(p.defer=!!a,p.async=!!o,n&&(p.nonce=n),d&&(p.crossOrigin=d),u&&(p.onerror=u,delete window[t]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(p))})({onLoadCallbackName:W,scriptOptions:{...t,id:D}}))},[k,R,t,D,W]),(0,a.useEffect)(function(){"ready"!==c&&m(W).then(()=>O(!0)).catch(console.error)},[W]),(0,a.useEffect)(function(){if(!L.current||!R)return;let e=!1;return(async()=>{e||!L.current||(F.current=window.turnstile.render(L.current,z),F.current&&(null==p||p(F.current)))})(),()=>{e=!0,F.current&&(window.turnstile.remove(F.current),_.current=!1)}},[B,R,z]),(0,a.useImperativeHandle)(r,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&F.current&&M()?e.getResponse(F.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((t,n)=>{let a,o=async()=>{if(_.current&&window.turnstile&&F.current)try{let e=window.turnstile.getResponse(F.current);return a&&clearTimeout(a),e?t(e):n(Error("No response received"))}catch(e){return a&&clearTimeout(a),console.warn("Failed to get response",e),n(Error("Failed to get response"))}a||(a=setTimeout(()=>{a&&clearTimeout(a),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,r)),await o()};o()})},reset(){if(!(null==e?void 0:e.reset)||!F.current||!M())return void console.warn("Turnstile has not been loaded");"execute"===u.execution&&P(s.invisible);try{_.current=!1,e.reset(F.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(F.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!F.current||!M())return void console.warn("Turnstile has not been loaded");P(s.invisible),_.current=!1,e.remove(F.current),F.current=null},render(){if(!(null==e?void 0:e.render)||!L.current||!M()||F.current)return void console.warn("Turnstile has not been loaded or container not found");let r=e.render(L.current,z);return F.current=r,F.current&&(null==p||p(F.current)),"execute"!==u.execution&&P(C?s[C]:{}),r},execute:()=>"execute"!==u.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&L.current&&F.current&&M()?void(e.execute(L.current,z),P(C?s[C]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&F.current&&M()?e.isExpired(F.current):(console.warn("Turnstile has not been loaded"),!1)}},[F,u.execution,C,z,L,M,R,p]),(0,a.useEffect)(()=>{if(R||!H)return;if(window.turnstile)return void O(!0);let e=setInterval(()=>{window.turnstile&&(O(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[R,H]),(0,a.useEffect)(()=>{P(I())},[u.execution,C,U]),(0,a.useEffect)(()=>{H&&"function"==typeof w&&w()},[H]),(0,n.jsx)(o,{ref:L,as:N,id:B,style:{...A,...E},...T})});p.displayName="Turnstile";let x="0x4AAAAAAC_FtTQJ0_6Cp9-9",f=!!x;function h(e){let{onSuccess:r,onError:t,onExpire:a}=e;return x?(0,n.jsx)(p,{siteKey:x,onSuccess:r,onError:t,onExpire:a,options:{theme:"light",language:"auto"}}):null}},5739:(e,r,t)=>{Promise.resolve().then(t.bind(t,9633))},7541:(e,r,t)=>{"use strict";var n=t(3041);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},9633:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>m});var n=t(4568),a=t(7620),o=t(9664),i=t.n(o),l=t(9906),s=t(2928),c=t(2982);let u="info@canhelp.gr",d={el:{title:"Υποστήριξη CanHelp",intro:"Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.",points:["Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.","Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.","Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες."]},en:{title:"CanHelp Support",intro:"If you need help with the app, email us or use the in-app contact form.",points:["Briefly describe the issue and attach a screenshot if possible.","If it is a login problem, include your device and app version.","We usually reply within 1-2 business days."]},ru:{title:"Поддержка CanHelp",intro:"Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.",points:["Кратко опишите проблему и, если возможно, приложите скриншот.","Если проблема со входом, укажите устройство и версию приложения.","Обычно мы отвечаем в течение 1-2 рабочих дней."]},uk:{title:"Підтримка CanHelp",intro:"Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.",points:["Коротко опишіть проблему та, якщо можливо, додайте скріншот.","Якщо проблема зі входом, вкажіть пристрій і версію додатка.","Зазвичай ми відповідаємо протягом 1-2 робочих днів."]}};function m(){var e;let{locale:r,t}=(0,l.Y)(),o=null!=(e=d[r])?e:d.en,[m,p]=(0,a.useState)(""),[x,f]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[v,b]=(0,a.useState)(""),[y,w]=(0,a.useState)(s.l?"":"dev"),[j,E]=(0,a.useState)(!1),[N,k]=(0,a.useState)(!1),[S,T]=(0,a.useState)("");async function C(e){e.preventDefault(),T(""),E(!0);try{await (0,c.O8)({name:m.trim(),email:x.trim(),subject:h.trim(),body:v.trim(),captchaToken:y}),k(!0)}catch(e){((null==e?void 0:e.message)||"").toLowerCase().includes("captcha")?(T("Security check failed. Please try again."),w("")):T("Failed to send message. Please try again.")}finally{E(!1)}}return(0,n.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,n.jsxs)("div",{className:"max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,n.jsx)("div",{className:"mb-6",children:(0,n.jsxs)(i(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",t("nav.home")]})}),(0,n.jsx)("h1",{className:"text-3xl font-extrabold text-gray-900 mb-3",children:o.title}),(0,n.jsx)("p",{className:"text-gray-600 leading-relaxed",children:o.intro}),(0,n.jsx)("div",{className:"mt-8 space-y-3",children:o.points.map(e=>(0,n.jsxs)("div",{className:"flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700",children:[(0,n.jsx)("span",{className:"mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0"}),(0,n.jsx)("span",{children:e})]},e))}),(0,n.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row gap-3 sm:items-center",children:[(0,n.jsx)("a",{href:"mailto:".concat(u),className:"inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition",children:u}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:t("nav.privacy")})]}),(0,n.jsxs)("form",{onSubmit:C,className:"mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-1",children:"Send a message to support"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"We will forward it directly to the admin team."})]}),(0,n.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name"}),(0,n.jsx)("input",{value:m,onChange:e=>p(e.target.value),required:!0,minLength:2,maxLength:100,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"Your name"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,n.jsx)("input",{type:"email",value:x,onChange:e=>f(e.target.value),required:!0,maxLength:200,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"name@example.com"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Subject"}),(0,n.jsx)("input",{value:h,onChange:e=>g(e.target.value),required:!0,minLength:3,maxLength:200,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"What do you need help with?"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message"}),(0,n.jsx)("textarea",{value:v,onChange:e=>b(e.target.value),required:!0,minLength:10,maxLength:5e3,rows:6,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none",placeholder:"Describe the problem in detail"})]}),(0,n.jsx)("div",{children:(0,n.jsx)(s.$,{onSuccess:w,onError:()=>w(""),onExpire:()=>w("")})}),S&&(0,n.jsx)("p",{className:"text-sm text-red-600",children:S}),N?(0,n.jsx)("div",{className:"rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800",children:"Your message has been sent."}):(0,n.jsx)("button",{type:"submit",disabled:j||s.l&&!y,className:"inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50",children:j?"Sending...":"Send message"})]})]})})}}},e=>{e.O(0,[9664,9906,2982,587,18,7358],()=>e(e.s=5739)),_N_E=e.O()}]); g(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9478],{1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>l})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>s,Jv:()=>l,wV:()=>i,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:a,signUp:s,useSession:i}=n},2928:(e,t,r)=>{"use strict";r.d(t,{l:()=>f,$:()=>p});var n=r(4568),l=r(7620),a=(0,l.forwardRef)((e,t)=>{let{as:r="div",...l}=e;return(0,n.jsx)(r,{...l,ref:t})});let s="onloadTurnstileCallback",i=e=>!!document.getElementById(e),o={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",d,u=new Promise((e,t)=>{d={resolve:e,reject:t},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return"unloaded"===c&&(c="loading",window[e]=()=>{d.resolve(),c="ready",delete window[e]}),u},x=(0,l.forwardRef)((e,t)=>{let{scriptOptions:r,options:d={},siteKey:u,onWidgetLoad:x,onSuccess:g,onExpire:f,onError:p,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y,onLoadScript:w,id:j,style:N,as:k="div",injectScript:S=!0,rerenderOnCallbackChange:E=!1,...C}=e,D=d.size,T=(0,l.useCallback)(()=>void 0===D?{}:"execute"===d.execution?o.invisible:"interaction-only"===d.appearance?o.interactionOnly:o[D],[d.execution,D,d.appearance]),[_,I]=(0,l.useState)(T()),A=(0,l.useRef)(null),[L,R]=(0,l.useState)(!1),U=(0,l.useRef)(void 0),O=(0,l.useRef)(!1),F=j||"cf-turnstile",P=(0,l.useRef)({onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y});(0,l.useEffect)(()=>{E||(P.current={onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y})});let M=(null==r?void 0:r.id)||"cf-turnstile-script",z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[t,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let t=()=>{i(e)&&r(!0)},n=new MutationObserver(t);return n.observe(document,{childList:!0,subtree:!0}),t(),()=>{n.disconnect()}},[e]),t}(M),B=(null==r?void 0:r.onLoadCallbackName)||"onloadTurnstileCallback",V=d.appearance||"always",H=(0,l.useMemo)(()=>{var e;return{sitekey:u,action:d.action,cData:d.cData,theme:d.theme||"auto",language:d.language||"auto",tabindex:d.tabIndex,"response-field":d.responseField,"response-field-name":d.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(D),retry:d.retry||"auto","retry-interval":d.retryInterval||8e3,"refresh-expired":d.refreshExpired||"auto","refresh-timeout":d.refreshTimeout||"auto",execution:d.execution||"render",appearance:d.appearance||"always","feedback-enabled":null==(e=d.feedbackEnabled)||e,callback:e=>{var t,r;O.current=!0,E?null==g||g(e):null==(t=(r=P.current).onSuccess)||t.call(r,e)},"error-callback":E?p:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l"u">typeof window&&!!window.turnstile,[]);return(0,l.useEffect)(function(){S&&!L&&(m(B),(e=>{let{render:t="explicit",onLoadCallbackName:r=s,scriptOptions:{nonce:n="",defer:l=!0,async:a=!0,id:o="",appendTo:c,onError:d,crossOrigin:u=""}={}}=e,m=o||"cf-turnstile-script";if(i(m))return;let x=document.createElement("script");x.id=m,x.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(r,"&render=").concat(t),document.querySelector('script[src="'.concat(x.src,'"]'))||(x.defer=!!l,x.async=!!a,n&&(x.nonce=n),u&&(x.crossOrigin=u),d&&(x.onerror=d,delete window[r]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(x))})({onLoadCallbackName:B,scriptOptions:{...r,id:M}}))},[S,L,r,M,B]),(0,l.useEffect)(function(){"ready"!==c&&m(B).then(()=>R(!0)).catch(console.error)},[B]),(0,l.useEffect)(function(){if(!A.current||!L)return;let e=!1;return(async()=>{e||!A.current||(U.current=window.turnstile.render(A.current,H),U.current&&(null==x||x(U.current)))})(),()=>{e=!0,U.current&&(window.turnstile.remove(U.current),O.current=!1)}},[F,L,H]),(0,l.useImperativeHandle)(t,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&U.current&&W()?e.getResponse(U.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((r,n)=>{let l,a=async()=>{if(O.current&&window.turnstile&&U.current)try{let e=window.turnstile.getResponse(U.current);return l&&clearTimeout(l),e?r(e):n(Error("No response received"))}catch(e){return l&&clearTimeout(l),console.warn("Failed to get response",e),n(Error("Failed to get response"))}l||(l=setTimeout(()=>{l&&clearTimeout(l),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,t)),await a()};a()})},reset(){if(!(null==e?void 0:e.reset)||!U.current||!W())return void console.warn("Turnstile has not been loaded");"execute"===d.execution&&I(o.invisible);try{O.current=!1,e.reset(U.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(U.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!U.current||!W())return void console.warn("Turnstile has not been loaded");I(o.invisible),O.current=!1,e.remove(U.current),U.current=null},render(){if(!(null==e?void 0:e.render)||!A.current||!W()||U.current)return void console.warn("Turnstile has not been loaded or container not found");let t=e.render(A.current,H);return U.current=t,U.current&&(null==x||x(U.current)),"execute"!==d.execution&&I(D?o[D]:{}),t},execute:()=>"execute"!==d.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&A.current&&U.current&&W()?void(e.execute(A.current,H),I(D?o[D]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&U.current&&W()?e.isExpired(U.current):(console.warn("Turnstile has not been loaded"),!1)}},[U,d.execution,D,H,A,W,L,x]),(0,l.useEffect)(()=>{if(L||!z)return;if(window.turnstile)return void R(!0);let e=setInterval(()=>{window.turnstile&&(R(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[L,z]),(0,l.useEffect)(()=>{I(T())},[d.execution,D,V]),(0,l.useEffect)(()=>{z&&"function"==typeof w&&w()},[z]),(0,n.jsx)(a,{ref:A,as:k,id:F,style:{..._,...N},...C})});x.displayName="Turnstile";let g="0x4AAAAAAC_FtTQJ0_6Cp9-9",f=!!g;function p(e){let{onSuccess:t,onError:r,onExpire:l}=e;return g?(0,n.jsx)(x,{siteKey:g,onSuccess:t,onError:r,onExpire:l,options:{theme:"light",language:"auto"}}):null}},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>i,z:()=>o});var n=r(4568),l=r(7620),a=r(2982);let s=(0,l.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function i(e){let{children:t,initialSlug:r=""}=e,[i,o]=(0,l.useState)(r),[c,d]=(0,l.useState)([]),[u,m]=(0,l.useState)(!0);(0,l.useEffect)(()=>{o(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,l.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>m(!1))},[]);let x=(0,l.useCallback)(e=>{o(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),g=(0,l.useCallback)(e=>{if(!i)return"";for(let l of c){var t,r,n;if(l.slug===i)return null!=(t=l.names[e])?t:l.names.el;for(let t of null!=(r=l.children)?r:[])if(t.slug===i)return null!=(n=t.names[e])?n:t.names.el}return i},[i,c]);return(0,n.jsx)(s.Provider,{value:{locationSlug:i,locationTree:c,locationLoading:u,setLocation:x,getLabel:g},children:t})}function o(){return(0,l.useContext)(s)}},5338:(e,t,r)=>{"use strict";function n(e,t){if(!e)return"";let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<5)return t("user.online");if(r<60)return t("user.seen_minutes").replace("{n}",String(r));let n=Math.floor(r/60);if(n<24)return t("user.seen_hours").replace("{n}",String(n));let l=Math.floor(n/24);return 1===l?t("user.seen_yesterday"):t("user.seen_days").replace("{n}",String(l))}r.d(t,{V:()=>n})},6261:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(4568),l=r(7620),a=r(7541),s=r(9664),i=r.n(s),o=r(1592),c=r(9906),d=r(4029),u=r(2982),m=r(1258),x=r(5338),g=r(3119),f=r(2818),p=r(2928);let h="https://api.canhelp.gr",b=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)};function v(){var e;let{data:t,isPending:r}=(0,o.wV)(),s=(0,a.useRouter)(),v=null!=(e=(0,a.useSearchParams)().get("category"))?e:"",{t:y,locale:w}=(0,c.Y)(),[j,N]=(0,l.useState)([]),[k,S]=(0,l.useState)([]),[E,C]=(0,l.useState)(!1),[D,T]=(0,l.useState)(""),[_,I]=(0,l.useState)([]),[A,L]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e)}),[R,U]=(0,l.useState)(30),[O,F]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e).slice(0,7)}),P=(0,l.useRef)(null),[M,z]=(0,l.useState)({}),[B,V]=(0,l.useState)(new Set),[H,W]=(0,l.useState)(p.l?"":"dev"),{locationSlug:q}=(0,d.z)(),[K,J]=(0,l.useState)(""),[Y,$]=(0,l.useState)(v);(0,l.useEffect)(()=>{q&&J(q)},[q]);let[G,Q]=(0,l.useState)([]),[X,Z]=(0,l.useState)(!1),ee=(0,l.useRef)(null);async function et(e){var t;let r=null==(t=e.target.files)?void 0:t[0];if(r){Z(!0);try{let e=new FormData;e.append("file",r);let t=await fetch("".concat(h,"/api/uploads"),{method:"POST",credentials:"include",body:e});if(!t.ok)throw Error("Upload failed");let{url:n}=await t.json();Q(e=>[...e,"".concat(h).concat(n)])}catch(e){T(y("profile.upload.error"))}finally{Z(!1),ee.current&&(ee.current.value="")}}}async function er(e){e.preventDefault(),T(""),C(!0);let t=new FormData(e.currentTarget),r={title:t.get("title"),description:t.get("description"),category:t.get("category")||void 0,location:t.get("location")||void 0,budget:t.get("budget")?Number(t.get("budget")):void 0,budgetNegotiable:"on"===t.get("budgetNegotiable"),deadline:t.get("deadline")?new Date(t.get("deadline")).toISOString():void 0,expiresAt:(()=>{let e=new Date;return e.setDate(e.getDate()+Number(t.get("expiresAtDays")||30)),e.toISOString()})(),timeSlot:t.get("timeSlot")||void 0,district:t.get("district")||void 0,street:t.get("street")||void 0,houseNumber:t.get("houseNumber")||void 0,confidentialNote:t.get("confidentialNote")||void 0,images:G.length>0?G:void 0,status:"open",locale:w,inviteSpecialistIds:B.size>0?[...B]:void 0};try{let e=await (0,u.UT)({...r,captchaToken:H});s.push("/tasks/".concat(e.id))}catch(e){T(e.message||y("create.error"))}finally{C(!1)}}if((0,l.useEffect)(()=>{r||t||s.push("/login"),(0,u.bW)().then(N).catch(()=>{}),(0,u.Vs)().then(S).catch(()=>{})},[t,r]),(0,l.useEffect)(()=>{if(!Y)return void I([]);(0,u.F7)({limit:"5",category:Y,locale:w}).then(e=>I(e.data)).catch(()=>{})},[Y,w]),(0,l.useEffect)(()=>{if(!A||0===_.length)return;let e=A.slice(0,7);Promise.all(_.map(e=>e.id).map(t=>fetch("".concat(h,"/api/availability/user/").concat(t,"?month=").concat(e),{credentials:"include"}).then(e=>e.ok?e.json():[]).then(e=>{var r;let n=e.find(e=>e.date===A);return{id:t,status:null!=(r=null==n?void 0:n.status)?r:null}}).catch(()=>({id:t,status:null})))).then(e=>{let t={};e.forEach(e=>{let{id:r,status:n}=e;t[r]=n}),z(t)})},[A,_]),r)return(0,n.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let en="en"===w?"en":"ru"===w?"ru":"uk"===w?"uk":"el",el="ru"===w?"ru-RU":"uk"===w?"uk-UA":"en"===w?"en-US":"el-GR",ea=new Date;ea.setHours(0,0,0,0);let[es,ei]=O.split("-").map(Number),eo=new Date(es,ei,0).getDate(),ec=[];for(let e=1;e<=eo;e++){let t=new Date(es,ei-1,e);t>=ea&&ec.push(t)}let ed=Array.from({length:12},(e,t)=>{let r=new Date;return r.setDate(1),r.setMonth(r.getMonth()+t),{value:b(r).slice(0,7),label:r.toLocaleDateString(el,{month:"long",year:"numeric"})}}),eu=y("tasks.new.top_specialists");return(0,n.jsxs)("div",{className:"max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8",children:[(0,n.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6",children:y("create.title")}),(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-6 lg:gap-8 items-start",children:[(0,n.jsx)("div",{className:"flex-1 min-w-0 w-full",children:(0,n.jsxs)("form",{onSubmit:er,className:"bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5",children:[D&&(0,n.jsx)("div",{className:"bg-red-50 text-red-700 p-3 rounded-lg text-sm",children:D}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.category")}),(0,n.jsx)(f.W,{categories:j,locale:en,value:Y,onChange:$,placeholder:y("create.field.category.select")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.location")}),(0,n.jsx)(g.V,{locations:k,value:K,onChange:J,anyLabel:y("create.field.location.any"),allLabel:y("create.field.location.all")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.title")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("input",{name:"title",required:!0,minLength:5,maxLength:200,placeholder:y("create.field.title.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.description")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("textarea",{name:"description",required:!0,minLength:20,rows:4,placeholder:y("create.field.description.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.budget")}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"budget",type:"number",min:1,step:1,placeholder:y("create.field.budget.placeholder"),className:"w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,n.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,n.jsx)("input",{type:"checkbox",name:"budgetNegotiable",className:"w-4 h-4 rounded border-gray-300 text-green-600"}),(0,n.jsx)("span",{className:"text-sm text-gray-700",children:y("create.field.budget_negotiable")})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700 shrink-0",children:y("create.field.deadline")}),(0,n.jsx)("select",{value:O,onChange:e=>F(e.target.value),className:"flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:ed.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,n.jsx)("button",{type:"button",title:"Открыть календарь",onClick:()=>{var e,t;try{null==(e=P.current)||e.showPicker()}catch(e){null==(t=P.current)||t.click()}},className:"shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,n.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,n.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,n.jsx)("input",{ref:P,type:"date",min:b(ea),value:A,onChange:e=>{e.target.value&&(L(e.target.value),F(e.target.value.slice(0,7)))},className:"absolute w-0 h-0 opacity-0 pointer-events-none"})]}),(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory",children:ec.map(e=>{let t=b(e),r=A===t,l=e.toLocaleDateString(el,{weekday:"short"}),a=e.getDate();return(0,n.jsxs)("button",{type:"button",onClick:()=>L(t),className:"flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(r?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50"),children:[(0,n.jsx)("span",{className:"text-xs font-medium uppercase leading-none mb-0.5",children:l}),(0,n.jsx)("span",{className:"text-xl font-bold leading-none",children:a})]},t)})}),(0,n.jsx)("input",{type:"hidden",name:"deadline",value:A})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.expires_at")}),(0,n.jsx)("div",{className:"flex gap-2",children:[7,14,30,60].map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>U(e),className:"flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(R===e?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300"),children:[e," ",y("create.field.expires_at.days").replace("{n}","")]},e))}),(0,n.jsx)("input",{type:"hidden",name:"expiresAtDays",value:R})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.time_slot")}),(0,n.jsxs)("select",{name:"timeSlot",className:"w-full border border-gray-300 rounded-lg px-3 py-2",children:[(0,n.jsx)("option",{value:"",children:y("create.field.time_slot.any")}),(0,n.jsx)("option",{value:"morning",children:y("create.field.time_slot.morning")}),(0,n.jsx)("option",{value:"afternoon",children:y("create.field.time_slot.afternoon")}),(0,n.jsx)("option",{value:"evening",children:y("create.field.time_slot.evening")}),(0,n.jsx)("option",{value:"weekend",children:y("create.field.time_slot.weekend")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.photos")}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mb-2",children:[G.map((e,t)=>(0,n.jsxs)("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200",children:[(0,n.jsx)("img",{src:e,alt:"",className:"w-full h-full object-cover"}),(0,n.jsx)("button",{type:"button",onClick:()=>Q(e=>e.filter((e,r)=>r!==t)),className:"absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70",children:"\xd7"})]},t)),G.length<5&&(0,n.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=ee.current)?void 0:e.click()},disabled:X,className:"w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50",children:X?"...":(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-2xl leading-none",children:"+"}),(0,n.jsx)("span",{children:y("create.field.photos.add")})]})})]}),(0,n.jsx)("input",{ref:ee,type:"file",accept:"image/*",className:"hidden",onChange:et})]}),(0,n.jsxs)("div",{className:"space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl",children:[(0,n.jsxs)("p",{className:"text-xs font-medium text-yellow-700 flex items-center gap-1",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"\uD83D\uDD12 ",y("create.field.confidential.hint")]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.address")}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"district",placeholder:y("create.field.address.district"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"street",placeholder:y("create.field.address.street"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"houseNumber",placeholder:y("create.field.address.house"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.confidential")}),(0,n.jsx)("textarea",{name:"confidentialNote",rows:2,placeholder:y("create.field.confidential.placeholder"),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 resize-none bg-white"})]})]}),(0,n.jsx)(p.$,{onSuccess:W,onError:()=>W(""),onExpire:()=>W("")}),(0,n.jsx)("button",{type:"submit",disabled:E||!H,className:"w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:E?y("create.submitting"):y("create.submit")})]})}),(0,n.jsx)("aside",{className:"hidden lg:block lg:w-64 shrink-0",children:(0,n.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 sticky top-24",children:[(0,n.jsx)("h3",{className:"font-semibold text-gray-900 mb-4 text-sm",children:eu}),Y?0===_.length?(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("specialists.empty")}):(0,n.jsx)("div",{className:"space-y-3",children:_.map(e=>{var t,r,l,a,s,o;let c=(0,m.H)(e.firstName,e.lastName,e.name),d="".concat(null!=(s=null==(t=e.firstName)?void 0:t[0])?s:"").concat(null!=(o=null==(r=e.lastName)?void 0:r[0])?o:"").toUpperCase()||(null==(a=e.name)||null==(l=a[0])?void 0:l.toUpperCase())||"?",u=(0,x.V)(e.lastSeenAt,y),g=M[e.id],f=B.has(e.id);return(0,n.jsxs)("div",{className:"rounded-lg border border-gray-100 hover:bg-gray-50 transition",children:[(0,n.jsxs)(i(),{href:"/users/".concat(e.id),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-2",children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100",children:e.image?(0,n.jsx)("img",{src:e.image,alt:c,className:"w-full h-full object-cover"}):d}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:c}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.rating?(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["★ ",Number(e.rating).toFixed(1)]}):u?(0,n.jsx)("p",{className:"text-xs text-gray-400",children:u}):null,"number"==typeof e.reviewCount&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-gray-400",children:[e.reviewCount," ",y("reviews.count")]}),"number"==typeof e.positivePercent&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-green-600",children:[e.positivePercent,"% \uD83D\uDC4D"]}),"available"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 inline-block"}),y("schedule.available")]}),"busy"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 inline-block"}),y("schedule.busy")]})]})]})]}),(0,n.jsx)("div",{className:"px-2 pb-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>V(t=>{let r=new Set(t);return r.has(e.id)?r.delete(e.id):r.add(e.id),r}),className:"w-full text-xs font-medium py-1 rounded-lg transition ".concat(f?"bg-green-600 text-white hover:bg-green-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:f?y("tasks.new.invited"):y("tasks.new.invite")})})]},e.id)})}):(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("tasks.new.select_category")})]})})]})]})}},7029:(e,t,r)=>{Promise.resolve().then(r.bind(r,6261))}},e=>{e.O(0,[1516,9664,9906,2982,1530,587,18,7358],()=>e(e.s=7029)),_N_E=e.O()}]); (()=>{"use strict";var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}},i=!0;try{e[n].call(a.exports,a,a.exports,r),i=!1}finally{i&&delete t[n]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(n){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[n,o,a];return}for(var l=1/0,i=0;i=a)&&Object.keys(r.O).every(e=>r.O[e](n[d]))?n.splice(d--,1):(u=!1,a{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o||"object"==typeof n&&n&&(4&o&&n.__esModule||16&o&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&o&&n;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,r.d(a,i),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"static/chunks/"+(9031===e?"e89fb3a8":e)+"."+({3542:"bb9abe76cf68d932",6467:"06a1c0ca06759ccf",7797:"7f09b625f84a88e2",9031:"7ade5d06ffa9957d"})[e]+".js",r.miniCssF=e=>"static/css/93ad12acbd6e0cbd.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(n,o,a,i)=>{if(e[n])return void e[n].push(o);if(void 0!==a)for(var l,u,d=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),u&&document.head.appendChild(l)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={8068:0};r.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&({2012:1})[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=a=>{if(o.onerror=o.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),l=a&&a.target&&a.target.href||t,u=Error("Loading CSS chunk "+e+" failed.\n("+l+")");u.code="CSS_CHUNK_LOAD_FAILED",u.type=i,u.request=l,o.parentNode.removeChild(o),n(u)}},o.href=t,!function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:t,onload:r,onerror:n}=e;_N_E_STYLE_LOAD(0===t.indexOf(window.location.origin)?new URL(t).pathname:t).then(()=>null==r?void 0:r.call(e,{type:"load"}),()=>null==n?void 0:n.call(e,{}))}else document.head.appendChild(e)}(o)})(e,a,t,n)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}})(),(()=>{var e={8068:0,9950:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(2012|8068|9950)$/.test(t))e[t]=0;else{var a=new Promise((r,n)=>o=e[t]=[r,n]);n.push(o[2]=a);var i=r.p+r.u(t),l=Error();r.l(i,n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,l,u]=n,d=0;if(i.some(t=>0!==e[t])){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(u)var s=u(r)}for(t&&t(n);d{r.r(t),r.d(t,{default:()=>n});var s=r(4568),l=r(7620),a=r(9906),o=r(2982);function n(e){let{onClose:t}=e,{t:r}=(0,a.Y)(),[n,i]=(0,l.useState)("bug"),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(""),[p,g]=(0,l.useState)(!1),[m,b]=(0,l.useState)(!1),[h,y]=(0,l.useState)(""),f=[{value:"bug",label:r("support.type.bug"),icon:"\uD83D\uDC1B",color:"border-red-300 bg-red-50 text-red-700"},{value:"suggestion",label:r("support.type.suggestion"),icon:"\uD83D\uDCA1",color:"border-green-300 bg-green-50 text-green-700"},{value:"other",label:r("support.type.other"),icon:"\uD83D\uDCAC",color:"border-gray-300 bg-gray-50 text-gray-700"}];async function j(e){e.preventDefault(),y(""),g(!0);try{await (0,o.mq)({type:n,subject:c,body:u}),b(!0)}catch(e){y(r("support.error"))}finally{g(!1)}}return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:e=>e.target===e.currentTarget&&t(),children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})}),(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:r("support.title")})]}),(0,s.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),m?(0,s.jsxs)("div",{className:"px-6 py-10 text-center",children:[(0,s.jsx)("div",{className:"text-5xl mb-4",children:"✅"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:r("support.sent.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:r("support.sent.body")}),(0,s.jsx)("button",{onClick:t,className:"bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700",children:r("support.sent.close")})]}):(0,s.jsxs)("form",{onSubmit:j,className:"px-6 py-5 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:r("support.type.label")}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",children:f.map(e=>{let{value:t,label:r,icon:l,color:a}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>i(t),className:"flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(n===t?a+" border-opacity-100":"border-gray-200 bg-white text-gray-500 hover:border-gray-300"),children:[(0,s.jsx)("span",{className:"text-xl",children:l}),r]},t)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:r("support.subject")}),(0,s.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),required:!0,minLength:3,maxLength:200,placeholder:r("support.subject.placeholder"),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"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:r("support.body")}),(0,s.jsx)("textarea",{value:u,onChange:e=>x(e.target.value),required:!0,minLength:10,maxLength:5e3,rows:5,placeholder:r("support.body.placeholder"),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 resize-none"})]}),h&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,s.jsxs)("div",{className:"flex gap-3 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50",children:r("support.cancel")}),(0,s.jsx)("button",{type:"submit",disabled:p,className:"flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50",children:p?"...":r("support.submit")})]})]})]})})}}}]); ~2"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2982],{2982:(t,e,a)=>{a.d(e,{$7:()=>B,$H:()=>h,$M:()=>C,Bb:()=>tZ,Bm:()=>R,Bq:()=>tY,Br:()=>tp,C0:()=>U,CX:()=>tH,Ck:()=>tW,Cs:()=>en,D1:()=>tM,Em:()=>o,F7:()=>u,F9:()=>w,FI:()=>tR,Fu:()=>s,GB:()=>td,GE:()=>Z,Gp:()=>em,H:()=>es,H6:()=>S,He:()=>W,I:()=>tq,Ic:()=>t2,Ip:()=>E,Je:()=>ec,K7:()=>V,KD:()=>z,KZ:()=>eP,Lb:()=>y,Lp:()=>tL,ML:()=>eh,Mm:()=>tt,NL:()=>k,Nt:()=>tN,O8:()=>eT,OM:()=>tV,OV:()=>ey,OX:()=>tJ,On:()=>b,P0:()=>ee,QN:()=>P,QY:()=>tz,RN:()=>eu,RQ:()=>el,Rt:()=>d,S$:()=>ep,S9:()=>Q,Sw:()=>m,T9:()=>eo,Tr:()=>J,U9:()=>t9,UE:()=>ef,UT:()=>c,Uq:()=>$,V:()=>j,V7:()=>tO,VL:()=>N,VM:()=>p,Vs:()=>I,Wi:()=>Y,Xz:()=>tQ,YQ:()=>tF,Yj:()=>tc,Z2:()=>t5,Zp:()=>O,_z:()=>v,aT:()=>l,bR:()=>tk,bW:()=>D,bc:()=>ed,bi:()=>tu,bx:()=>f,cJ:()=>tS,cS:()=>G,cl:()=>tI,cp:()=>tj,dE:()=>x,eR:()=>t$,eU:()=>tl,ew:()=>t6,f5:()=>tG,fP:()=>K,fm:()=>t4,fu:()=>t_,g0:()=>et,g1:()=>tT,gg:()=>i,hD:()=>ea,hl:()=>tK,hp:()=>X,iN:()=>tB,i_:()=>M,j_:()=>tg,jd:()=>te,jg:()=>tU,k_:()=>tP,lC:()=>r,mq:()=>eO,nT:()=>eb,nf:()=>tr,oD:()=>t1,oh:()=>t3,oq:()=>tn,pD:()=>F,pK:()=>t8,q7:()=>T,qT:()=>tC,qX:()=>tD,qt:()=>ty,rC:()=>tw,rl:()=>t7,sD:()=>q,s_:()=>to,st:()=>L,td:()=>tE,ts:()=>g,u0:()=>eN,u4:()=>tf,uQ:()=>ti,v9:()=>A,vD:()=>t0,vh:()=>eS,vy:()=>ta,wc:()=>tA,wl:()=>ts,yJ:()=>tb,yO:()=>th,yk:()=>H,z4:()=>ei,z5:()=>tm,z6:()=>er,zB:()=>tX,zR:()=>tv,zZ:()=>_,zc:()=>tx,zk:()=>eg});let n="https://api.canhelp.gr";async function o(t,e){let a="".concat(n,"/api").concat(t),o=await fetch(a,{...e,credentials:"include",headers:{"Content-Type":"application/json",...null==e?void 0:e.headers}});if(!o.ok){let t=await o.json().catch(()=>({error:o.statusText}));throw Error("string"==typeof t.error?t.error:"string"==typeof t.message?t.message:o.statusText||"Request failed")}return o.json()}let s=()=>o("/tasks/my"),i=t=>o("/tasks/".concat(t)),c=t=>o("/tasks",{method:"POST",body:JSON.stringify(t)}),r=(t,e)=>o("/tasks/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),d=t=>o("/tasks/".concat(t,"/complete"),{method:"PATCH"}),m=t=>o("/offers?taskId=".concat(t)),l=()=>o("/offers/my"),g=t=>o("/offers",{method:"POST",body:JSON.stringify(t)}),h=t=>o("/offers/".concat(t,"/accept"),{method:"PATCH"}),y=t=>o("/offers/".concat(t,"/decline"),{method:"PATCH"}),p=(t,e)=>o("/users/".concat(t,"/profile").concat(e?"?locale=".concat(encodeURIComponent(e)):"")),u=t=>{let e=t?"?"+new URLSearchParams(t):"";return o("/users/specialists".concat(e))},f=t=>o("/reviews",{method:"POST",body:JSON.stringify(t)}),S=t=>o("/reviews/task/".concat(t)),T=()=>o("/reviews/my"),O=()=>o("/chat/rooms"),P=t=>o("/chat/direct/".concat(t)),b=t=>o("/chat/can-message/".concat(t)),N=t=>o("/chat/rooms/".concat(t,"/messages")),v=(t,e)=>o("/chat/messages",{method:"POST",body:JSON.stringify({roomId:t,body:e})}),J=()=>o("/notifications"),C=()=>o("/notifications/count"),E=t=>o("/notifications/".concat(t,"/read"),{method:"PATCH"}),k=()=>o("/notifications/read-all",{method:"PATCH"}),w=t=>o("/notifications?type=task_invite&referenceId=".concat(t)),H=t=>o("/notifications/".concat(t),{method:"DELETE"}),L=()=>o("/users/me/referral"),U=t=>o("/users/me/referral/apply",{method:"POST",body:JSON.stringify({refCode:t})}),A=t=>o("/reviews/user/".concat(t)),R=t=>o("/reviews/user/".concat(t,"/rating")),D=()=>o("/categories"),I=()=>o("/locations"),F=()=>o("/favorites/specialists"),j=t=>o("/favorites/specialists/".concat(t),{method:"POST"}),q=t=>o("/favorites/specialists/".concat(t),{method:"DELETE"}),z=()=>o("/admin/categories"),_=t=>o("/admin/categories",{method:"POST",body:JSON.stringify(t)}),B=(t,e)=>o("/admin/categories/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),V=t=>o("/admin/categories/".concat(t),{method:"DELETE"}),M=t=>o("/admin/skills?categorySlug=".concat(encodeURIComponent(t))),Q=t=>o("/admin/skills",{method:"POST",body:JSON.stringify(t)}),K=(t,e)=>o("/admin/skills/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),X=t=>o("/admin/skills/".concat(t),{method:"DELETE"}),Z=t=>o("/admin/skills/dedup".concat(t?"?categorySlug=".concat(encodeURIComponent(t)):"")),$=(t,e)=>o("/admin/skills/dedup/merge",{method:"POST",body:JSON.stringify({keepId:t,deleteIds:e})}),x=()=>o("/admin/stats"),G=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,n=new URLSearchParams({page:String(t),limit:"20"});return e&&n.set("q",e),a&&n.set("role",a),o("/admin/users?".concat(n))},Y=t=>o("/admin/users/".concat(t,"/deactivate"),{method:"PATCH"}),W=t=>o("/admin/users/".concat(t,"/activate"),{method:"PATCH"}),tt=(t,e)=>o("/admin/users/".concat(t,"/role"),{method:"PATCH",body:JSON.stringify({role:e})}),te=t=>o("/admin/users/".concat(t)),ta=t=>o("/admin/users/".concat(t,"/specialist-cards")),tn=(t,e)=>o("/admin/specialist-cards/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),to=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,a=new URLSearchParams({page:String(t),limit:"20"});return e&&"all"!==e&&a.set("status",e),o("/admin/specialist-cards?".concat(a))},ts=(t,e)=>o("/admin/users/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),ti=t=>o("/admin/users/".concat(t,"/verify-email"),{method:"PATCH"}),tc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,n=new URLSearchParams({page:String(t),limit:"20"});return e&&n.set("q",e),a&&n.set("status",a),o("/admin/tasks?".concat(n))},tr=t=>o("/admin/tasks/".concat(t,"/cancel"),{method:"PATCH"}),td=t=>o("/admin/tasks/".concat(t),{method:"DELETE"}),tm=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,a=new URLSearchParams({page:String(t),limit:"20"});return e&&"all"!==e&&a.set("status",e),o("/admin/reports?".concat(a))},tl=(t,e)=>o("/admin/reports/".concat(t,"/status"),{method:"PATCH",body:JSON.stringify({status:e})}),tg=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return o("/admin/ai-logs?page=".concat(t,"&limit=50"))},th=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.event&&e.set("event",t.event),t.userId&&e.set("userId",t.userId),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/activity-logs?".concat(e))},ty=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.event&&e.set("event",t.event),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/mail-logs?".concat(e))},tp=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.type&&e.set("type",t.type),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/notification-logs?".concat(e))},tu=()=>o("/admin/notification-stats"),tf=()=>o("/admin/mail-stats"),tS=()=>o("/admin/referrals"),tT=(t,e)=>o("/admin/push/user/".concat(t),{method:"POST",body:JSON.stringify(e)}),tO=t=>o("/admin/push/broadcast",{method:"POST",body:JSON.stringify(t)}),tP=()=>o("/admin/locations"),tb=t=>o("/admin/locations",{method:"POST",body:JSON.stringify(t)}),tN=(t,e)=>o("/admin/locations/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tv=t=>o("/admin/locations/".concat(t),{method:"DELETE"}),tJ=()=>o("/admin/plans"),tC=t=>o("/admin/plans",{method:"POST",body:JSON.stringify(t)}),tE=(t,e)=>o("/admin/plans/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tk=t=>o("/admin/plans/".concat(t),{method:"DELETE"}),tw=()=>o("/admin/settings"),tH=t=>o("/admin/settings",{method:"PUT",body:JSON.stringify(t)}),tL=()=>o("/admin/settings/templates"),tU=(t,e)=>o("/admin/settings/templates/".concat(t),{method:"PUT",body:JSON.stringify(e)}),tA=t=>o("/admin/settings/templates/translate",{method:"POST",body:JSON.stringify(t)}),tR=()=>o("/admin/settings/test-email",{method:"POST"}),tD=(t,e)=>fetch("".concat(n,"/api/admin/settings/test-telegram"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:t,chatId:e})}).then(t=>t.json()),tI=t=>fetch("".concat(n,"/api/admin/settings/verify-telegram-token"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:t})}).then(t=>t.json()),tF=()=>o("/admin/translations/stats"),tj=function(t,e,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;return o("/admin/translations/auto-translate",{method:"POST",body:JSON.stringify({table:t,missingLang:e,fromLang:a,batchSize:n})})},tq=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;return o("/admin/translations/auto-translate-tasks",{method:"POST",body:JSON.stringify({batchSize:t})})},tz=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return o("/admin/translations/tasks-preview?lang=".concat(t,"&limit=").concat(e))},t_=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"el";return o("/admin/translations/auto-translate-templates",{method:"POST",body:JSON.stringify({missingLang:t,fromLang:e})})},tB=t=>o("/availability/my".concat(t?"?month=".concat(t):"")),tV=(t,e,a)=>o("/availability/set",{method:"POST",body:JSON.stringify({date:t,status:e,note:a})}),tM=(t,e,a)=>o("/availability/set-range",{method:"POST",body:JSON.stringify({from:t,to:e,status:a})}),tQ=(t,e)=>o("/availability/user/".concat(t).concat(e?"?month=".concat(e):"")),tK=(t,e)=>o("/portfolio/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tX=t=>o("/portfolio/".concat(t),{method:"DELETE"}),tZ=()=>o("/specialist-cards/my"),t$=t=>o("/specialist-cards",{method:"POST",body:JSON.stringify(t)}),tx=(t,e)=>o("/specialist-cards/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tG=t=>o("/specialist-cards/".concat(t),{method:"DELETE"}),tY=(t,e)=>o("/specialist-cards/user/".concat(t).concat(e?"?locale=".concat(encodeURIComponent(e)):"")),tW=(t,e)=>o("/price-list/".concat(t).concat(e?"?locale=".concat(encodeURIComponent(e)):"")),t0=(t,e)=>o("/price-list/".concat(t,"/groups"),{method:"POST",body:JSON.stringify(e)}),t1=(t,e)=>o("/price-list/groups/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),t2=t=>o("/price-list/groups/".concat(t),{method:"DELETE"}),t5=(t,e)=>o("/price-list/groups/".concat(t,"/items"),{method:"POST",body:JSON.stringify(e)}),t9=t=>o("/price-list/items/".concat(t),{method:"DELETE"}),t7=t=>{let e=(null==t?void 0:t.length)?"?"+t.map(t=>"category=".concat(encodeURIComponent(t))).join("&"):"";return o("/skill-suggestions".concat(e))},t3=t=>o("/payments/topup/init",{method:"POST",body:JSON.stringify({amount:t})}),t8=()=>o("/payments/history"),t4=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return o("/payments/balance-history?limit=".concat(t))},t6=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return o("/users/me/plan-history?limit=".concat(t))},et=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.userId&&e.set("userId",t.userId),t.kind&&e.set("kind",t.kind),e.set("limit","50"),o("/admin/balance-history?".concat(e))},ee=(t,e)=>o("/admin/users/".concat(t,"/balance/topup"),{method:"POST",body:JSON.stringify(e)}),ea=(t,e)=>o("/admin/users/".concat(t,"/balance/withdraw"),{method:"POST",body:JSON.stringify(e)}),en=t=>o("/payments/plan/preview",{method:"POST",body:JSON.stringify({planId:t})}),eo=t=>o("/plans".concat(t?"?role=".concat(t):"")),es=()=>o("/dashboard/me"),ei=()=>o("/plans/daily-usage"),ec=function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return o("/payments/plan/purchase",{method:"POST",body:JSON.stringify({planId:t,payFromBalance:e})})},er=()=>o("/statuses/me"),ed=(t,e)=>o("/statuses/toggle",{method:"POST",body:JSON.stringify({statusType:t,active:e})}),em=()=>o("/auto-response"),el=t=>o("/auto-response",{method:"PUT",body:JSON.stringify(t)}),eg=()=>o("/fomo/specialist"),eh=()=>o("/fomo/customer"),ey=t=>o("/auto-match/".concat(t),{method:"POST"}),ep=t=>o("/users/site/".concat(t)),eu=()=>o("/users/me/site-stats"),ef=t=>o("/users/site/".concat(t,"/track-message"),{method:"POST"}).catch(()=>{}),eS=t=>o("/tasks/".concat(t,"/stats")),eT=t=>o("/support/public",{method:"POST",body:JSON.stringify(t)}),eO=t=>o("/support",{method:"POST",body:JSON.stringify(t)}),eP=t=>o("/support".concat(t?"?"+new URLSearchParams(t):"")),eb=(t,e)=>o("/support/".concat(t,"/reply"),{method:"PATCH",body:JSON.stringify(e)}),eN=(t,e)=>o("/support/".concat(t,"/status"),{method:"PATCH",body:JSON.stringify({status:e})})}}]); uself.__REACT_LOADABLE_MANIFEST='{"app/tasks/TaskMapDynamic.tsx -> ./TaskMapClient":{"id":7797,"files":["static/css/93ad12acbd6e0cbd.css","static/chunks/e89fb3a8.7ade5d06ffa9957d.js","static/chunks/3542.bb9abe76cf68d932.js","static/chunks/7797.7f09b625f84a88e2.js"]},"components/Header.tsx -> ./SupportModal":{"id":6467,"files":["static/chunks/6467.06a1c0ca06759ccf.js"]}}'; globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-74f4bc92e0a7d443.js","static/chunks/87c73c54-cef51194b888ae6d.js","static/chunks/18-eb893d7dd9145409.js","static/chunks/main-app-9c48365085a14d1a.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-74f4bc92e0a7d443.js","static/chunks/framework-5c275e99bbb17aec.js","static/chunks/main-74a9f66f99121537.js","static/chunks/pages/_app-6e2d9c1f0f9c6a6f.js"],"/_error":["static/chunks/webpack-74f4bc92e0a7d443.js","static/chunks/framework-5c275e99bbb17aec.js","static/chunks/main-74a9f66f99121537.js","static/chunks/pages/_error-0cf0a41ff2efd71f.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"]; bb9abe76cf68d93206a1c0ca06759ccf7f09b625f84a88e27ade5d06ffa9957d93ad12acbd6e0cbd74f4bc92e0a7d443cef51194b888ae6deb893d7dd91454099c48365085a14d1a5c275e99bbb17aec74a9f66f991215376e2d9c1f0f9c6a6f0cf0a41ff2efd71f(()=>{"use strict";var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}},i=!0;try{e[n].call(a.exports,a,a.exports,r),i=!1}finally{i&&delete t[n]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(n){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[n,o,a];return}for(var l=1/0,i=0;i=a)&&Object.keys(r.O).every(e=>r.O[e](n[d]))?n.splice(d--,1):(u=!1,a{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o||"object"==typeof n&&n&&(4&o&&n.__esModule||16&o&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&o&&n;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,r.d(a,i),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"static/chunks/"+(9031===e?"e89fb3a8":e)+"."+({3542:"ec15a3607f89153b",6467:"a600a1d7b0465863",7797:"f44d1d20dafa108a",9031:"970022b1c726abe3"})[e]+".js",r.miniCssF=e=>"static/css/fb8df02a468380ac.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(n,o,a,i)=>{if(e[n])return void e[n].push(o);if(void 0!==a)for(var l,u,d=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),u&&document.head.appendChild(l)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={8068:0};r.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&({2012:1})[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=a=>{if(o.onerror=o.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),l=a&&a.target&&a.target.href||t,u=Error("Loading CSS chunk "+e+" failed.\n("+l+")");u.code="CSS_CHUNK_LOAD_FAILED",u.type=i,u.request=l,o.parentNode.removeChild(o),n(u)}},o.href=t,!function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:t,onload:r,onerror:n}=e;_N_E_STYLE_LOAD(0===t.indexOf(window.location.origin)?new URL(t).pathname:t).then(()=>null==r?void 0:r.call(e,{type:"load"}),()=>null==n?void 0:n.call(e,{}))}else document.head.appendChild(e)}(o)})(e,a,t,n)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}})(),(()=>{var e={8068:0,9950:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(2012|8068|9950)$/.test(t))e[t]=0;else{var a=new Promise((r,n)=>o=e[t]=[r,n]);n.push(o[2]=a);var i=r.p+r.u(t),l=Error();r.l(i,n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,l,u]=n,d=0;if(i.some(t=>0!==e[t])){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(u)var s=u(r)}for(t&&t(n);d ./TaskMapClient": { "id": 7797, "files": [ "static/css/fb8df02a468380ac.css", "static/chunks/e89fb3a8.970022b1c726abe3.js", "static/chunks/3542.ec15a3607f89153b.js", "static/chunks/7797.f44d1d20dafa108a.js" ] }, "components/Header.tsx -> ./SupportModal": { "id": 6467, "files": [ "static/chunks/6467.a600a1d7b0465863.js" ] } } uself.__REACT_LOADABLE_MANIFEST='{"app/tasks/TaskMapDynamic.tsx -> ./TaskMapClient":{"id":7797,"files":["static/css/fb8df02a468380ac.css","static/chunks/e89fb3a8.970022b1c726abe3.js","static/chunks/3542.ec15a3607f89153b.js","static/chunks/7797.f44d1d20dafa108a.js"]},"components/Header.tsx -> ./SupportModal":{"id":6467,"files":["static/chunks/6467.a600a1d7b0465863.js"]}}'; globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-9d06b1f3167e8ae0.js","static/chunks/87c73c54-24122e7b92478d00.js","static/chunks/18-90b700ea37b686a2.js","static/chunks/main-app-4faf785318adadbd.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-9d06b1f3167e8ae0.js","static/chunks/framework-811407f832a33072.js","static/chunks/main-0857aa8dd6c62449.js","static/chunks/pages/_app-50fa07b56b2d29ac.js"],"/_error":["static/chunks/webpack-9d06b1f3167e8ae0.js","static/chunks/framework-811407f832a33072.js","static/chunks/main-0857aa8dd6c62449.js","static/chunks/pages/_error-fed8688bdd23f211.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];