/opt/canhelp/apps/web/.next/cache/webpack/server-production
NameSizeModeActions
0.pack925145390644editdlrm
1.pack12673790644editdlrm
2.pack43735990644editdlrm
3.pack7451990644editdlrm
4.pack65204660644editdlrm
5.pack259717610644editdlrm
6.pack7518430644editdlrm
7.pack46388840644editdlrm
8.pack48452960644editdlrm
9.pack97020644editdlrm
10.pack27038500644editdlrm
11.pack1361530644editdlrm
12.pack24060644editdlrm
13.pack4277340644editdlrm
14.pack6358240644editdlrm
15.pack19769150644editdlrm
16.pack85740644editdlrm
17.pack24591570644editdlrm
18.pack119171890644editdlrm
19.pack768050644editdlrm
20.pack31443360644editdlrm
21.pack60115380644editdlrm
22.pack10241010644editdlrm
index.pack77214480644editdlrm
index.pack.old84399530644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/server-production/17.pack (2459157B)
wpc %webpack/lib/cache/PackFileCacheStrategyPackContentItems ResolverCachePlugin|normal|default|alias=|false|dependencyType=|esm|modules=[|0=|node_modules|]|fallback=|false|exportsFields=[|0=|exports|]|importsFields=[|0=|imports|]|conditionNames=[|0=|node|1=|import|]|descriptionFiles=[|0=|package.json|]|extensions=[|0=|.js|1=|.json|2=|.node|]|enforceExtensions=|false|symlinks=|true|mainFields=[|0=|main|]|mainFiles=[|0=|index|]|roots=[|]|fullySpecified=|true|preferRelative=|false|preferAbsolute=|false|restrictions=[|]|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/admin/page.tsxOResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/empty|client-only$=|next/dist/compiled/client-only/error|next/dist/compiled/server-only$=|next/dist/compiled/server-only/empty|next/dist/compiled/client-only$=|next/dist/compiled/client-only/error|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation.react-server|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/admin/page.tsxCompilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!/opt/canhelp/apps/web/src/app/admin/page.tsx|rscAResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/admin/page.tsx%Compilation/modules|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[7].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|ssr-FlagDependencyExportsPlugin|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[7].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|ssr<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[7].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|ssr|webpack-runtimewebpack/lib/cache/ResolverCachePlugin`_ResolverCachePluginCacheMisscontextpathrequestqueryfragmentmoduledirectoryfileinternalfullySpecifieddescriptionFilePathdescriptionFileDatadescriptionFileRootrelativePath  /opt/canhelp/apps/web/src/app/admin/page.tsx0/opt/canhelp/apps/web/package.jsonnameversionprivatescriptsdependenciesdevDependenciesweb0.1.0 devbuildstartlinttypechecknext dev --port 3000next buildnext startnext linttsc --noEmit @canhelp/shared@marsidev/react-turnstilebetter-authnanostoresnextreactreact-domsocket.io-clientzod*^1.5.0^1.2.7^1.2.0^15.1.6^19.0.0^4.8.1^3.24.1@types/node@types/react@types/react-domautoprefixerpostcsstailwindcsstypescript^22.10.7^19.0.6^19.0.3^10.4.20^8.5.1^3.4.17^5.7.3/opt/canhelp/apps/web./src/app/admin/page.tsxwebpack/lib/FileSystemInfoSnapshot@ `լyB `լyB /opt/canhelp/apps/web/src/app/admin/opt/canhelp/apps/web/src/app/opt/canhelp/apps/web/src/opt/canhelp/apps/opt/canhelp/opt/safeTimetimestamphash!eyBeyBd659fc12c42d40f9!qѬyBqѬyBac740e53cb3a163e@/opt/canhelp/apps/web/src/app/admin/package.json/opt/canhelp/apps/web/src/app/package.json/opt/canhelp/apps/web/src/package.json issuerissuerLayercompilerrscserver @ լyB@`/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/package.json/opt/canhelp/apps/web/opt/canhelp/apps/package.json/opt/canhelp/apps/web/opt/canhelp/package.json/opt/canhelp/apps/web/opt/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.js/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.mjs/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.ts/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.jsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.wasmwebpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"/opt/canhelp/apps/web/src/app/admin/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "/opt/canhelp/apps/web/src/app/admin/page.tsx", "default", ); exportsTypenamespace javascript/autoaliasmainFieldsconditionNames`$server-only$client-only$next/dist/compiled/server-only$next/dist/compiled/client-only$/opt/canhelp/node_modules/next/head.js/opt/canhelp/node_modules/next/image.js/opt/canhelp/node_modules/next/constants.js/opt/canhelp/node_modules/next/router.js/opt/canhelp/node_modules/next/dynamic.js/opt/canhelp/node_modules/next/script.js/opt/canhelp/node_modules/next/link.js/opt/canhelp/node_modules/next/form.js/opt/canhelp/node_modules/next/navigation.js/opt/canhelp/node_modules/next/headers.js/opt/canhelp/node_modules/next/og.js/opt/canhelp/node_modules/next/server.js/opt/canhelp/node_modules/next/document.js/opt/canhelp/node_modules/next/app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.tsqnext/dist/compiled/server-only/emptynext/dist/compiled/client-only/errornext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigation.react-servernext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/server/route-modules/app-page/vendored/rsc/reactnext/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-domnext/dist/compiled/react-dom/clientnext/dist/compiled/react-dom/server.nodenext/dist/compiled/react-dom/server.browsernext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/static.nodenext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-dom/static.edgenext/dist/compiled/react-server-dom-webpack/client.nodenext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-servernext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-staticnext/dist/client/dev/noop-turbopack-hmr/opt/canhelp/node_modules/next(mainreact-server...`cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependenciesmassetsassetsInfostrictexportsArgumenttopLevelDeclarationssnapshot webpack/lib/util/LazySet/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-loader/index.js/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js webpack/DefinePlugin_hash4028310fd7d9d8f7363ce1c9typeactionIdsclientRefsclientEntryTypeisClientRefclientdefaultauto  __webpack_exports__*default* ԬyB  Vwebpack/lib/dependencies/HarmonyCompatibilityDependency dwebpack/lib/dependencies/ConstDependency`=@ `Jwebpack/lib/dependencies/HarmonyExportHeaderDependency A" A#  webpack/lib/dependencies/HarmonyImportSideEffectDependencyreact-server-dom-webpack/server `Jwebpack/lib/dependencies/HarmonyExportExpressionDependency` webpack/lib/dependencies/HarmonyImportSpecifierDependencya registerClientReference A   b&    WssrX ,-. @ 08֬yB HjM J /* __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 } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; const TEMPLATE_VARS = { registration_success: [ 'userName', 'link', 'siteName', 'siteUrl' ], email_verification: [ 'userName', 'link', 'siteName', 'siteUrl' ], password_reset: [ 'userName', 'link', 'siteName', 'siteUrl' ], new_offer: [ 'userName', 'taskTitle', 'taskId', 'specialistName', 'price', 'link' ], new_task: [ 'userName', 'taskTitle', 'taskId', 'customerName', 'link' ], offer_accepted: [ 'userName', 'taskTitle', 'price', 'link' ], new_message: [ 'userName', 'senderName', 'preview', 'link' ], offer_declined: [ 'userName', 'taskTitle', 'taskId', 'link' ], offer_other_accepted: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_updated: [ 'userName', 'taskTitle', 'taskId', 'link' ], deadline_reminder: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_archived: [ 'userName', 'taskTitle', 'taskId', 'link' ], referral_reward: [ 'userName', 'days', 'planName', 'link' ], plan_activated: [ 'userName', 'planName', 'price', 'expiresAt', 'link' ], plan_upgraded: [ 'userName', 'oldPlanName', 'newPlanName', 'charged', 'expiresAt', 'link' ], plan_downgrade_scheduled: [ 'userName', 'currentPlanName', 'newPlanName', 'scheduledDate', 'link' ], plan_downgrade_applied: [ 'userName', 'planName', 'link' ], plan_renewal_reminder: [ 'userName', 'planName', 'amount', 'expiresAt', 'link' ], plan_insufficient_funds: [ 'userName', 'currentPlanName', 'requiredAmount', 'currentBalance', 'expiresAt', 'topUpLink' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); function getCatLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.namesEn || row.namesEl || row.slug || '' : locale === 'ru' ? row.namesRu || row.namesEl || row.slug || '' : row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.nameEn || row.nameEl || row.slug || '' : locale === 'ru' ? row.nameRu || row.nameEl || row.slug || '' : row.nameEl || row.nameEn || row.slug || ''; } function AdminCatPicker({ catRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx("span", { className: "text-sm leading-none shrink-0", children: parent.icon }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker({ locRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-blue-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'Подтвердите ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'Добро пожаловать в {{siteName}}!', body: '' }, password_reset: { subject: 'Восстановление пароля — {{siteName}}', body: '' }, new_offer: { subject: 'Новое предложение по вашей задаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'Новая задача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше предложение принято: {{taskTitle}}', body: '

Ваше предложение принято! 🎉

Привет, {{userName}}!

Заказчик принял ваше предложение на выполнение задачи:

{{taskTitle}}

Сумма: {{price}}€

Открыть чат →' }, new_message: { subject: 'Новое сообщение от {{senderName}}', body: '

Новое сообщение

Привет, {{userName}}!

Вам написал(а) {{senderName}}:

"{{preview}}"

Ответить →' }, offer_declined: { subject: 'Ваше предложение отклонено: {{taskTitle}}', body: '

Ваше предложение отклонено

Привет, {{userName}}!

К сожалению, заказчик отклонил ваше предложение на:

{{taskTitle}}

Найти другие заказы →' }, offer_other_accepted: { subject: 'Выбран другой исполнитель: {{taskTitle}}', body: '

Выбран другой исполнитель

Привет, {{userName}}!

Заказчик выбрал другого исполнителя для задания:

{{taskTitle}}

Найти другие заказы →' }, task_updated: { subject: 'Задание обновлено: {{taskTitle}}', body: '

Задание обновлено

Привет, {{userName}}!

Заказчик обновил детали задания:

{{taskTitle}}

Смотреть заказ →' }, deadline_reminder: { subject: 'Задание истекает завтра: {{taskTitle}}', body: '

Напоминание о дедлайне

Привет, {{userName}}!

Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.

{{taskTitle}}

Редактировать задание →' }, task_archived: { subject: 'Задание снято с публикации: {{taskTitle}}', body: '

Задание переведено в черновик

Привет, {{userName}}!

Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.

{{taskTitle}}

Редактировать задание →' }, referral_reward: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' }, referral_reward_el: { subject: 'Λάβατε ανταμοιβή παραπομπής — {{siteName}}', body: '

Λάβατε ανταμοιβή παραπομπής! 🎁

Γεια {{userName}},

Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν {{days}} ημέρες πρόσβασης στο πλάνο {{planName}}!

+{{days}} ημέρες — {{planName}}

Δες τον λογαριασμό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, customerPlanId: '', customerDays: '30', specialistPlanId: '', specialistDays: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitle: '', siteDescription: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && session.user?.role === 'admin'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'admin') router.push('/'); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ setActivityLog(d.data); setActivityTotal(d.total); if (d.eventTypes?.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ setMailLog(d.data); setMailTotal(d.total); if (d.eventTypes?.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ setNotifLogs(d.data); setNotifLogsTotal(d.total); if (d.notifTypes?.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: editUser.languages ?? [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: editUser.showContactInfo ?? false, notifyNewTasks: editUser.notifyNewTasks ?? false, notifMessages: editUser.notifMessages ?? true, skills: editUser.skills ?? [], siteSettings: editUser.siteSettings ?? {} }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: card.skills ?? [], categories: card.categories ?? [], locations: card.locations ?? [], isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm(`${t('admin.tasks.delete.confirm')}\n"${title}"`)) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>(row.task?.id || row.id) !== id)); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId ?? null, slug: '', nameEl: '', nameEn: '', nameRu: '', order: 0, isActive: true }); } function openEditLoc(loc) { setLocForm({ id: loc.id, parentId: loc.parentId ?? null, slug: loc.slug, nameEl: loc.nameEl ?? loc.names?.el ?? '', nameEn: loc.nameEn ?? loc.names?.en ?? '', nameRu: loc.nameRu ?? loc.names?.ru ?? '', order: loc.order ?? 0, isActive: loc.isActive ?? true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm(`${t('admin.loc.delete.confirm')}\n"${name}"`)) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddCat(parentId) { setCatForm({ parentId: parentId ?? null, slug: '', icon: '📦', namesEl: '', namesEn: '', namesRu: '', order: 0, isActive: true }); } function openEditCat(cat) { setCatForm({ id: cat.id, parentId: cat.parentId ?? null, slug: cat.slug, icon: cat.icon, namesEl: cat.namesEl ?? cat.names?.el ?? '', namesEn: cat.namesEn ?? cat.names?.en ?? '', namesRu: cat.namesRu ?? cat.names?.ru ?? '', order: cat.order ?? 0, isActive: cat.isActive ?? true }); } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm(`${t('admin.cat.delete.confirm')}\n"${name}"`)) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } function openAddPlan() { setPlanForm({ name: '', description: '', role: 'specialist', tier: 'free', price: '0', oldPrice: '', currency: 'EUR', maxTasks: '', maxOffers: '', maxCards: '', maxMessagesPerDay: '', maxOrdersPerDay: '', maxSkills: '', maxProfiles: '', maxPortfolioItems: '', durationDays: '', searchBoost: 0, offersMultiplier: '1.00', features: '', isDefault: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { setPlanForm({ id: plan.id, name: plan.name, description: plan.description ?? '', role: plan.role ?? 'specialist', tier: plan.tier ?? 'free', price: plan.price ?? '0', oldPrice: plan.oldPrice ?? '', currency: plan.currency ?? 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', maxProfiles: plan.maxProfiles != null ? String(plan.maxProfiles) : '', maxPortfolioItems: plan.maxPortfolioItems != null ? String(plan.maxPortfolioItems) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: plan.searchBoost ?? 0, offersMultiplier: plan.offersMultiplier ?? '1.00', features: (plan.features ?? []).join('\n'), isDefault: plan.isDefault ?? false, isActive: plan.isActive ?? true, order: plan.order ?? 0, notifyNewTasks: plan.notifyNewTasks ?? false, canContactFreePlan: plan.canContactFreePlan ?? false, canContactProPlan: plan.canContactProPlan ?? true, canContactAll: plan.canContactAll ?? false, canShowContactInfo: plan.canShowContactInfo ?? false, canViewPhone: plan.canViewPhone ?? false, canUploadVideo: plan.canUploadVideo ?? false, hasFavorites: plan.hasFavorites ?? false, hasGoogleCalendar: plan.hasGoogleCalendar ?? false, hasVerifiedBadge: plan.hasVerifiedBadge ?? false, highlightedReviews: plan.highlightedReviews ?? false, hasPersonalSite: plan.hasPersonalSite ?? false, hasCanHelpNowStatus: plan.hasCanHelpNowStatus ?? false, hasNeedHelpStatus: plan.hasNeedHelpStatus ?? false, hasAutoResponse: plan.hasAutoResponse ?? false, hasAutoMatch: plan.hasAutoMatch ?? false, receiveInstantDispatchFree: plan.receiveInstantDispatchFree ?? false, receiveInstantDispatchPro: plan.receiveInstantDispatchPro ?? false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, maxProfiles: planForm.maxProfiles ? Number(planForm.maxProfiles) : null, maxPortfolioItems: planForm.maxPortfolioItems ? Number(planForm.maxPortfolioItems) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm(`Удалить тариф "${name}"?`)) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ setGeneralForm({ siteName: kv['general.siteName'] ?? 'CanHelp', siteUrl: kv['general.siteUrl'] ?? '', contactEmail: kv['general.contactEmail'] ?? '', supportPhone: kv['general.supportPhone'] ?? '' }); setSmtpForm({ host: kv['smtp.host'] ?? '', port: kv['smtp.port'] ?? '587', username: kv['smtp.username'] ?? '', password: kv['smtp.password'] ?? '', fromName: kv['smtp.fromName'] ?? 'CanHelp', fromEmail: kv['smtp.fromEmail'] ?? '', encryption: kv['smtp.encryption'] ?? 'tls' }); setEPayForm({ merchantId: kv['payment.epay.merchantId'] ?? '', apiUser: kv['payment.epay.apiUser'] ?? '', apiPassword: kv['payment.epay.apiPassword'] ?? '', environment: kv['payment.epay.environment'] ?? 'test', confirmationUrl: kv['payment.epay.confirmationUrl'] ?? '', cancelUrl: kv['payment.epay.cancelUrl'] ?? '', enabled: kv['payment.epay.enabled'] === 'true' }); setReferralForm({ enabled: kv['referral_enabled'] === 'true', customerPlanId: kv['referral_customer_plan_id'] ?? kv['referral_plan_id'] ?? '', customerDays: kv['referral_customer_days'] ?? kv['referral_days'] ?? '30', specialistPlanId: kv['referral_specialist_plan_id'] ?? kv['referral_plan_id'] ?? '', specialistDays: kv['referral_specialist_days'] ?? kv['referral_days'] ?? '30' }); setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: kv['seo.headScripts'] ?? '', siteTitle: kv['seo.siteTitle'] ?? '', siteDescription: kv['seo.siteDescription'] ?? '' }); setSocialForm({ telegram: kv['social.telegram'] ?? '', instagram: kv['social.instagram'] ?? '', facebook: kv['social.facebook'] ?? '', twitter: kv['social.twitter'] ?? '', youtube: kv['social.youtube'] ?? '', tiktok: kv['social.tiktok'] ?? '', whatsapp: kv['social.whatsapp'] ?? '', viber: kv['social.viber'] ?? '' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = `${key}_${templateLocale}`; const current = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // Сохраняем исходный язык в БД (если ещё не сохранён) await api.updateAdminEmailTemplate(localeKey, current); // Переводим на остальные языки const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // Обновляем state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next[`${key}_${loc}`] = tpl; } return next; }); // Сохраняем каждый перевод в БД await Promise.all(Object.entries(results).map(([loc, tpl])=>api.updateAdminEmailTemplate(`${key}_${loc}`, tpl))); } catch {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = `${key}_${templateLocale}`; setTemplateSaving(true); try { await api.updateAdminEmailTemplate(localeKey, notifTemplates[localeKey] ?? { subject: '', body: '' }); setEditingTemplate(null); } catch {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_customer_plan_id': referralForm.customerPlanId, 'referral_customer_days': referralForm.customerDays, 'referral_specialist_plan_id': referralForm.specialistPlanId, 'referral_specialist_days': referralForm.specialistDays }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle': seoForm.siteTitle, 'seo.siteDescription': seoForm.siteDescription }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch {} finally{ setSocialSaving(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; return locale === 'en' ? cat.namesEn || cat.namesEl : locale === 'ru' ? cat.namesRu || cat.namesEl : cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; return locale === 'en' ? loc.nameEn || loc.nameEl : locale === 'ru' ? loc.nameRu || loc.nameEl : loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }) }, { key: 'users', label: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" }) ] }) }, { key: 'tasks', label: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" }) }) }, { key: 'reports', label: t('admin.tab.reports'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" }) }) }, { key: 'locations', label: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Баланс'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" }) ] }) }, { key: 'backup', label: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }) } ]; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-blue-100 text-blue-700', completed: 'bg-gray-100 text-gray-600', cancelled: 'bg-red-100 text-red-600', draft: 'bg-yellow-100 text-yellow-700' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { spam: 'bg-orange-100 text-orange-700', inappropriate: 'bg-red-100 text-red-700', fraud: 'bg-purple-100 text-purple-700', duplicate: 'bg-blue-100 text-blue-700', other: 'bg-gray-100 text-gray-600' }; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-blue-600 transition", 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: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: `shrink-0 transition-all duration-200 ${sidebarCollapsed ? 'w-12' : 'w-52'}`, children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'Развернуть меню' : 'Свернуть меню', className: "w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition", children: /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 transition-transform duration-200 ${sidebarCollapsed ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map(({ key, label, icon })=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: `w-full flex items-center py-3 text-sm font-medium text-left transition ${tab === key ? 'bg-blue-50 text-blue-700 border-r-2 border-blue-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'} ${sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsx("span", { children: label }) ] }, key)) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats?.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }), color: 'text-blue-600' }, { label: t('admin.stats.specialists'), value: stats?.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats?.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }), color: 'text-green-600' }, { label: t('admin.stats.offers'), value: stats?.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.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" }) }), color: 'text-orange-500' }, { label: t('admin.stats.reviews'), value: stats?.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" }) }), color: 'text-yellow-500' } ].map(({ label, value, icon, color })=>/*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: `mb-2 ${color}`, children: icon }), /*#__PURE__*/ _jsx("div", { className: `text-3xl font-bold ${color}`, children: value ?? '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label)) }), stats?.tasksByDay && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-blue-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), stats?.tasksByStatus && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-blue-50', bar: 'bg-blue-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map(({ status, count: c })=>{ const meta = statusMeta[status] ?? { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-3 px-3 py-2 rounded-lg ${meta.bg}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: `h-full rounded-full ${meta.bar} transition-all`, style: { width: `${pct}%` } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number(stats.totalCostUsd ?? 0).toFixed(4) ] }) ] }) ] }), stats.tokensByMonth?.length > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('admin.users.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "customer", children: t('profile.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('profile.role.specialist') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: "Тариф" }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-600'}`, children: t(`profile.role.${u.role}`) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? planRows.find((p)=>p.id === u.planId)?.name ?? /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "…" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'}`, children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: `text-xs px-3 py-1 rounded-lg font-medium ${u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'}`, children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id)) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('admin.balance.filter.user_id', 'Фильтр по userId'), className: "flex-1 min-w-72 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'Все операции') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Пополнение') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Списание за тариф') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Пополнение админом') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Корректировка') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Операция') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Сумма') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Баланс') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Описание') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Дата') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'Записей пока нет') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Пополнение') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Списание за тариф') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Пополнение админом') : t('admin.balance.kind.admin_adjustment', 'Корректировка'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'}`, children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: `px-4 py-3 font-semibold ${isCredit ? 'text-emerald-700' : 'text-rose-700'}`, children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('admin.tasks.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t(`task.status.${s}`, s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "hover:text-blue-600 truncate block", target: "_blank", children: task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: customer?.name ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[task.status] ?? 'bg-gray-100 text-gray-600'}`, children: t(`task.status.${task.status}`, task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? `${formatPrice(task.budget)}€` : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx("input", { value: catForm.icon, onChange: (e)=>setCatForm((f)=>f && { ...f, icon: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "\uD83D\uDCE6" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>/*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reportStatusColors[r.status] ?? 'bg-gray-100 text-gray-500'}`, children: r.status }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reasonColors[r.reason] ?? 'bg-gray-100 text-gray-600'}`, children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? `/tasks/${r.targetId}` : `/users/${r.targetId}`, className: "text-blue-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", r.targetId?.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.id, 'reviewed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.id, 'dismissed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.reports.dismiss') }) ] }) ] }) }, r.id)), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map(({ key, label })=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: `px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'}`, children: label }, key)) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>/*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'}`, children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? `${log.fromLocale} → ${log.toLocale}` : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: log.inputTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: log.outputTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: log.totalTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: log.durationMs ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: log.error ?? '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id)) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t(`admin.event.${ev.replace(/\./g, '_')}`, ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof details?.provider === 'string' ? details.provider : '—'; const recipient = typeof details?.to === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof details?.subject === 'string' ? details.subject : ''; const error = typeof details?.error === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t(`admin.event.${entry.event.replace(/\./g, '_')}`, entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>/*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: n.recipientName ?? n.recipientEmail ?? n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id)) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-blue-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-blue-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-blue-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.oldPrice ?? '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.role') }), /*#__PURE__*/ _jsxs("select", { value: planForm.role, onChange: (e)=>setPlanForm({ ...planForm, role: e.target.value }), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "customer", children: t('admin.plans.form.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('admin.plans.form.role.specialist') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_profiles') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxProfiles, onChange: (e)=>setPlanForm({ ...planForm, maxProfiles: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_portfolio') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxPortfolioItems, onChange: (e)=>setPlanForm({ ...planForm, maxPortfolioItems: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map(([key, label])=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map(([key, label])=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.name, className: "bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((plan)=>/*#__PURE__*/ _jsxs("div", { className: `flex items-start gap-4 px-4 py-4 ${!plan.isActive ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-blue-100 text-blue-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-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, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.plans.notify_tasks') ] }) ] }), (plan.features ?? []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id)) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit", children: [ 'general', 'smtp', 'notifications', 'payment', 'referral', 'seo', 'socials' ].map((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: `px-4 py-2 rounded-lg text-sm font-medium transition ${settingsTab === st ? 'bg-blue-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'}`, children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), 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", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), 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", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), 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", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), 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", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), 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", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), 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", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), 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", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), 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", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult(`✓ Отправлено на ${res.to}`); } catch (e) { setTestEmailResult(`✗ Ошибка: ${e.message}`); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, className: "w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition", children: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", 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: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: `text-sm text-center font-medium ${testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'}`, children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0", children: "PB" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "Греческий платёжный шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${ePayForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${ePayForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('admin.settings.merchant_id'), 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", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", 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: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", 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: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", 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: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", 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", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-2 mb-4 p-3 bg-blue-50 border border-blue-100 rounded-xl text-sm text-blue-700", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = `{{${name}}}`; return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-blue-100 text-blue-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'registration_success', label: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'password_reset', label: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }) }, { key: 'new_offer', label: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-purple-500 shrink-0", 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.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) }) }, { key: 'new_task', label: t('admin.notif.new_task'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-indigo-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'offer_accepted', label: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-pink-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'offer_declined', label: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'offer_other_accepted', label: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'task_updated', label: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }, { key: 'deadline_reminder', label: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'task_archived', label: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6" }) }) }, { key: 'referral_reward', label: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-emerald-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'plan_upgraded', label: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'plan_downgrade_applied', label: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" }) }) }, { key: 'plan_insufficient_funds', label: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) } ].map(({ key, label, icon })=>{ const localeKey = `${key}_${templateLocale}`; const tmpl = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; const isEditing = editingTemplate === key; const templateVars = TEMPLATE_VARS[key] ?? []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: `text-gray-400 transition-transform ${isEditing ? 'rotate-90' : ''}`, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${templateLocale === loc ? 'bg-blue-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'}`, children: loc === 'el' ? 'Ελληνικά' : loc === 'en' ? 'English' : 'Русский' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, subject: e.target.value } })), 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-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, body: e.target.value } })), 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 font-mono resize-y", placeholder: "

Уважаемый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = `{{${name}}}`; return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${referralForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${referralForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.customer_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.customerPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, customerPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'customer').map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.customerDays, onChange: (e)=>setReferralForm((f)=>({ ...f, customerDays: e.target.value })), 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("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.specialist_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.specialistPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'specialist').map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.specialistDays, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistDays: e.target.value })), 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("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" }) }) }, { key: 'instagram', label: 'Instagram', placeholder: 'https://instagram.com/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" }) }) }, { key: 'facebook', label: 'Facebook', placeholder: 'https://facebook.com/yourpage', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" }) }) }, { key: 'twitter', label: 'X (Twitter)', placeholder: 'https://x.com/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }) }, { key: 'youtube', label: 'YouTube', placeholder: 'https://youtube.com/@yourchannel', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" }) }) }, { key: 'tiktok', label: 'TikTok', placeholder: 'https://tiktok.com/@yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z" }) }) }, { key: 'whatsapp', label: 'WhatsApp', placeholder: 'https://wa.me/30xxxxxxxxxx', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z" }) }) }, { key: 'viber', label: 'Viber', placeholder: 'viber://chat?number=30xxxxxxxxxx', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z" }) }) } ].map(({ key, label, placeholder, icon })=>/*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: `${socialForm[key] ? 'text-blue-600' : 'text-gray-300'}`, children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "не заполнено" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${socialForm[key] ? 'border-blue-300 bg-blue-50/30' : 'border-gray-300'}` }) ] }, key)), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.indexingEnabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm.siteTitle, onChange: (e)=>setSeoForm((f)=>({ ...f, siteTitle: e.target.value })), 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", placeholder: "CanHelp — Βρες ειδικό για κάθε δουλειά" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm.siteDescription, onChange: (e)=>setSeoForm((f)=>({ ...f, siteDescription: e.target.value })), 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", placeholder: "Η ελληνική πλατφόρμα για online ανάθεση εργασιών..." }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: `${backupMsgError ? 'bg-red-50 border-red-200 text-red-700' : 'bg-green-50 border-green-200 text-green-700'} border rounded-lg px-4 py-2 text-sm flex items-center justify-between`, children: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: `${backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700'} ml-4`, children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch {} setBackupAutoSaving(false); }, className: `relative w-11 h-6 rounded-full transition-colors ${backupAutoEnabled ? 'bg-blue-600' : 'bg-gray-300'} ${backupAutoSaving ? 'opacity-50' : ''}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ${backupAutoEnabled ? 'translate-x-5' : 'translate-x-0'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/export`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `backup_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, className: "bg-blue-600 hover:bg-blue-700 text-white text-sm px-4 py-2 rounded-lg font-medium disabled:opacity-50 flex items-center gap-2", 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _jsxs("label", { className: `bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm px-4 py-2 rounded-lg font-medium cursor-pointer flex items-center gap-2 ${backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''}`, 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/import`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-blue-600 hover:text-blue-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 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" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/export/${tbl}`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `${tbl}_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.message || 'Error'); } }, className: "text-blue-600 hover:text-blue-800 font-medium text-xs px-2 py-1 rounded border border-blue-200 hover:bg-blue-50", children: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _jsxs("label", { className: "text-gray-600 hover:text-gray-800 font-medium text-xs px-2 py-1 rounded border border-gray-200 hover:bg-gray-100 cursor-pointer", children: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/import/${tbl}`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _jsx("nav", { className: "w-44 flex-shrink-0 border-r border-gray-100 py-3 space-y-0.5 px-2", children: [ { id: 'profile', label: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: `w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ${editUserTab === item.id ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50'}`, children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: editUser.firstName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), 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('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: editUser.lastName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), 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('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: editUser.phone ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), 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('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: editUser.bio ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.target.value })), rows: 5, 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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _jsx("div", { className: "w-full border border-gray-200 bg-gray-50 rounded-lg px-3 py-2 text-sm text-gray-600 select-all", children: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", 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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z", clipRule: "evenodd" }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm font-medium ${editUser.emailVerified ? 'text-green-700' : 'text-red-600'}`, children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "customer", children: t('admin.user_edit.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('admin.user_edit.role.specialist') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: editUser.planId ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: editUser.locale ?? 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "Ελληνικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "Русский" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'ru' ].map((lang)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (editUser.languages ?? []).includes(lang), onChange: (e)=>{ const langs = editUser.languages ?? []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'Ελληνικά' : lang === 'en' ? 'English' : 'Русский' }) ] }, lang)) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('topup'), className: "flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-sm font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('withdraw'), className: "flex items-center gap-1.5 px-4 py-2 bg-rose-600 hover:bg-rose-700 text-white rounded-lg text-sm font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.showContactInfo ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.notifyNewTasks ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.notifMessages ?? true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 items-center border border-gray-300 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-blue-400", children: [ /*#__PURE__*/ _jsx("span", { className: "px-3 py-2 text-sm text-gray-400 bg-gray-50 border-r border-gray-300 flex-shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: editUser.personalSiteSlug ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: `/site/${editUser.personalSiteSlug}`, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 px-3 py-2 border border-gray-300 rounded-lg text-sm text-blue-600 hover:bg-blue-50 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, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (editUser.siteSettings ?? {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, [item.key]: e.target.checked } })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }, item.key)) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (editUser.siteSettings ?? {}).siteTheme ?? 'dark', onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, siteTheme: e.target.value } })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: (editUser.skills ?? []).map((s)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>({ ...u, skills: (u.skills ?? []).filter((x)=>x !== s) })), className: "text-blue-400 hover:text-blue-700 leading-none", 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.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); } }, placeholder: t('admin.user_edit.skill_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", { onClick: ()=>{ const val = skillInput.trim(); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); }, className: "px-3 py-2 bg-blue-600 text-white rounded-lg text-sm hover:bg-blue-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: card.title ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('admin.user_edit.card_title'), 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__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.active') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: card.description ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('admin.user_edit.card_description'), 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", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.skills ?? []).map((s)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: (c.skills ?? []).filter((x)=>x !== s) } : c)), className: "text-blue-400 hover:text-blue-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: cardSkillInputs[card.id] ?? '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && (cardSkillInputs[card.id] ?? '').trim()) { e.preventDefault(); const val = (cardSkillInputs[card.id] ?? '').trim().replace(/,$/, ''); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('admin.user_edit.skill_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = (cardSkillInputs[card.id] ?? '').trim(); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-blue-600 text-white rounded-lg text-xs hover:bg-blue-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.categories ?? []).map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-purple-50 text-purple-700 px-2 py-0.5 rounded-full", children: [ getCatLabel(catRows.find((c)=>c.slug === slug) ?? { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: (c.categories ?? []).filter((x)=>x !== slug) } : c)), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: card.categories ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: [ ...c.categories ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.locations ?? []).map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full", children: [ getLocLabel(locRows.find((l)=>l.slug === slug) ?? { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: (c.locations ?? []).filter((x)=>x !== slug) } : c)), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: card.locations ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: [ ...c.locations ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.id], className: "px-4 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-medium disabled:opacity-50", children: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id)) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-blue-600 hover:bg-blue-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ${balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'}`, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: `text-base font-semibold ${balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: `block text-sm font-medium mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? editUser.topUpAmount ?? '' : editUser.withdrawAmount ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400'}` }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: `block text-sm font-medium mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? editUser.topUpDescription ?? '' : editUser.withdrawDescription ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400'}` }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: `flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ${balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'}`, children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } function LocTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!loc.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" }) }) : /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((cat)=>{ const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!cat.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "text-lg w-7 text-center", children: cat.icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || cat.names?.en }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, cat.id); }) }); } function Pagination({ page, total, limit, onChange, totalLabel }) { const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }), labelKey: 'admin.event.user_login', color: 'bg-blue-50 text-blue-700 border-blue-100' }, 'user.register': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" }) }), labelKey: 'admin.event.user_register', color: 'bg-green-50 text-green-700 border-green-100' }, 'admin.user.deactivate': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "4.93", y1: "4.93", x2: "19.07", y2: "19.07" }) ] }), labelKey: 'admin.event.admin_user_deactivate', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.user.activate': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }), labelKey: 'admin.event.admin_user_activate', color: 'bg-emerald-50 text-emerald-700 border-emerald-100' }, 'admin.user.role_changed': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" }) }), labelKey: 'admin.event.admin_user_role_changed', color: 'bg-purple-50 text-purple-700 border-purple-100' }, 'admin.task.cancelled': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }), labelKey: 'admin.event.admin_task_cancelled', color: 'bg-orange-50 text-orange-700 border-orange-100' }, 'admin.task.deleted': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2" }) ] }), labelKey: 'admin.event.admin_task_deleted', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.report.reviewed': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }), labelKey: 'admin.event.admin_report_reviewed', color: 'bg-teal-50 text-teal-700 border-teal-100' }, 'admin.report.dismissed': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), labelKey: 'admin.event.admin_report_dismissed', color: 'bg-gray-50 text-gray-600 border-gray-200' }, 'task.created': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }), labelKey: 'admin.event.task_created', color: 'bg-indigo-50 text-indigo-700 border-indigo-100' } }; function ActivityLogRow({ entry, dateLocale, onFilterUser, t }) { const meta = EVENT_META[entry.event] ?? { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }), labelKey: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _jsxs("span", { className: `shrink-0 mt-0.5 px-2.5 py-1 rounded-lg border text-xs font-semibold flex items-center gap-1.5 ${meta.color}`, children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-blue-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map(([k, v])=>/*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k)) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart({ series, dateLocale = 'en-US' }) { // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>map[m] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: `0 0 ${W} ${H + 14}`, className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, `bar-${mi}-${si}`); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? ` ${yr}` : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, `xl-${mi}`); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = `M ${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`; for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += ` C ${cpx} ${pts[i - 1][1].toFixed(1)} ${cpx} ${pts[i][1].toFixed(1)} ${pts[i][0].toFixed(1)} ${pts[i][1].toFixed(1)}`; } return d; } function fmtYLabel(v) { if (v >= 1000000) return `${+(v / 1000000).toFixed(1)}M`; if (v >= 1000) return `${Math.round(v / 1000)}K`; return String(v); } function AdminAreaChart({ series, days: daysProp }) { const days = daysProp ?? getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>map[d] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return `${line} L ${lastX} ${chartH.toFixed(1)} L ${padL.toFixed(1)} ${chartH.toFixed(1)} Z`; } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: `0 0 ${W} ${H + 12}`, className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), xTicks.map(({ i })=>{ const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, `vg-${i}`); }), xTicks.map(({ i, label })=>/*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i)), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, `fill-${si}`)), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, `line-${si}`)), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, `dot-${si}`); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } ` kl m*  no  `$qrtnext/dist/compiled/server-onlytuvwxyz{|}~next/dist/compiled/server-only/indexnext/dist/compiled/client-only/indexnext/dist/api/navigationnext/dist/server/route-modules/app-page/vendored/ssr/reactnext/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-domnext/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-clientnext/dist/compiled/react-server-dom-webpack/server.nodenext/dist/compiled/react-server-dom-webpack/static.node  /opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.jswebpack/DefinePlugin process.env.NEXT_PUBLIC_API_URL"https://api.canhelp.gr"1b8f472a63b0fd54     `getCatLabelgetLocLabelAdminCatPickerAdminLocPickerLocTreeCatTreePaginationparseLogDetailsActivityLogRowAdminMonthChartgetLast30DayssmoothPathfmtYLabelAdminAreaChartTEMPLATE_VARSTEMPLATE_HINT_VARSAdminPageEVENT_METAMONTH_NAMES ԬyB  ` d `=@ a=@ A `4 A `, A ` A< `( A=j `- Ak `! A `$ A `3 A `/ AGP4  A8P4  @@ A\{ @`Q@`p0 A @`QA A\{ @2`Y@2`x0 A @2`YA2 A#$ @`mA0 A $7$ @`mA A)6H6 @`uA0 AL6c6 @`uA @react/jsx-runtime a=@ `4next/navigation `,next/link `@/lib/auth `(@/context/locale `-@/lib/api `! `$ @/lib/formatName `3 @/lib/taskLocale `/ useState A    l @`@`$  A    @` @`(  A    @`0@`8 useRef A!   @`@` useEffect A`i   @`7@`@ jsxs_jsxs A   @`@`  A(-   @`@` jsx_jsx A   @`"@`&  A    @`0@`4  A   @`"@`&  A   @`"@`&  A,0   @`0@`4  AJO   @`"@`'  ACG   @`"@`&  A   @`0@`4  AUZ   @`-@`2  A   @`.@`3  A!"%"   @`D@`H  A3#7#   @`6@`:  AL$P$   @`O@`S  A/&3&   @`D@`H  A$()(   @`h@`m  A**   @ `:@ `>  A{++   @`:@`>  A--   11 @`@`$  A--  -- @ ` @ `(  A..  )) @!`,@!`4  A1.7.  %% @"`@"`  Av..  !! @#`7@#`@  A00  nn @0`@0`  A=1B1  jj @4`@4`  A22  ff @9`"@9`'  A<4@4  bb @@`*@@`.  A~55  ^^ @E`*@E`.  A66  ZZ @L`"@L`&  Ak7o7  VV @P`"@P`&  A88  RR @V`0@V`4 {| A99  NN @^`"@^`'  A::  JJ @a`"@a`& }~ A;;  FF @c`0@c`4 op A??  BB @s`-@s`2 kl AL@Q@  >> @u`.@u`3 qr ACC  :: @`6@`: mn ADD  66 @`D@`H ij A=FAF  22 @`6@`: ef AUGYG  .. @`P@`T ab A8I UV A}NN   @`:@`>webpack/lib/dependencies/HarmonyExportSpecifierDependency@ @@ useRouter AqPzP    @`@` useSession APP   @`)@`3 useLocale APP   @`@`#  APP   @`@`"  A=QEQ   @`4@`< )( AQQ   @`7@`@  AR R   @`@`&   A>RFR   @`@`&    ArRzR   @`&@`.  ARR   @`(@`0  ARR   @` @`(  A SS   @`*@`2  A@SHS   @`&@`.  AySS   @`@`&  ASS   @`&@`.  ASS   @`(@`0  ATT   @` @`(  AGTOT   @`*@`2  ATT  || @`*@`2  ATT  xx @`"@`*  ATT  tt @`*@`2  A/U7U  pp @`,@`4  AgUoU  ll @`@`$  AUU  hh @`$@`,  AUU  dd @`&@`.  AV V  `` @`*@`2  ATV\V  \\ @`.@`6  AVV  XX @`,@`4  AVV  TT @`.@`6  AWW  PP @`0@`8  AHWPW  LL @`4@`<  AWW  HH @`0@`8  AWW  }DD @`8@`@  A XX  y@@ @`"@`*  AAXIX  u<< @`&@`.  ArXzX  q88 @`$@`,  AXX  m44 @`&@`.  AXX  i00 @`,@`4  AYY  e,, @`(@`0  ASY[Y  a(( @`0@`8  AYY  ]$$ @`(@`0  AYY  Y   @`&@`.  A(Z0Z  U @`.@`6 ~} AeZmZ  Q @`0@`8 zy AZZ  M @`.@`6 vu AZZ  I @`0@`8 rq A"[*[  E   @`6@`> nm Ab[j[  A @`2@`: ji A[[  = @`*@`2 fe A[[  9 @`&@`. ba A=\E\  5 @`*@`2 ^] Aw\\  1 @`,@`4 ZY A\\  - @`*@`2 VU A\\  ) @`.@`6 RQ A!])]  % @`*@`2 NM AY]a]  ! @`*@`2 JI A]]   @`0@`8 FE A]]   @`$@`, BA A&^.^   @`0@`8 >= Ag^o^   @`0@`8 :9 A^^    @`*@`2 65 A^^    @`,@`4 21 A_#_   @`(@`0 .- AW___   @`.@`6 *) A__   @`<@`D &% A__   @`2@`: "! A`"`   @`(@`0  AX```   @`0@`8  A``   @ `0@ `8  A``   @ `$@ `,  Aaa   @ `$@ `,   A?aGa   @ `(@ `0    Aaa   @`"@`*  Aaa   @`"@`*  Aaa   @`&@`.  A$b,b   @`*@`2  Ambub   @`"@`*  Abb   @`"@`*  Abb   @`&@`.  Acc   @`*@`2  A]cec   @`*@`2  Acc   @`*@`2  ABdJd  || @ `.@ `6  Add  xx @!`,@!`4  Add  tt @"`$@"`,  Aee  pp @+`(@+`0  Aee  ll @,`&@,`.  A ff  hh @-`4@-`<  AOfWf  dd @.`2@.`:  Aff  `` @/`0@/`8  AŠʊ  \\ @q`2@q`:  A   XX @r`0@r`8  ABJ  TT @s`0@s`8  A  PP @t`:@t`B  A‹ʋ  LL @u`$@u`,  A  HH @~`(@~`0  A  }DD @`&@`.  A'  y@@ @`,@`4  A  u<< @`0@`8  A,4  q88 @`.@`6  A_g  m44 @`"@`*  A#+  i00 @`&@`.  AX`  e,, @`$@`,  A  a(( @`(@`0  Ay  ]$$ @`,@`4  A  Y   @`*@`2  A   U @`6@`> ~} ANV  Q @`4@`< zy A  M @`,@`4 vu Aӑۑ  I @`:@`B rq A"  E   @`6@`> nm AZb  A @`2@`: ji A  = @`2@`: fe Aߒ  9 @`2@`: ba A  5 @`&@`. ^] AU]  1 @`0@`8 ZY AYa  - @`"@`* ih A  ) @`7@`@ ed A  % @`7@`@ getAdminStatsapi A1B  A14  AA @@` getAdminNotifStats Ak  Akn  ;; @@` getAdminMailStats AŖ  A  55 @@` NM ABK   @`7@`@ getAdminUsers A  A  ++ @@` DC A   @`7@`@ getAdminTasks At  Atw  !! @@` :9 A   @`7@`@ getAdminReports AI\  AIL   @@` 0/ Aox   @`7@`@ getAdminBalanceHistory A՜  A՜؜     @@`" &% A   @`7@`@ getAdminAiLogs A9K  A9<   @` @` getAdminActivityLogs A#;  A#&   @` @`$ getAdminMailLogs AJ^  AJM   @` @`  getAdminNotifLogs A%:  A%(   @` @`!    A   @:`7@:`@  Ajs   @B`7@B`@  A   @I`7@I`@  Aթީ   @P`7@P`@ getAdminPlans A/  A!   @R@R`  A  {{ @W`7@W`@ PO A    @Y@Y` LK A   @[@[` HG A&   @\@\`  A)2  kk @b`7@b`@  A  A   @d`#@d`4  AMV  bb @j`7@j`@  A  ^^ @p`7@p`@  Au~  ZZ @v`7@v`@ deactivateUsern A(:  A(+   @}`@}`0 activateUserh A=M  A=@   @}`3@}`C changeUserRoleb A$6  A$'   @`@`0 getAdminUser\ A{  A{~  { @@` updateAdminUserV AZm  AZ]  u @`"@`5 verifyAdminUserEmailP A  A  o @`"@`: adminTopUpUserBalanceJ A  A  i @`!@`: yE A  A  d @`@`* adminWithdrawUserBalance? AZv  AZ]  ^ @`!@`= n: AYs  AY\  Y|| @`@`* adminUpdateSpecialistCard4 A9V  A9<  Svv @`"@`? cancelTaskAdmin. A  A  Mpp @$`@$`1 deleteTaskAdmin( A  A  Gjj @2`@2`, updateReportStatus" A  A  Add @6`@6`4 }| A  = @=`7@=`@ getAdminLocations A)  A  7ZZ @?@?` updateLocation A  A  1TT @``&@``8 createLocation  A{  A{~  +NN @c`&@c`8 deleteLocation ARd  ARU  %HH @y`@y`+ a` A  ! @`7@`@ getAdminCategories A,B  A,/  >> @@` updateCategory A)  A  88 @`&@`8 createCategory A  A  22 @`&@`8 deleteCategory A  A   ,, @`@`+ updatePlan A  A  && @U`&@U`4 createPlan AVd  AVY     @X`&@X`4 ? Ay  Ay|   @``@``! deletePlan A  A   @k`@k`' .- A~   @o`7@o`@ 0 A  A     @q`#@q`4 getAdminSettings A"6  A"%   @r@r` getAdminEmailTemplates AJd  AJM   @@`" updateAdminSettings A; R   A; >    @`@`)  An    An q    @`@`) updateAdminEmailTemplate ALh  ALO   @`@`. translateAdminEmailTemplate A  A   @`"@`A  A^z  A^a   @`H@`d  A  A   @`@`.  A   A   @`@`)  A  A   @`@`)  A  A   @(`@(`)  A'  A   @8`@8`)  A     @H`(@H`,  A $$   @[` @[`$  A%%   @a`(@a`,  A&&   @k` @k`%  A''   @r`"@r`&  A((   @w`"@w`&  A))   @|`"@|`&  A**   @` @`$  A++   @`(@`,  A--   @` @`$  A..  | @`(@`,  AL0P0  x @` @`$  AB1F1  t @`(@`,  Ai3n3  p @` @`%  Av4z4  l @`"@`&  A55  h @`"@`&  A67  d|| @` @`%  A 88  `xx @`"@`&  A99  \tt @`"@`&  A::  Xpp @` @`%  A;;  Tll @`"@`&  A<<  Phh @`"@`&  A==  Ldd @` @`%  A>>  H`` @`"@`&  As?w?  D\\ @ `"@ `&  A@@  @XX @` @`%  AAA  <TT @`"@`&  AzB~B  8PP @"`"@"`&  AFF  4LL @-` @-`$  AG G  0HH @3`(@3`, {| AJJ  ,DD @N`@N` mn ACKHK  (@@ @P` @P`% ij AKK  $<< @S`@S`# ef A\LaL   88 @V`&@V`+ kl AMM  44 @Y`.@Y`2 gh A NN  00 @]`<@]`@ cd A OO  ,, @a`.@a`2 UV A-P2P  (( @g`&@g`+ Link A3P7P 4 (( @g`,@g`0 VW A1Q5Q   @k`.@k`2 RS ARR   @q`<@q`@ DE A_TdT   @|`@|`# JK ATT   @`&@`* <= AUU   @`4@`9 BC ApVtV     @`2@`6 >? AoXsX   @`@@`D :; AIZMZ   @`D@`H ,- A\\   @`S@`X 23 Ad^h^   @`>@`B ./ A__   @`S@`W  ! Aa#a   @`&@`+  Aaa   @`A@`F "# Abb   @`6@`:  A@dDd   @`H@`L  Aff   @`P@`T    Anisi   @`H@`M  Akk   @`J@`N  Ann   @`J@`N    Akror   @`H@`L  AEtIt   @`P@`T  Aww   @`H@`L  Ayy   @`P@`T  AN}R}   @`H@`L  A(,   @`P@`T  A܂   @ `a@ `f  A   @`F@`J  A   @`F@`J  A^b   @`F@`J  A@E   @`K@`P  A.3   @!`>@!`C  A,0   @$`F@$`J  A   @(`F@(`K  A   @+`N@+`S  A   @.`V@.`Z  Aӏ؏  { @4`N@4`S  A  w @7`V@7`Z  A  s @=`N@=`S  A;?  o @@`V@@`Z  A*.  k @J`>@J`B  A  g @b`N@b`S  A۞ߞ  c{{ @e`>@e`B  A   _ww @i`>@i`B  Abg  [ss @`Q@`V  A  Woo @`R@`V  A  Skk @`R@`V  A   Ogg @``@`d  A  Kcc @`R@`V  A  G__ @`R@`W  A  C[[ @`P@`U  A  ?WW @`>@`C  A  ;SS @`F@`J |} A?D  7OO @`F@`K  A_c  3KK @`N@`R ~ A  /GG @`>@`B pq A  +CC @`N@`S lm A  '?? @`>@`C rs A  #;; @`F@`J de A"  77 @`F@`K jk A=A  33 @`N@`R fg A  // @`>@`B XY A  ++ @`?@`D TU A  '' @ `>@ `C Z[ A   ## @ `F@ `J LM A   @ `F@ `K HI A   @ `N@ `S NO A   @ `V@ `Z @A A5:   @ `N@ `S FG AW[   @ `V@ `Z 89 ABG     @ `>@ `C 45 A05   @# `F@# `K :; AZ^   @& `N@& `R 67 A   @* `N@* `R () A   @0 `F@0 `K ./ A   @3 `N@3 `R *+ A}   @7 `N@7 `R  A~   @= `F@= `K "# A   @@ `N@@ `R  A$)   @D `N@D `S  A   @O `a@O `e    A   @j `A@j `F   A   @l `6@l `;  ARW   @o `>@o `C    ATX   @v `F@v `J  A   @| `F@| `J  A   @ `>@ `C  A   @ `F@ `J  A   @ `F@ `J  A37   @ `F@ `J  Az~   @ `F@ `J  Ain   @ `6@ `;  Ach   @ `>@ `C  AKO   @ `F@ `J  A   @ `T@ `Y  A   @ `R@ `V  AAE   @ `R@ `V  A   @ `R@ `V  AP T    @ `R@ `V  A     @ `R@ `V  AX \   { @ `R@ `V  A    w @ `R@ `V  A  s @ `F@ `J  Ahl  o @ `^@ `b  A  k @ `X@ `\  A  g @ `d@ `h  A  c{{ @ `X@ `\  A  _ww @ `^@ `c  A  [ss @ `V@ `Z formatShortName A  V || @ `V@ `e  A  Rjj @ `V@ `Z  A"  Nff @ `V@ `Z  A  Jbb @ `d@ `h  A  F^^ @ `V@ `Z  A  BZZ C   A  >VV @ `_@ `c  A!!  :RR @ `V@ `Z  Ah#l#  6NN @ `V@ `Z  A=$A$  2JJ @ `d@ `h }~ A&&  .FF @ `V@ `Z op A''  *BB @ `d@ `i uv A((  &>> @ `b@ `f qr A**  ":: @ `p@ `t mn Ap-t-  66 @ `t@ `x ij A00  22 @ `x@ `| ef A55  .. @ `>@ `B WX A88  ** @) `D@) `I ST A88  && @+ `6@+ `; YZ A99   "" @. `>@. `B KL A0<5<   @4 `>@4 `C QR A==   @9 `F@9 `J MN A7?;?   @= `F@= `J IJ A@@   @A `F@A `J EF AAA   @E `F@E `J AB AUCYC     @I `F@I `J 34 AqEvE   @Q `6@Q `; /0 AkFpF   @T `>@T `C 56 ASGWG   @W `F@W `J '( AHH   @Y `T@Y `Y -. AHH   @[ `R@[ `V )* AIJMJ   @_ `R@_ `V %& AKK   @c `R@c `V !" AMM   @g `R@g `V  AO"O   @k `R@k `V  APP   @o `R@o `V  AS S   @v `F@v `J  ASS   @x `^@x `b   A=TAT   @y `X@y `\    AV#V   @~ `j@~ `n  AVV   @ `X@ `\  AZZ   @ `U@ `Z  A[[   @ `V@ `[  A]]   @ `^@ `b  A^^   @ `^@ `b  A``   @ `V@ `Z  Aaa   @ `d@ `h  Add   @ `V@ `[  Agg   @ `V@ `Z  Azhh   @ `d@ `i  A0l4l   @ `V@ `Z  Amm   @ `V@ `Z  App   @ `>@ `B  Ass   @ `A@ `F  Ass  ~ @ `6@ `;  Att  z @ `>@ `C  Avv  v @ `F@ `J  A@ `C  A-}1}  j @ `F@ `J  A  f~~ @ `Q@ `U  A  bzz @ `6@ `;  A   ^vv @ `>@ `C  A  Zrr @ `F@ `J  A  Vnn @ `T@ `Y  Aae  Rjj @ `R@ `V  A  Nff @ `R@ `V  Atx  Jbb @ `R@ `V  A  F^^ @ `R@ `V  A  BZZ @ `R@ `V  A  >VV @ `R@ `V  AƎʎ  :RR @ `F@ `J  A  6NN @" `^@" `b  A  2JJ @# `X@# `\ }~ Aܑؑ  .FF @( `d@( `h yz A=A  *BB @) `X@) `\ kl A   &>> @1 `U@1 `Z qr A"&  ":: @4 `V@4 `Z mn A  66 @6 `d@6 `h A# 488 @6 `i@6 `m fg A˙ϙ  // @= `V@= `Z bc A`d  ++ @A `V@A `Z ^_ A59  '' @C `d@C `h Z[ A   ## @H `V@H `Z formatPrice Ait   .. @J `g@J `r QR A-1   @L `V@L `Z MN Aܡ   @P `V@P `Z ?@ A   @R `d@R `i EF A>B   CU U  AB Aæ     @Z `b@Z `f => A   @h `>@h `B /0 A#(   @s `F@s `K +, A   @u `6@u `; 12 A~   @x `>@x `B #$ A   @| `>@| `C   Aqv   @ `A@ `F  Afk   @ `>@ `C  A   @ `Z@ `_  A   @ `>@ `C  A   @ `F@ `K  AJN   @ `N@ `R  Aͻѻ   @ `N@ `R  A   @ `F@ `K    ABF   @ `N@ `R  A   @ `N@ `R  A   @ `F@ `K  A:>   @ `N@ `R  A   @ `N@ `R  A   @ `F@ `K  A05   @ `N@ `S  A   @ `N@ `R  A!&   @ `F@ `K  A   @ `N@ `S  ABF   @ `N@ `R  A   @ `F@ `K  A\a   @ `N@ `S  A   @ `N@ `R  A   @ `L@ `Q  A  ~ @ `F@ `J  A   z @ `>@ `C  A  v @ `F@ `J  AEI  r @ `F@ `J  A  n @( `6@( `:  A  j @* `[@* `_  A  f~~ @- `?@- `C  A`e  bzz @< `E@< `J  A  ^vv @> `6@> `;  A  Zrr @A `>@A `B  A  Vnn @E `>@E `C  A  Rjj @O `A@O `F  A  Nff @R `>@R `C  A"  Jbb @V `Z@V `_  A  F^^ @` `>@` `C  A  BZZ @c `F@c `K  A  >VV @e `N@e `R  A   :RR @i `N@i `R {| A  6NN @t `F@t `K wx A  2JJ @v `N@v `S }~ A  .FF @} `N@} `R op Aqv  *BB @ `F@ `K kl A  &>> @ `N@ `S qr A    ":: @ `N@ `R cd A   66 @ `F@ `K _` A  22 @ `N@ `S ef A&*  .. @ `N@ `R WX A  ** @ `>@ `C ST A  && @ `F@ `K YZ A   "" @ `N@ `R UV Afj   @ `N@ `R GH AAF   @ `T@ `Y MN Aei   @ `N@ `R ?@ A_!d!   @ `>@ `C EF AA"E"   @ `F@ `J AB A$$     @ `F@ `J => AF'J'   @ `6@ `: 9: A-(1(   @ `[@ `_ 56 A+)/)   @ `?@ `C '( A,,   @ `C@ `H -. Ao-s-   @ `@@ `D )* As.w.   @ `R@ `V %& Au/y/   @ `L@ `P  A80=0   @ `H@ `M  A61;1   @ `F@ `K  A4292   @ `N@ `S  Ab3f3   @ `V@ `Z  A85<5   @ `V@ `Z  A7 7   @ `V@ `[    A99   @ `n@ `r A99 4 @ `s@ `w  A<<   @! `c@! `h  A??   @, ``@, `e  AAA   @1 `V@1 `Z  ACC   @7 `_@7 `c  A8E@y `C  AYY  { @| `F@| `K  Ab[g[  w @ `F@ `K S AO\a\  AO\R\  r @ `@@ `R  A^^  n @ `N@ `S  Afaja  j @ `V@ `Z  Abb  f~~ @ `V@ `Z  A"f&f  bzz @ `H@ `L  A;g?g  ^vv @ `W@ `[  ABhFh  Zrr @ `C@ `G  Aii  Vnn @ `L@ `Q  Ajj  Rjj @ `J@ `N  Ajj  Nff @ `X@ `]  Akk  Jbb @ `V@ `Z  A!m%m  F^^ @ `V@ `Z  Ann  BZZ @ `V@ `Z  A6p:p  >VV @ `V@ `Z  Aqq  :RR @ `V@ `Z  AIsMs  6NN @ `V@ `Z  Att  2JJ @ `V@ `Z }~ AXv\v  .FF @ `V@ `Z yz Aww  *BB @ `V@ `Z uv Aiymy  &>> @ `V@ `Z qr A{{  ":: @ `J@ `N cd A||  66 @ `h@ `m ij A}}  22 @ `Z@ `^ ef A  .. @ `Z@ `^ ab Aei  ** @ `h@ `l ]^ A͂т  && @ `Z@ `^ YZ Apt   "" @ `Z@ `^ UV A   @ `Z@ `^ QR Aևڇ   @ `Z@ `^ MN A   @ `Z@ `^ IJ A)-   @`Z@`^ EF AЌԌ   @`Z@`^ AB Ax|     @ `Z@ `^ => Aos   @ `v@ `z 9: Aos   @`l@`p 56 A     @`p@`t 12 A   @`c@`g #$ A   @`l@`q )* A     @"`j@"`n %& A   @(`j@(`n !" A   @8`>@8`B  A    @A`S@A`X  A   @C`>@C`C    A   @F`F@F`K  A`d   @H`N@H`R  A   @L`N@L`S    A    @Q`V@Q`Z  A   @U`s@U`w  A    @]`F@]`K  A   @_`N@_`R  A59   @c`N@c`R  A   @k`F@k`K  A   @m`N@m`R  A!%   @q`N@q`R  A).   Cyy  Apu   @`N@`S  Aݼ   @`V@`Z  A   @`V@`Z  A6;   @`F@`K  A'+   @`Y@`]  A26   @`C@`G  A  ~ @`e@`i  A  z @`>@`B  AHM  v @`O@`T  A  r @`>@`C  A  n @`F@`K  A  j @`N@`R  A!&  f~~ @`N@`S  A6:  bzz @`V@`Z  A  ^vv @`o@`s  A\a  Zrr @`F@`K  A  Vnn @`N@`R  A  Rjj @`N@`R  A>C  Nff @`F@`K  A  Jbb @`N@`R  Aei  F^^ @`N@`R  AGL  BZZ @`s@`x  A+0  >VV @`N@`S  A  :RR @`V@`Z  A  6NN @ `V@ `Z wx A  2JJ @`F@`K }~ A  .FF @`U@`Y yz A  *BB @!`C@!`G kl A  &>> @#`L@#`Q qr A  ":: @&`J@&`N cd A|  66 @(`X@(`] ij A04  22 @*`V@*`Z ef A  .. @.`V@.`Z ab AEI  ** @2`V@2`Z ]^ A  && @6`V@6`Z YZ AZ^   "" @:`V@:`Z UV A   @>`V@>`Z QR A-1   @E`J@E`N CD A   @N`Y@N`^ IJ A   @Q`Z@Q`^ EF A   @U`Z@U`^ AB ARV     @Y`Z@Y`^ => A/3   @[`h@[`l 9: A   @``Z@``^ 56 A     @d`Z@d`^ 12 A     @f`h@f`l -. Aj n    @l`Z@l`^ )* A]a   @n`r@n`v %& A   @q`l@q`p !" Arv   @w`p@w`t  A   @{`c@{`g  A   @~`l@~`q  A   @`j@`n  A    @`j@`n   An r    @`>@`B  A""   @`X@`]  A[#`#   @`>@`C  A$$   @`F@`K  A*%.%   @`N@`R  A&&   @`N@`S  A((   @`V@`Z  A`*d*   @`o@`s  A,,   @`F@`K  Ak-o-   @`N@`R  A..   @`N@`R  A11   @`F@`K  A[2_2   @`N@`R  A33   @`N@`R  A66   C  A99   @`N@`S  A:<><  ~ @`V@`Z  A@>D>  z @`V@`Z  AAA  v @`F@`K  ADD  r @`W@`[  AEE  n @ `C@ `G  A`FeF  j @ `L@ `Q  ATGXG  f~~ @`J@`N  A5H:H  bzz @`X@`]  AHH  ^vv @`V@`Z  AqJuJ  Zrr @`V@`Z  AKK  Vnn @`V@`Z  AMM  Rjj @`V@`Z  AOO  Nff @#`V@#`Z  AaQeQ  Jbb @*`J@*`N  ACRHR  F^^ @,`k@,`p  AoSsS  BZZ @/`Z@/`^  A9U=U  >VV @3`Z@3`^  AVV  :RR @7`Z@7`^  AWW  6NN @9`h@9`l  AYY  2JJ @>`Z@>`^ }~ A[[  .FF @B`Z@B`^ yz A\\  *BB @D`s@D`w uv A]]  &>> @F`l@F`p qr A``  ":: @L`p@L`t mn Aaa  66 @P`c@P`g ij Abb  22 @R`l@R`p ef ANeRe  .. @X`p@X`t ab Aii  ** @f`>@f`B ST AFlKl  && @q`A@q`F OP All   "" @s`6@s`; KL Amm   @v`>@v`C GH Ann   @y`F@y`K MN App   @`N@`R IJ Aksos   @`N@`R EF Advhv   @`>@`B 78 Auxzx     @`B@`G => Aryvy   @`>@`B /0 Azz   @`>@`C +, A{{   @`F@`K 12 Ae|i|   @`N@`R -. A}}   @`N@`R   A   @`F@`K %& A(,   @`N@`R !" A   @`N@`R  A=B   @`F@`K  A   @`N@`R  Aqu   @`N@`R  A]b   @`F@`K   A   @`N@`R  A   @`N@`S  AƔʔ   @`V@`Z  ARV   @`V@`Z  AԘ٘   @`F@`K  Ay}   @`N@`R  A   @`N@`S  A=A   @`V@`Z  Aş   @`V@`Z  ACG   @ `V@ `Z  A"'   @`>@`C  A   @`F@`J  A(,   @`F@`J  Az~   @%`>@%`B  Aު   @)`>@)`C  A̫ѫ   @,`F@,`K  Aqu  ~ @.`N@.`R  A  z @2`N@2`R  A  v @?`F@?`K  A9=  r @A`N@A`R  Aɴʹ  n @E`N@E`R  A_d  j @R`F@R`K  A  f~~ @T`N@T`R  A  bzz @X`N@X`R  A',  ^vv @e`F@e`K  A  Zrr @g`N@g`R  Abf  Vnn @k`N@k`R  A   Rjj @x`F@x`K  A  Nff @z`N@z`R  AAE  Jbb @~`N@~`R  A  F^^ @`F@`K  A  BZZ @`N@`R  A  >VV @`N@`R  A  :RR @`F@`K  ASW  6NN @`N@`R  A  2JJ @`N@`R st A  .FF @`F@`K yz A$(  *BB @`N@`R uv A  &>> @`N@`R gh A]b  ":: @`F@`K mn A  66 @`N@`R ij A  22 @`N@`R ef A  .. @`>@`B WX A  ** @`>@`C ST A  && @`F@`K YZ A   "" @`N@`R UV A   @`N@`R GH Afk   @`F@`K MN A    @`N@`R IJ A   @`N@`R ;< A   @`>@`C AB A8<     @ `F@ `J => A   @ `F@ `J 9: AFJ   @`>@`B 56 A   @`>@`B '( Akp   @3`X@3`] -. A   @6`N@6`R )* A     @C`>@C`B %& A   @G`>@G`B  A    @~`X@~`]  A26   @`N@`R  AH#M#   @`>@`C    A<$A$   @`F@`K  Aj%n%   @`N@`R  Ap)u)   @`F@`K    A**   @`N@`R  A..   @`F@`K  A//   @`N@`R  A1 1   @`N@`R  AL5Q5   @`>@`C  A3676   @`F@`J  A88   @`F@`J  A";&;   @`6@`:  A<<   @`\@``  A = =   @`?@`C  A==   C  A#?(?   @`J@`O  A-@2@   @`R@`W  AbAfA   @`Z@`^  A CC   @`l@`p  ADD  ~ @`l@`p  A]GaG  z @`f@`j  AHH  v @`R@`W  AJ!J  r @`Z@`_  AKK  n @`s@`x  ANN  j @`b@`g  AGRLR  f~~ @`s@`x  ATT  bzz @`t@`y  AWW  ^vv @`s@`x  ACZHZ  Zrr @#`q@#`v  A[[  Vnn @&`b@&`f  A2^6^  Rjj @,`p@,`t  Abb  Nff @7`v@7`z  Acc  Jbb @9`z@9`  Ae e  F^^ @<`b@<`f  Aef  BZZ @>`p@>`t  Ahh  >VV @D`t@D`x  All  :RR @P`J@P`O  Amm  6NN @S`e@S`i - A;nIn  A;n>n  1TT @T`U@T`c s  A oo  A oo  ,OO @V`X@V`i wx App  (@@ @Y``@Y`d st Ass  $<< @_`d@_`h op Auu   88 @d`R@d`V kl A0w4w  44 @i`R@i`V ]^ Azz  00 @v`D@v`I cd Ab{f{  ,, @x`6@x`: _` AGK  (( @`E@`I QR A   $$ @`S@`X WX A     @`>@`B IJ A   @`>@`C EF AˆІ   @`F@`K KL Apt   @`N@`R GH A    @`N@`R 9: A     @`F@`K ?@ A   @`N@`R ;< AHL   @`N@`R -. A\a   @`F@`K 34 A   @`N@`R /0 A   @`N@`R !" A    @`F@`K '( A   @`N@`R #$ AIM   @`N@`R   Acg   @`F@`J  Aݣ   @`P@`U  AԤؤ   @`>@`B  A   @`>@`B  AJO   @`>@`C  A+0   @`F@`K  A16   @`N@`S  ACG   @`V@`Z  A   @`V@`Z  AKP   @`N@`S  A   @`V@`Z  A   @`V@`Z  Ans   @"`F@"`K  A   @$`N@$`R  A   @(`N@(`S  A   @0`V@0`Z  A~   @4`V@4`Z  A   @8`V@8`Z  AW\   @@`F@@`K  A   @B`N@B`R  A   @F`N@F`R  A  | @R`F@R`K  A  x @T`N@T`R  A'+  t @X`N@X`R  A  p @e`F@e`K  A  l @h`N@h`S  A  h @j`V@j`Z  AUY  d|| @n`V@n`Z  A  `xx @y`N@y`S  Afj  \tt @{`V@{`Z  A  Xpp @`V@`Z  AOS  Tll @`F@`J  A  Phh @`F@`J sendTestEmail+ A  A  Jmm @`V@`g  A05  F^^ C  ASW  BZZ @`R@`V  A  >VV @``@`d  A$(  :RR @`Y@`] {| A  6NN @`S@`X wx AZ_  2JJ @`>@`C st A`e  .FF @`F@`K op Av{  *BB @`N@`S uv A  &>> @`V@`Z gh Ach  ":: @`V@`[ mn A(,  66 @`^@`b ij A  22 @`^@`b [\ A  .. @`N@`S ab A  ** @`V@`Z ]^ A\`  && @`V@`Z YZ A   "" @`d@`h KL Afk   @`F@`K GH A_d   @`N@`S MN A   @`V@`Z ?@ A   @`V@`[ EF A! %    @`^@`b AB A       @`^@`b 34 A{   @`N@`S 9: A04   @`V@`Z 56 A   @`V@`Z '( AUZ   @ `N@ `S #$ Asx   @#`V@#`[ )* A8<   @%`^@%`b %& A   @)`^@)`b  A   @4`V@4`[  Af j    @6`^@6`b  A$"("   @:`^@:`b    A''   @H`N@H`S  A((   @J`V@J`Z   A,*0*   @N`V@N`Z  A..   @Y`N@Y`S  Ar/v/   @[`V@[`Z  A11   @_`V@_`Z  A56   @l`F@l`K  A7 7   @o`N@o`R  A99   @u`[@u`_  A;;   @}`>@}`C  A.=3=   @`F@`K  Aq?u?   @`N@`R  A@A   @`N@`R  ABB   @`N@`R  AE#E   @`F@`J  AFF   @`Y@`^  AGG   @`>@`C  AHH   @`F@`K  AVV @*`T@*`X  Asvwv  :RR @4`L@4`P  A|xx  6NN @:`T@:`X  A{{  2JJ @D`L@D`P }~ A}}  .FF @J`T@J`X yz A   *BB @T`L@T`P uv A  &>> @Z`T@Z`X qr AĆ  ":: @d`L@d`P mn AɈ͈  66 @j`T@j`X ij A-1  22 @t`L@t`P ef A8<  .. @z`T@z`X ab AIM  ** @`L@`P ]^ AQU  && @`T@`X YZ A   "" @`L@`P UV A   @`T@`X QR Aǜ˜   @`L@`P MN AОԞ   @`T@`X IJ A   @`L@`P EF A   @`T@`X AB A     @`L@`P => A#   @`T@`X 9: Avz   @`L@`P 56 A   @`T@`X 12 A   @`L@`P -. A   @`T@`X )* Aei   @`L@`P %& Amq   @`T@`X  A   @ `I@ `N  A   @ `J@ `O  Ax|   @`R@`V    A   @`R@`W  A   @`Z@`^  A   @`i@`n    A|   @#`_@#`c  A   @)`R@)`V  A   @+``@+`d  A   @1`d@1`h  AGL   @8`W@8`\  Atx   @;`R@;`V  A   @A`c@A`g  A   @H`R@H`W  A   @J`Z@J`^  A   @N`Z@N`^  A.3   @^`R@^`W  A   @``Z@``^  A   @d`Z@d`^  A]b   @v`m@v`r  A   @y`Z@y`^  A\`  ~ @}`Z@}`^  A15  z @`i@`m  A=B  v @`R@`W  Aei  r @`Z@`^  Az  n @`Z@`_  A&*  j @`b@`f  A  f~~ @`p@`t  A  bzz @`Z@`^  AX]  ^vv @`T@`Y  AY^  Zrr @`>@`C  A  Vnn @`F@`J  ALP  Rjj @`F@`J  A    Nff @`>@`C  A    Jbb @`F@`K  A    F^^ @`N@`R  A1 5   BZZ @`N@`R  A $  >VV @`F@`J  A  :RR @`T@`X {| A  6NN @`>@`C  A  2JJ @`F@`J st A  .FF @`F@`K yz A)-  *BB @`N@`R kl A  &>> @`N@`S qr A"&  ":: @`V@`Z mn A  66 C ij A  22 @`N@`R [\ A    .. @`F@`K ab Ao!s!  ** @`N@`R ]^ A# #  && @ `N@ `R YZ A?'C'   "" @`N@`R KL A))   @`>@`C QR A**   @ `F@ `J CD A",',   @$`F@$`K IJ A,,   @&`N@&`R ;< A^.c.   @*`N@*`S AB A11     @2`V@2`Z => A33   C66 9: A}55   @<`N@<`R +, An7s7   @B`F@B`K 12 A88   @D`N@D`R -. A99   @H`N@H`R )* A==   @S`N@S`R  A9@>@   @[`>@[`C !" A(A,A   @^`F@^`J  ACC   @d`W@d`[  AEE   @l`S@l`X    AFF   @o`>@o`C  AiGmG   @q`F@q`J   AHH   @u`F@u`J    AKK   @`L@`P  AAMEM   @`T@`X  A@`C  A#'  bzz @`F@`J  A  ^vv @ `U@ `Y  AǍ  Zrr @`O@`T  AÎǎ  Vnn @`>@`B  A  Rjj @`>@`C  A  Nff @`F@`K  A  Jbb @`N@`R  A$(  F^^ @!`N@!`R  A  BZZ @'`F@'`J  A  >VV @.`T@.`X  A   :RR @4`>@4`C {| A   6NN @7`F@7`K  A  2JJ @9`N@9`R }~ A15  .FF @=`N@=`R yz A#'  *BB @C`F@C`J uv A   &>> @J`T@J`X gh A  ":: @P`>@P`C mn A  66 @R`F@R`J ij A$(  22 @V`F@V`J [\ A  .. @a`>@a`C ab A  ** @c`F@c`J ]^ A  && @g`F@g`J OP A:?   "" @s`>@s`C UV AϰӰ   @u`F@u`J QR AIM   @y`F@y`J MN A   @}`F@}`J ?@ A05   @`>@`C EF A#   @`F@`J AB A     @`R@`V 34 A   @`B@`G /0 A   @`6@`; 56 A   @`>@`B 12 Aim   @`L@`P #$ A   @`C@`H )* A`d   @`>@`B %& A)-   @`>@`B  A<A   @`6@`;  ALQ   @`>@`C  A   @`F@`J  AMQ   @`F@`J  A59   @`>@`B ^] A   @`B@`I    A   @`L@`P  A   @`6@`;  Arv   @`>@`B  A   @`>@`C  A   @`F@`K  Atx   @`N@`R  A   @ `\@ ``  A   @`F@`K  A   @`N@`R  A   @`\@``  A   @&`N@&`R  Aqv   @G`6@G`;  A_c   @J`>@J`B  A   @N`_@N`c  A   @Q`C@Q`G  A  ~ @S`g@S`l  A  z @V`N@V`S  A  v @X`V@X`Z  A  r @\`V@\`[  A  n @j`N@j`R    A% ,   j @p`R@p`Y  AJO  f~~ @`6@`;  A8<  bzz @`>@`B  A  ^vv @`T@`Y  A  Zrr @`F@`K  A>B  Vnn @`N@`R  A  Rjj @`N@`R  A  Nff @`_@`c  A  Jbb @`C@`G  AVZ  F^^ @`L@`P  A   BZZ @`P@`T  A  >VV @`l@`q  A  :RR @`V@`Z  A    6NN @`V@`Z wx Aa!f!  2JJ @`d@`i }~ A""  .FF @`b@`f op A--  *BB @`b@`g uv A+0/0  &>> @`j@`n qr ACC  ":: @`:@`> cd AMDRD  66 @`<@`A _` AKEPE  22 @`:@`? [\ AiFnF  .. @ `B@ `G ab AG G  ** @ `J@ `N ST AvH{H  && @`J@`O YZ AeKiK   "" @`B@`F KL AhMmM   @ `:@ `? QR AGNKN   @#`B@#`F MN AVV   @>`T@>`X getAdminUserSpecialistCards AXX  AXX   @C`Z@C`y  A_YuY  A_YbY   @D`pAD  AZ1Z  AZZ   @E`pAE /0 A^^   @Q`B@Q`G +, A__   @T`g@T`l '( A``   @W`R@W`W #$ A?bDb   @Z`Z@Z`_   A cc   @\`b@\`g  A{gg   @g`q@g`v  AFhKh   @i`b@i`g  A)m.m   @v`R@v`W  ASnXn   @y`Z@y`_  A o$o   @{`b@{`f  Apq   @`b@`f  Awu|u   @`Z@`_    ADvHv   @`b@`f  A"x&x   @`b@`f  A!}&}   @`R@`W  A}}   @`Z@`^  A   @`Z@`^  A   @`R@`W  Auy   @`Z@`^  A-1   @`Z@`^  AGL   @`g@`l  ALQ   @`R@`W  A     @`Z@`^  AÎǎ   @`Z@`^  A*/   @`R@`W  A   @`Z@`_  A   @`{@`  A•ƕ  ~ @`p@`t  AIM  z @`g@`k  A'+  v @`p@`t  Afj  r @`b@`f  Adh  n @`u@`y  Aۣ  j @`R@`W  A   f~~ @`Z@`_  Aҥ֥  bzz @`b@`f  A  ^vv @`b@`g  A]a  Zrr @`j@`n  A8<  Vnn @ `j@ `n  A  Rjj @ `j@ `n  A.3  Nff @`Z@`_  A  Jbb @`b@`f  AԴٴ  F^^ @`b@`g  A  BZZ @#`j@#`n  Aw{  >VV @'`|A'  A(-  :RR @1`l@1`q {| A&+  6NN @9`R@9`W  Abf  2JJ @<`Z@<`^ }~ A(,  .FF @E`Z@E`^ op ATY  *BB @K`R@K`W uv A  &>> @M`Z@M`^ gh A  ":: @Q`Z@Q`_ mn ARV  66 @Y`b@Y`f ij A  22 @]`b@]`f ef A  .. @a`b@a`f WX AIN  ** @i`R@i`W ]^ A   && @k`Z@k`^ YZ A   "" @o`Z@o`^ KL A   @u`l@u`q QR A   @x`j@x`n MN A   @`j@`n ?@ A   @`g@`l ;< A   @`R@`W 78 Aaf     @`Z@`_ => A.2   @`b@`f /0 A   @`b@`g +, A   @`Z@`_ '( A   @`b@`g -. A   @`j@`n )* AKO   @`x@`|  A   @`b@`g !" A   @`j@`n  A   @`x@`|  A~     @`R@`V  A     @`h@`l  Aa f    @`X@`]  A     @`V@`[  A     @`^@`c  A     @`f@`j  A    @`f@`j  A( ,    @`^@`b  A     @`V@`[  A     @`^@`c  A     @`f@`j  A     @`f@`j  AF J    @`^@`b  A     @`V@`[  A# (    @`^@`c  A     @`f@`j  A    @`f@`j  A^# b#    @"`^@"`b  A( (    @0`d@0`i  A) )   ~ @3`R@3`W  Ay* }*   z @5`Z@5`^  A@, E,   v @9`Z@9`_  A- -   r @<`b@<`g  A@/ D/   n @?`j@?`n  AV1 Z1   j @C`j@C`n  A6 6   f~~ @N`AN  AB9 F9   bzz @S`p@S`t  A; ;   ^vv @Y`t@Y`x  A[@ `@   Zrr @d`o@d`t Fragment_Fragment Aa@ j@  4Tll @d`u@d`~  AA A   Phh @f`Z@f`^  AB B   Ldd @j`Z@j`^  AP Q   H`` @`l@`q  A|R R   D\\ @`j@`n  ANT RT   @XX @`j@`n  A.[ 3[   <TT @`Z@`_  A^\ b\   8PP @`b@`f yz A7^ <^   4LL @`b@`g  Aqc uc   0HH @`j@`n {| ABe Fe   ,DD @`j@`n mn Ayi ~i   (@@ @`j@`o ij A~j j   $<< @`R@`W op A;k ?k    88 @`Z@`^ kl Al l   44 @`Z@`^ ]^ An n   00 C cd Ap p   ,, @`j@`n UV At t   (( @`Z@`_ [\ Av !v    $$ @`b@`f WX A      @`b@`f IJ AV [    @ `R@ `W OP A    @`Z@`^ KL A[ _    @`q@`u GH Aʍ ΍    @`|A CD A2 6      @`_@`c 56 A* /    C 12 A    @`j@`o 78 A     @"`r@"`v )* A< A    @+`r@+`w /0 A    @.`z@.`~ +, A     @7`z@7`~ '( A    @?`j@?`n  A     @I`j@I`o   A    @K`r@K`v  A     @O`r@O`v   AX ]    CQQ  A    CUU  A˴ д    @``r@``w    AI M    @c`z@c`~  A    @`z@`~  A+ 0    @`j@`o  A     @`r@`v  A1 5    @`r@`v  A    C  A     C  A; ?    @`r@`v  A    @`j@`o  A    @`r@`v  A    @`r@`v  A     C  A    C  A    @`r@`v  A. 2    @`j@`n  A8 <    @`x@`|  A    | @`V@`[  A    x @`B@`F  A !   t @`B@`F  A $   p @ `?@ `C  A   l @ `H@ `L  AT X   h @`J@`N  A    d|| @`<@`A  AP U   `xx @`:@`?  AB F   \tt @`B@`F  A     Xpp @!`B@!`F  A    Tll @(`:@(`?  A    Phh @-`B@-`G  A    Ldd @6`:@6`?  A    H`` @9`B@9`G  A_ c   D\\ @;`J@;`N  AS W   @XX @?`J@?`N  Aw" |"   <TT @O`B@O`G  A# #   8PP @Q`J@Q`N  A% %   4LL @U`J@U`N uv A+ +   0HH @e`:@e`? {| Ac, g,   ,DD @h`B@h`F wx A 2 2   (@@ @u`B@u`F st A5 5    ;; @`@` A5 6  488 @`@`' ab Au7 z7   44 @`!@`& ]^ A7 7   00 @`"@`' cd A9 9   ,, @`*@`. _` A{: :   (( @`O@`S [\ A; ;   $$ @`<@`@ WX A< <      @`3@`7 ST A= =    @`<@`@ OP A> >    @`3@`7 KL Ap? t?    @`8@`< GH A@ @    @`8@`< 9: A^B cB      @`/@`4 ?@ AC C    @`2@`6 ;< APE TE    @`2@`6 -. AF F    @`*@`/ 34 AkG oG    @`2@`6 /0 AcH gH    @`2@`6 !" AZI _I    @`2@`7 '( AK "K    @`*@`.  AL L    @`*@`/   ALM PM    @`A@`E  A O O    @`2@`6  AP P    @`2@`6  AR R    @`;@`?  AU U    Z @ `@ `fg AU U  4 @ `@ `'  AW W    @ `!@ `&  APW UW    @ `"@ `'  AX X    @ `*@ `.  A Z Z    @! `O@! `S  Ao[ s[    @' `<@' `@  A\ !\    @* `3@* `7  A] ]    @0 `<@0 `@  A1^ 5^    @3 `3@3 `7  A^ ^    @7 `*@7 `.  A_ _    @; `*@; `/  Al` p`    @> `2@> `6  Ada ha    @B `2@B `6  Amb rb    @F `2@F `7  A1d 5d    @O `*@O `.  Ae e    @S `*@S `/  APf Tf    @V `2@V `6  A h h    @\ `2@\ `6  Ai i    @a `2@a `6  Ak k    @j `;@j `?  A0n 5n     @~ `@~ `  An n    @ `@ `  Ao o   {{ @ `@ `  Ap p   ww @ `"@ `&  A_q dq   ss @ `"@ `'  A~r r   oo @ `"@ `&  Au u   kk @ `@ `   Au u   gg @ `$@ `(  Aw w   cc @ `@ `   AWx [x   __ @ `$@ `(  Ay y   [[ @ `@ `!  Az z   WW @ `@ `"  Al{ p{   SS @ `@ `"  A| |   OO @ `@ `   A} }   KK @ `$@ `( ~ A% )   GG @ `@ `  z{ A    CC @ `$@ `( lm At y   ?? @!`@!`! rs A[ _   ;; @ !`@ !`" no A   77 @!`@!`" jk A   33 @!`@!`" \] A    // @$!`@$!`! bc A   ++ @+!`@+!`" ^_ Ai m   '' @.!`@.!`" Z[ A    ## @9!`@9!`  VW A    @?!`$@?!`( HI A    @G!`@G!`! NO A؊ ܊    @N!`@N!`" JK A    @T!`@T!`" FG A    @`!`@`!`  BC A       @f!`$@f!`( >? Aя Տ     @r!`@r!`  9: A    @x!`$@x!`( +, Ab g    @!`@!` '( A     @!`@!` #$ A_ d    @!`@!`   Aٔ ޔ    @!`"@!`' %& A    @!`<@!`@ !" A    @!`=@!`A  A" &    @!`P@!`T  AƘ ˘    @!`V@!`[  A    @!`2@!`6  A/ 3    @!`5@!`9   A     @!`@!`webpack/lib/dependencies/PureExpressionDependencyaA m @!@!A¢ Ƣ   R @!`@!`A    @!` @!`%Ap u   @!`)@!`.Aˤ Ϥ   @!`*@!`.A) -   @"`*@"`.A è   @"`-@"`1A    @!"`)@!"`-AL P   @*"`@*"`"A   1 @w"`@w"`AY ^   @y"` @y"`%A   @"`)@"`.A   @"`*@"`.AN R   @"`*@"`.Ae i   @"`)@"`-A   @"`9@"`=A   @"`2@"`6Aʿ ο   @"`2@"`6A   @"`)@"`-A    @"`0@"`4A   @"`@"`"webpack/lib/ModuleGraphRestoreProvidedDataprovidedcanMangleProvideterminalBindingexportsInfo 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 */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* 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__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8293); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceJ /* __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 } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; const TEMPLATE_VARS = { registration_success: [ 'userName', 'link', 'siteName', 'siteUrl' ], email_verification: [ 'userName', 'link', 'siteName', 'siteUrl' ], password_reset: [ 'userName', 'link', 'siteName', 'siteUrl' ], new_offer: [ 'userName', 'taskTitle', 'taskId', 'specialistName', 'price', 'link' ], new_task: [ 'userName', 'taskTitle', 'taskId', 'customerName', 'link' ], offer_accepted: [ 'userName', 'taskTitle', 'price', 'link' ], new_message: [ 'userName', 'senderName', 'preview', 'link' ], offer_declined: [ 'userName', 'taskTitle', 'taskId', 'link' ], offer_other_accepted: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_updated: [ 'userName', 'taskTitle', 'taskId', 'link' ], deadline_reminder: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_archived: [ 'userName', 'taskTitle', 'taskId', 'link' ], referral_reward: [ 'userName', 'days', 'planName', 'link' ], plan_activated: [ 'userName', 'planName', 'price', 'expiresAt', 'link' ], plan_upgraded: [ 'userName', 'oldPlanName', 'newPlanName', 'charged', 'expiresAt', 'link' ], plan_downgrade_scheduled: [ 'userName', 'currentPlanName', 'newPlanName', 'scheduledDate', 'link' ], plan_downgrade_applied: [ 'userName', 'planName', 'link' ], plan_renewal_reminder: [ 'userName', 'planName', 'amount', 'expiresAt', 'link' ], plan_insufficient_funds: [ 'userName', 'currentPlanName', 'requiredAmount', 'currentBalance', 'expiresAt', 'topUpLink' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); function getCatLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.namesEn || row.namesEl || row.slug || '' : locale === 'ru' ? row.namesRu || row.namesEl || row.slug || '' : row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.nameEn || row.nameEl || row.slug || '' : locale === 'ru' ? row.nameRu || row.nameEl || row.slug || '' : row.nameEl || row.nameEn || row.slug || ''; } function AdminCatPicker({ catRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx("span", { className: "text-sm leading-none shrink-0", children: parent.icon }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker({ locRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-blue-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _jsxs("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'Подтвердите ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'Добро пожаловать в {{siteName}}!', body: '' }, password_reset: { subject: 'Восстановление пароля — {{siteName}}', body: '' }, new_offer: { subject: 'Новое предложение по вашей задаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'Новая задача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше предложение принято: {{taskTitle}}', body: '

Ваше предложение принято! 🎉

Привет, {{userName}}!

Заказчик принял ваше предложение на выполнение задачи:

{{taskTitle}}

Сумма: {{price}}€

Открыть чат →' }, new_message: { subject: 'Новое сообщение от {{senderName}}', body: '

Новое сообщение

Привет, {{userName}}!

Вам написал(а) {{senderName}}:

"{{preview}}"

Ответить →' }, offer_declined: { subject: 'Ваше предложение отклонено: {{taskTitle}}', body: '

Ваше предложение отклонено

Привет, {{userName}}!

К сожалению, заказчик отклонил ваше предложение на:

{{taskTitle}}

Найти другие заказы →' }, offer_other_accepted: { subject: 'Выбран другой исполнитель: {{taskTitle}}', body: '

Выбран другой исполнитель

Привет, {{userName}}!

Заказчик выбрал другого исполнителя для задания:

{{taskTitle}}

Найти другие заказы →' }, task_updated: { subject: 'Задание обновлено: {{taskTitle}}', body: '

Задание обновлено

Привет, {{userName}}!

Заказчик обновил детали задания:

{{taskTitle}}

Смотреть заказ →' }, deadline_reminder: { subject: 'Задание истекает завтра: {{taskTitle}}', body: '

Напоминание о дедлайне

Привет, {{userName}}!

Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.

{{taskTitle}}

Редактировать задание →' }, task_archived: { subject: 'Задание снято с публикации: {{taskTitle}}', body: '

Задание переведено в черновик

Привет, {{userName}}!

Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.

{{taskTitle}}

Редактировать задание →' }, referral_reward: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' }, referral_reward_el: { subject: 'Λάβατε ανταμοιβή παραπομπής — {{siteName}}', body: '

Λάβατε ανταμοιβή παραπομπής! 🎁

Γεια {{userName}},

Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν {{days}} ημέρες πρόσβασης στο πλάνο {{planName}}!

+{{days}} ημέρες — {{planName}}

Δες τον λογαριασμό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, customerPlanId: '', customerDays: '30', specialistPlanId: '', specialistDays: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitle: '', siteDescription: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && session.user?.role === 'admin'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'admin') router.push('/'); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ setActivityLog(d.data); setActivityTotal(d.total); if (d.eventTypes?.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ setMailLog(d.data); setMailTotal(d.total); if (d.eventTypes?.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ setNotifLogs(d.data); setNotifLogsTotal(d.total); if (d.notifTypes?.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: editUser.languages ?? [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: editUser.showContactInfo ?? false, notifyNewTasks: editUser.notifyNewTasks ?? false, notifMessages: editUser.notifMessages ?? true, skills: editUser.skills ?? [], siteSettings: editUser.siteSettings ?? {} }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: card.skills ?? [], categories: card.categories ?? [], locations: card.locations ?? [], isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm(`${t('admin.tasks.delete.confirm')}\n"${title}"`)) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>(row.task?.id || row.id) !== id)); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId ?? null, slug: '', nameEl: '', nameEn: '', nameRu: '', order: 0, isActive: true }); } function openEditLoc(loc) { setLocForm({ id: loc.id, parentId: loc.parentId ?? null, slug: loc.slug, nameEl: loc.nameEl ?? loc.names?.el ?? '', nameEn: loc.nameEn ?? loc.names?.en ?? '', nameRu: loc.nameRu ?? loc.names?.ru ?? '', order: loc.order ?? 0, isActive: loc.isActive ?? true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm(`${t('admin.loc.delete.confirm')}\n"${name}"`)) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddCat(parentId) { setCatForm({ parentId: parentId ?? null, slug: '', icon: '📦', namesEl: '', namesEn: '', namesRu: '', order: 0, isActive: true }); } function openEditCat(cat) { setCatForm({ id: cat.id, parentId: cat.parentId ?? null, slug: cat.slug, icon: cat.icon, namesEl: cat.namesEl ?? cat.names?.el ?? '', namesEn: cat.namesEn ?? cat.names?.en ?? '', namesRu: cat.namesRu ?? cat.names?.ru ?? '', order: cat.order ?? 0, isActive: cat.isActive ?? true }); } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm(`${t('admin.cat.delete.confirm')}\n"${name}"`)) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } function openAddPlan() { setPlanForm({ name: '', description: '', role: 'specialist', tier: 'free', price: '0', oldPrice: '', currency: 'EUR', maxTasks: '', maxOffers: '', maxCards: '', maxMessagesPerDay: '', maxOrdersPerDay: '', maxSkills: '', maxProfiles: '', maxPortfolioItems: '', durationDays: '', searchBoost: 0, offersMultiplier: '1.00', features: '', isDefault: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { setPlanForm({ id: plan.id, name: plan.name, description: plan.description ?? '', role: plan.role ?? 'specialist', tier: plan.tier ?? 'free', price: plan.price ?? '0', oldPrice: plan.oldPrice ?? '', currency: plan.currency ?? 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', maxProfiles: plan.maxProfiles != null ? String(plan.maxProfiles) : '', maxPortfolioItems: plan.maxPortfolioItems != null ? String(plan.maxPortfolioItems) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: plan.searchBoost ?? 0, offersMultiplier: plan.offersMultiplier ?? '1.00', features: (plan.features ?? []).join('\n'), isDefault: plan.isDefault ?? false, isActive: plan.isActive ?? true, order: plan.order ?? 0, notifyNewTasks: plan.notifyNewTasks ?? false, canContactFreePlan: plan.canContactFreePlan ?? false, canContactProPlan: plan.canContactProPlan ?? true, canContactAll: plan.canContactAll ?? false, canShowContactInfo: plan.canShowContactInfo ?? false, canViewPhone: plan.canViewPhone ?? false, canUploadVideo: plan.canUploadVideo ?? false, hasFavorites: plan.hasFavorites ?? false, hasGoogleCalendar: plan.hasGoogleCalendar ?? false, hasVerifiedBadge: plan.hasVerifiedBadge ?? false, highlightedReviews: plan.highlightedReviews ?? false, hasPersonalSite: plan.hasPersonalSite ?? false, hasCanHelpNowStatus: plan.hasCanHelpNowStatus ?? false, hasNeedHelpStatus: plan.hasNeedHelpStatus ?? false, hasAutoResponse: plan.hasAutoResponse ?? false, hasAutoMatch: plan.hasAutoMatch ?? false, receiveInstantDispatchFree: plan.receiveInstantDispatchFree ?? false, receiveInstantDispatchPro: plan.receiveInstantDispatchPro ?? false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, maxProfiles: planForm.maxProfiles ? Number(planForm.maxProfiles) : null, maxPortfolioItems: planForm.maxPortfolioItems ? Number(planForm.maxPortfolioItems) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm(`Удалить тариф "${name}"?`)) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ setGeneralForm({ siteName: kv['general.siteName'] ?? 'CanHelp', siteUrl: kv['general.siteUrl'] ?? '', contactEmail: kv['general.contactEmail'] ?? '', supportPhone: kv['general.supportPhone'] ?? '' }); setSmtpForm({ host: kv['smtp.host'] ?? '', port: kv['smtp.port'] ?? '587', username: kv['smtp.username'] ?? '', password: kv['smtp.password'] ?? '', fromName: kv['smtp.fromName'] ?? 'CanHelp', fromEmail: kv['smtp.fromEmail'] ?? '', encryption: kv['smtp.encryption'] ?? 'tls' }); setEPayForm({ merchantId: kv['payment.epay.merchantId'] ?? '', apiUser: kv['payment.epay.apiUser'] ?? '', apiPassword: kv['payment.epay.apiPassword'] ?? '', environment: kv['payment.epay.environment'] ?? 'test', confirmationUrl: kv['payment.epay.confirmationUrl'] ?? '', cancelUrl: kv['payment.epay.cancelUrl'] ?? '', enabled: kv['payment.epay.enabled'] === 'true' }); setReferralForm({ enabled: kv['referral_enabled'] === 'true', customerPlanId: kv['referral_customer_plan_id'] ?? kv['referral_plan_id'] ?? '', customerDays: kv['referral_customer_days'] ?? kv['referral_days'] ?? '30', specialistPlanId: kv['referral_specialist_plan_id'] ?? kv['referral_plan_id'] ?? '', specialistDays: kv['referral_specialist_days'] ?? kv['referral_days'] ?? '30' }); setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: kv['seo.headScripts'] ?? '', siteTitle: kv['seo.siteTitle'] ?? '', siteDescription: kv['seo.siteDescription'] ?? '' }); setSocialForm({ telegram: kv['social.telegram'] ?? '', instagram: kv['social.instagram'] ?? '', facebook: kv['social.facebook'] ?? '', twitter: kv['social.twitter'] ?? '', youtube: kv['social.youtube'] ?? '', tiktok: kv['social.tiktok'] ?? '', whatsapp: kv['social.whatsapp'] ?? '', viber: kv['social.viber'] ?? '' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = `${key}_${templateLocale}`; const current = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // Сохраняем исходный язык в БД (если ещё не сохранён) await api.updateAdminEmailTemplate(localeKey, current); // Переводим на остальные языки const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // Обновляем state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next[`${key}_${loc}`] = tpl; } return next; }); // Сохраняем каждый перевод в БД await Promise.all(Object.entries(results).map(([loc, tpl])=>api.updateAdminEmailTemplate(`${key}_${loc}`, tpl))); } catch {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = `${key}_${templateLocale}`; setTemplateSaving(true); try { await api.updateAdminEmailTemplate(localeKey, notifTemplates[localeKey] ?? { subject: '', body: '' }); setEditingTemplate(null); } catch {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_customer_plan_id': referralForm.customerPlanId, 'referral_customer_days': referralForm.customerDays, 'referral_specialist_plan_id': referralForm.specialistPlanId, 'referral_specialist_days': referralForm.specialistDays }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle': seoForm.siteTitle, 'seo.siteDescription': seoForm.siteDescription }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch {} finally{ setSocialSaving(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; return locale === 'en' ? cat.namesEn || cat.namesEl : locale === 'ru' ? cat.namesRu || cat.namesEl : cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; return locale === 'en' ? loc.nameEn || loc.nameEl : locale === 'ru' ? loc.nameRu || loc.nameEl : loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }) }, { key: 'users', label: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" }) ] }) }, { key: 'tasks', label: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" }) }) }, { key: 'reports', label: t('admin.tab.reports'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" }) }) }, { key: 'locations', label: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Баланс'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" }) ] }) }, { key: 'backup', label: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }) } ]; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-blue-100 text-blue-700', completed: 'bg-gray-100 text-gray-600', cancelled: 'bg-red-100 text-red-600', draft: 'bg-yellow-100 text-yellow-700' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { spam: 'bg-orange-100 text-orange-700', inappropriate: 'bg-red-100 text-red-700', fraud: 'bg-purple-100 text-purple-700', duplicate: 'bg-blue-100 text-blue-700', other: 'bg-gray-100 text-gray-600' }; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-blue-600 transition", 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: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: `shrink-0 transition-all duration-200 ${sidebarCollapsed ? 'w-12' : 'w-52'}`, children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'Развернуть меню' : 'Свернуть меню', className: "w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition", children: /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 transition-transform duration-200 ${sidebarCollapsed ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map(({ key, label, icon })=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: `w-full flex items-center py-3 text-sm font-medium text-left transition ${tab === key ? 'bg-blue-50 text-blue-700 border-r-2 border-blue-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'} ${sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'}`, children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsx("span", { children: label }) ] }, key)) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats?.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }), color: 'text-blue-600' }, { label: t('admin.stats.specialists'), value: stats?.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats?.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }), color: 'text-green-600' }, { label: t('admin.stats.offers'), value: stats?.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.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" }) }), color: 'text-orange-500' }, { label: t('admin.stats.reviews'), value: stats?.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" }) }), color: 'text-yellow-500' } ].map(({ label, value, icon, color })=>/*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: `mb-2 ${color}`, children: icon }), /*#__PURE__*/ _jsx("div", { className: `text-3xl font-bold ${color}`, children: value ?? '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label)) }), stats?.tasksByDay && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-blue-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), stats?.tasksByStatus && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-blue-50', bar: 'bg-blue-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map(({ status, count: c })=>{ const meta = statusMeta[status] ?? { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-3 px-3 py-2 rounded-lg ${meta.bg}`, children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: `h-full rounded-full ${meta.bar} transition-all`, style: { width: `${pct}%` } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number(stats.totalCostUsd ?? 0).toFixed(4) ] }) ] }) ] }), stats.tokensByMonth?.length > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('admin.users.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "customer", children: t('profile.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('profile.role.specialist') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: "Тариф" }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-600'}`, children: t(`profile.role.${u.role}`) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? planRows.find((p)=>p.id === u.planId)?.name ?? /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "…" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'}`, children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: `text-xs px-3 py-1 rounded-lg font-medium ${u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'}`, children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id)) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('admin.balance.filter.user_id', 'Фильтр по userId'), className: "flex-1 min-w-72 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'Все операции') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Пополнение') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Списание за тариф') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Пополнение админом') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Корректировка') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Операция') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Сумма') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Баланс') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Описание') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Дата') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'Записей пока нет') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Пополнение') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Списание за тариф') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Пополнение админом') : t('admin.balance.kind.admin_adjustment', 'Корректировка'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'}`, children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: `px-4 py-3 font-semibold ${isCredit ? 'text-emerald-700' : 'text-rose-700'}`, children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('admin.tasks.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t(`task.status.${s}`, s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: `/tasks/${task.id}`, className: "hover:text-blue-600 truncate block", target: "_blank", children: task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: customer?.name ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[task.status] ?? 'bg-gray-100 text-gray-600'}`, children: t(`task.status.${task.status}`, task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? `${formatPrice(task.budget)}€` : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx("input", { value: catForm.icon, onChange: (e)=>setCatForm((f)=>f && { ...f, icon: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "\uD83D\uDCE6" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>/*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reportStatusColors[r.status] ?? 'bg-gray-100 text-gray-500'}`, children: r.status }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reasonColors[r.reason] ?? 'bg-gray-100 text-gray-600'}`, children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? `/tasks/${r.targetId}` : `/users/${r.targetId}`, className: "text-blue-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", r.targetId?.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.id, 'reviewed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.id, 'dismissed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.reports.dismiss') }) ] }) ] }) }, r.id)), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map(({ key, label })=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: `px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'}`, children: label }, key)) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>/*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'}`, children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? `${log.fromLocale} → ${log.toLocale}` : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: log.inputTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: log.outputTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: log.totalTokens ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: log.durationMs ?? '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: log.error ?? '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id)) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t(`admin.event.${ev.replace(/\./g, '_')}`, ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof details?.provider === 'string' ? details.provider : '—'; const recipient = typeof details?.to === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof details?.subject === 'string' ? details.subject : ''; const error = typeof details?.error === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t(`admin.event.${entry.event.replace(/\./g, '_')}`, entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>/*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: n.recipientName ?? n.recipientEmail ?? n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id)) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-blue-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-blue-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-blue-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.oldPrice ?? '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.role') }), /*#__PURE__*/ _jsxs("select", { value: planForm.role, onChange: (e)=>setPlanForm({ ...planForm, role: e.target.value }), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "customer", children: t('admin.plans.form.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('admin.plans.form.role.specialist') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_profiles') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxProfiles, onChange: (e)=>setPlanForm({ ...planForm, maxProfiles: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_portfolio') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxPortfolioItems, onChange: (e)=>setPlanForm({ ...planForm, maxPortfolioItems: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), 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("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map(([key, label])=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map(([key, label])=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.name, className: "bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((plan)=>/*#__PURE__*/ _jsxs("div", { className: `flex items-start gap-4 px-4 py-4 ${!plan.isActive ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-blue-100 text-blue-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-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, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.plans.notify_tasks') ] }) ] }), (plan.features ?? []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id)) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit", children: [ 'general', 'smtp', 'notifications', 'payment', 'referral', 'seo', 'socials' ].map((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: `px-4 py-2 rounded-lg text-sm font-medium transition ${settingsTab === st ? 'bg-blue-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'}`, children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), 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", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), 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", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), 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", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), 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", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), 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", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), 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", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), 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", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), 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", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult(`✓ Отправлено на ${res.to}`); } catch (e) { setTestEmailResult(`✗ Ошибка: ${e.message}`); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, className: "w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition", children: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", 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: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: `text-sm text-center font-medium ${testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'}`, children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0", children: "PB" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "Греческий платёжный шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${ePayForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${ePayForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('admin.settings.merchant_id'), 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", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", 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: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", 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: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", 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: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", 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", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-2 mb-4 p-3 bg-blue-50 border border-blue-100 rounded-xl text-sm text-blue-700", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = `{{${name}}}`; return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-blue-100 text-blue-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'registration_success', label: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'password_reset', label: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }) }, { key: 'new_offer', label: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-purple-500 shrink-0", 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.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) }) }, { key: 'new_task', label: t('admin.notif.new_task'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-indigo-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'offer_accepted', label: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-pink-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'offer_declined', label: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'offer_other_accepted', label: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'task_updated', label: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }, { key: 'deadline_reminder', label: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'task_archived', label: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6" }) }) }, { key: 'referral_reward', label: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-emerald-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'plan_upgraded', label: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, 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" }) }) }, { key: 'plan_downgrade_applied', label: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-orange-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" }) }) }, { key: 'plan_insufficient_funds', label: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-red-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) } ].map(({ key, label, icon })=>{ const localeKey = `${key}_${templateLocale}`; const tmpl = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; const isEditing = editingTemplate === key; const templateVars = TEMPLATE_VARS[key] ?? []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: `text-gray-400 transition-transform ${isEditing ? 'rotate-90' : ''}`, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${templateLocale === loc ? 'bg-blue-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'}`, children: loc === 'el' ? 'Ελληνικά' : loc === 'en' ? 'English' : 'Русский' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, subject: e.target.value } })), 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-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, body: e.target.value } })), 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 font-mono resize-y", placeholder: "

Уважаемый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = `{{${name}}}`; return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${referralForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${referralForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.customer_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.customerPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, customerPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'customer').map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.customerDays, onChange: (e)=>setReferralForm((f)=>({ ...f, customerDays: e.target.value })), 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("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.specialist_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.specialistPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'specialist').map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.specialistDays, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistDays: e.target.value })), 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("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" }) }) }, { key: 'instagram', label: 'Instagram', placeholder: 'https://instagram.com/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" }) }) }, { key: 'facebook', label: 'Facebook', placeholder: 'https://facebook.com/yourpage', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" }) }) }, { key: 'twitter', label: 'X (Twitter)', placeholder: 'https://x.com/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }) }, { key: 'youtube', label: 'YouTube', placeholder: 'https://youtube.com/@yourchannel', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" }) }) }, { key: 'tiktok', label: 'TikTok', placeholder: 'https://tiktok.com/@yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z" }) }) }, { key: 'whatsapp', label: 'WhatsApp', placeholder: 'https://wa.me/30xxxxxxxxxx', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z" }) }) }, { key: 'viber', label: 'Viber', placeholder: 'viber://chat?number=30xxxxxxxxxx', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z" }) }) } ].map(({ key, label, placeholder, icon })=>/*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: `${socialForm[key] ? 'text-blue-600' : 'text-gray-300'}`, children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "не заполнено" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${socialForm[key] ? 'border-blue-300 bg-blue-50/30' : 'border-gray-300'}` }) ] }, key)), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.indexingEnabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm.siteTitle, onChange: (e)=>setSeoForm((f)=>({ ...f, siteTitle: e.target.value })), 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", placeholder: "CanHelp — Βρες ειδικό για κάθε δουλειά" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm.siteDescription, onChange: (e)=>setSeoForm((f)=>({ ...f, siteDescription: e.target.value })), 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", placeholder: "Η ελληνική πλατφόρμα για online ανάθεση εργασιών..." }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: `${backupMsgError ? 'bg-red-50 border-red-200 text-red-700' : 'bg-green-50 border-green-200 text-green-700'} border rounded-lg px-4 py-2 text-sm flex items-center justify-between`, children: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: `${backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700'} ml-4`, children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch {} setBackupAutoSaving(false); }, className: `relative w-11 h-6 rounded-full transition-colors ${backupAutoEnabled ? 'bg-blue-600' : 'bg-gray-300'} ${backupAutoSaving ? 'opacity-50' : ''}`, children: /*#__PURE__*/ _jsx("span", { className: `absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ${backupAutoEnabled ? 'translate-x-5' : 'translate-x-0'}` }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/export`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `backup_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, className: "bg-blue-600 hover:bg-blue-700 text-white text-sm px-4 py-2 rounded-lg font-medium disabled:opacity-50 flex items-center gap-2", 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _jsxs("label", { className: `bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm px-4 py-2 rounded-lg font-medium cursor-pointer flex items-center gap-2 ${backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''}`, 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/import`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-blue-600 hover:text-blue-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 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" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/export/${tbl}`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `${tbl}_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.message || 'Error'); } }, className: "text-blue-600 hover:text-blue-800 font-medium text-xs px-2 py-1 rounded border border-blue-200 hover:bg-blue-50", children: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _jsxs("label", { className: "text-gray-600 hover:text-gray-800 font-medium text-xs px-2 py-1 rounded border border-gray-200 hover:bg-gray-100 cursor-pointer", children: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch(`${BASE}/api/admin/backup/import/${tbl}`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _jsx("nav", { className: "w-44 flex-shrink-0 border-r border-gray-100 py-3 space-y-0.5 px-2", children: [ { id: 'profile', label: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: `w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ${editUserTab === item.id ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50'}`, children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: editUser.firstName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), 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('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: editUser.lastName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), 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('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: editUser.phone ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), 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('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: editUser.bio ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.target.value })), rows: 5, 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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _jsx("div", { className: "w-full border border-gray-200 bg-gray-50 rounded-lg px-3 py-2 text-sm text-gray-600 select-all", children: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", 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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z", clipRule: "evenodd" }) }), /*#__PURE__*/ _jsx("span", { className: `text-sm font-medium ${editUser.emailVerified ? 'text-green-700' : 'text-red-600'}`, children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "customer", children: t('admin.user_edit.role.customer') }), /*#__PURE__*/ _jsx("option", { value: "specialist", children: t('admin.user_edit.role.specialist') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: editUser.planId ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: editUser.locale ?? 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "Ελληνικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "Русский" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'ru' ].map((lang)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (editUser.languages ?? []).includes(lang), onChange: (e)=>{ const langs = editUser.languages ?? []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'Ελληνικά' : lang === 'en' ? 'English' : 'Русский' }) ] }, lang)) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('topup'), className: "flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-sm font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('withdraw'), className: "flex items-center gap-1.5 px-4 py-2 bg-rose-600 hover:bg-rose-700 text-white rounded-lg text-sm font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.showContactInfo ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.notifyNewTasks ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.notifMessages ?? true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 items-center border border-gray-300 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-blue-400", children: [ /*#__PURE__*/ _jsx("span", { className: "px-3 py-2 text-sm text-gray-400 bg-gray-50 border-r border-gray-300 flex-shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: editUser.personalSiteSlug ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: `/site/${editUser.personalSiteSlug}`, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 px-3 py-2 border border-gray-300 rounded-lg text-sm text-blue-600 hover:bg-blue-50 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, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (editUser.siteSettings ?? {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, [item.key]: e.target.checked } })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }, item.key)) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (editUser.siteSettings ?? {}).siteTheme ?? 'dark', onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, siteTheme: e.target.value } })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: (editUser.skills ?? []).map((s)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>({ ...u, skills: (u.skills ?? []).filter((x)=>x !== s) })), className: "text-blue-400 hover:text-blue-700 leading-none", 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.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); } }, placeholder: t('admin.user_edit.skill_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", { onClick: ()=>{ const val = skillInput.trim(); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); }, className: "px-3 py-2 bg-blue-600 text-white rounded-lg text-sm hover:bg-blue-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: card.title ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('admin.user_edit.card_title'), 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__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.active') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: card.description ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('admin.user_edit.card_description'), 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", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.skills ?? []).map((s)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: (c.skills ?? []).filter((x)=>x !== s) } : c)), className: "text-blue-400 hover:text-blue-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: cardSkillInputs[card.id] ?? '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && (cardSkillInputs[card.id] ?? '').trim()) { e.preventDefault(); const val = (cardSkillInputs[card.id] ?? '').trim().replace(/,$/, ''); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('admin.user_edit.skill_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = (cardSkillInputs[card.id] ?? '').trim(); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-blue-600 text-white rounded-lg text-xs hover:bg-blue-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.categories ?? []).map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-purple-50 text-purple-700 px-2 py-0.5 rounded-full", children: [ getCatLabel(catRows.find((c)=>c.slug === slug) ?? { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: (c.categories ?? []).filter((x)=>x !== slug) } : c)), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: card.categories ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: [ ...c.categories ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.locations ?? []).map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full", children: [ getLocLabel(locRows.find((l)=>l.slug === slug) ?? { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: (c.locations ?? []).filter((x)=>x !== slug) } : c)), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: card.locations ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: [ ...c.locations ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.id], className: "px-4 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-medium disabled:opacity-50", children: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id)) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-blue-600 hover:bg-blue-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: `bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ${balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'}`, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: `text-base font-semibold ${balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: `block text-sm font-medium mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? editUser.topUpAmount ?? '' : editUser.withdrawAmount ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400'}` }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: `block text-sm font-medium mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? editUser.topUpDescription ?? '' : editUser.withdrawDescription ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400'}` }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: `flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ${balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'}`, children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } function LocTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!loc.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-blue-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" }) }) : /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((cat)=>{ const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: `flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ${!cat.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "text-lg w-7 text-center", children: cat.icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || cat.names?.en }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, cat.id); }) }); } function Pagination({ page, total, limit, onChange, totalLabel }) { const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }), labelKey: 'admin.event.user_login', color: 'bg-blue-50 text-blue-700 border-blue-100' }, 'user.register': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" }) }), labelKey: 'admin.event.user_register', color: 'bg-green-50 text-green-700 border-green-100' }, 'admin.user.deactivate': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "4.93", y1: "4.93", x2: "19.07", y2: "19.07" }) ] }), labelKey: 'admin.event.admin_user_deactivate', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.user.activate': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }), labelKey: 'admin.event.admin_user_activate', color: 'bg-emerald-50 text-emerald-700 border-emerald-100' }, 'admin.user.role_changed': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" }) }), labelKey: 'admin.event.admin_user_role_changed', color: 'bg-purple-50 text-purple-700 border-purple-100' }, 'admin.task.cancelled': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }), labelKey: 'admin.event.admin_task_cancelled', color: 'bg-orange-50 text-orange-700 border-orange-100' }, 'admin.task.deleted': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2" }) ] }), labelKey: 'admin.event.admin_task_deleted', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.report.reviewed': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }), labelKey: 'admin.event.admin_report_reviewed', color: 'bg-teal-50 text-teal-700 border-teal-100' }, 'admin.report.dismissed': { icon: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), labelKey: 'admin.event.admin_report_dismissed', color: 'bg-gray-50 text-gray-600 border-gray-200' }, 'task.created': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }), labelKey: 'admin.event.task_created', color: 'bg-indigo-50 text-indigo-700 border-indigo-100' } }; function ActivityLogRow({ entry, dateLocale, onFilterUser, t }) { const meta = EVENT_META[entry.event] ?? { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, 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" }) }), labelKey: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _jsxs("span", { className: `shrink-0 mt-0.5 px-2.5 py-1 rounded-lg border text-xs font-semibold flex items-center gap-1.5 ${meta.color}`, children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-blue-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map(([k, v])=>/*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k)) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart({ series, dateLocale = 'en-US' }) { // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>map[m] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: `0 0 ${W} ${H + 14}`, className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, `bar-${mi}-${si}`); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? ` ${yr}` : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, `xl-${mi}`); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = `M ${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`; for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += ` C ${cpx} ${pts[i - 1][1].toFixed(1)} ${cpx} ${pts[i][1].toFixed(1)} ${pts[i][0].toFixed(1)} ${pts[i][1].toFixed(1)}`; } return d; } function fmtYLabel(v) { if (v >= 1000000) return `${+(v / 1000000).toFixed(1)}M`; if (v >= 1000) return `${Math.round(v / 1000)}K`; return String(v); } function AdminAreaChart({ series, days: daysProp }) { const days = daysProp ?? getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>map[d] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return `${line} L ${lastX} ${chartH.toFixed(1)} L ${padL.toFixed(1)} ${chartH.toFixed(1)} Z`; } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: `0 0 ${W} ${H + 12}`, className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), xTicks.map(({ i })=>{ const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, `vg-${i}`); }), xTicks.map(({ i, label })=>/*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i)), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, `fill-${si}`)), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, `line-${si}`)), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, `dot-${si}`); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } @`=_;=ik  `h(_, ,/JNCFUY!"$"3#6#L$O$/&2&$(((*_*{+~+----..1.6.v.~.00=1A122<4?4~5566k7n78899:_:;;??L@P@CCDD=F@FUGXG8I;I*K.KMM}NN8PFPqPyPPPPPP_P=QDQQQR R>RERrRyRRRRR SS@SGSySSSSSSTTGTNTTTT_TTT/U6UgUnUUUUUVVTV[VVVVVW WHWOWWWWW XXAXHXrX_yXXXXXYYSYZYYYYY(Z/ZeZlZZZZZ"[)[b[i[[[[[=\D\w\_~\\\\\!](]Y]`]]]]]&^-^g^n^^^^^_"_W_^_____`!`X`__`````aa?aFaaaaaaa$b+bmbtbbbbbcc]cdcccBdIdd_dddeeee ffOfVfffŠɊ BI‹ɋ&,_3_f#*X_y NUӑڑ!ZaߒU_\Y`1AkĖBJtI[ow՜9_J#:J]%9jrթݩ.%)1MU_u}(9=L$5{ZlZuYr9U_({Rc,A(Vcy~"_5Jc; Q n  Lg^y &   $$%%&&'_'(())**++--..L0O0B1E1i3m3v4y45567 8899::;_;<<==>>s?v?@@AAzB}BFFGGJJCKGKKK\L`LMM NN O_O-P1P3P6P1Q4QRR_TcTTTUUpVsVoXrXIZLZ\\d^g^__a"aaab_b@dCdffnirikknnkrnrEtHtwwyyN}Q}(+܂^a@_D.2,/ӏ׏;>*-۞ޞbf_ ?C_b!=@_59WZBF04Z]}~_$(RVTW36z}imcgKN_ADP S   X [   hk_!!!h#k#=$@$&&''((**p-s-00558_888990<4<==7?:?@@AAUCXCqEuEkFoFSGVGHHHHIJLJKKM_MO!OPPS SSS=T@TV"VVVZZ[[]]^^``aaddggzh_~h0l3lmmppssssttvvA¦#'~qufj_JMͻлBE:=04!%B_E\`  EH`d_! qu   &)_fiAEeh_!c!A"D"$$F'I'-(0(+).),,o-r-s.v.u/x/80_<061:14282b3e385;57 79999<<??AACC8E;EOGSGWHZHJJM_MOO5P8PAUDU}WWXXYYb[f[O\`\^^faiabb"f%f;g>gBhEhiij_jjjkk!m$mnn6p9pqqIsLsttXv[vwwiyly{{||}}e_h͂Ђpsևه),Ќӌx{oror    _ `c  58!$)-ptݼ_6:'*25HL!%69\`_>BehGK+/|03E_HZ]-0RU/2    j m ]`r_u n q ""[#_#$$*%-%&&((`*c*,,k-n-..1_1[2^2336699:<=<@>C>AADDEE`FdFTGWG5H9HHHqJtJKKM_MOOaQdQCRGRoSrS9UϰҰIL04"il`c),<@L_PMP58ru\ztw_\zqu_b% + JN8;_>AVY   a!e!""#$ $6$--+0_.0)6G6L6b6CCMDQDKEOEiFmFG GvHzHeKhKhMlMGNJNVVXX_YtYZ0Z^_^__``?bCb cc{ggFhJh)m-mSnWn o#opqwu{uDvGv"x%x!}%}}}_ux-0GKLP  ÎƎ*.•ŕIL'*fidgۣ_ߣ ҥե]`8;.2Դشwz(,&*be(+T_XRUIM ae.1_KN~    a e       ( +  _       F I   # '   ^# a# ( ( ) ) y* |* @, D, - - @/ C/ V1 _Y1 6 6 B9 E9 ; ; [@ _@ a@ i@ A A B B P Q |R R NT QT .[ 2[ ^\ a\ 7^ ;^ qc tc Be Ee yi _}i ~j j ;k >k l l n n p p t t v v V Z [ ^ ʍ ͍ 2 5 * .  _ < @     X \ ˴ ϴ I L + /   1 4 _   ; > . 1 8 ;      # T _W   P T B E           _ b S V w" {" # # % % + + c, f, 2 _2 5 5 5 6 u7 y7 7 7 9 9 {: ~: ; ; < < = = > > p? s? @ @ ^B bB C C PE SE F _F kG nG cH fH ZI ^I K !K L L LM OM O O P P R R U U U U W W PW TW X X Z Z o[ _r[ \ \ ] ] 1^ 4^ ^ ^ _ _ l` o` da ga mb qb 1d 4d e e Pf Sf h h i i k k 0n 4n n _n o o p p _q cq ~r r u u u u w w Wx Zx y y z z l{ o{ | | } } % (   t _x [ ^   i l   ؊ ۊ я ԏ b _f   _ c ٔ ݔ " % Ƙ ʘ / 2   m l ¢ Ţ   p t ˤ _Τ ) , ¨   L O   Y ] N Q e h  ʿ Ϳ   @ (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(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)(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j__lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k__lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc(next_link__WEBPACK_IMPORTED_MODULE_3___default())(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI"https://api.canhelp.gr"0000_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyreact_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment(/* unused pure expression or super */ null && ())buffersourcesizemapsGc __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* 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__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8293); /* __next_internal_client_entry_do_not_use__ default auto */ const TEMPLATE_VARS = { registration_success: [ 'userName', 'link', 'siteName', 'siteUrl' ], email_verification: [ 'userName', 'link', 'siteName', 'siteUrl' ], password_reset: [ 'userName', 'link', 'siteName', 'siteUrl' ], new_offer: [ 'userName', 'taskTitle', 'taskId', 'specialistName', 'price', 'link' ], new_task: [ 'userName', 'taskTitle', 'taskId', 'customerName', 'link' ], offer_accepted: [ 'userName', 'taskTitle', 'price', 'link' ], new_message: [ 'userName', 'senderName', 'preview', 'link' ], offer_declined: [ 'userName', 'taskTitle', 'taskId', 'link' ], offer_other_accepted: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_updated: [ 'userName', 'taskTitle', 'taskId', 'link' ], deadline_reminder: [ 'userName', 'taskTitle', 'taskId', 'link' ], task_archived: [ 'userName', 'taskTitle', 'taskId', 'link' ], referral_reward: [ 'userName', 'days', 'planName', 'link' ], plan_activated: [ 'userName', 'planName', 'price', 'expiresAt', 'link' ], plan_upgraded: [ 'userName', 'oldPlanName', 'newPlanName', 'charged', 'expiresAt', 'link' ], plan_downgrade_scheduled: [ 'userName', 'currentPlanName', 'newPlanName', 'scheduledDate', 'link' ], plan_downgrade_applied: [ 'userName', 'planName', 'link' ], plan_renewal_reminder: [ 'userName', 'planName', 'amount', 'expiresAt', 'link' ], plan_insufficient_funds: [ 'userName', 'currentPlanName', 'requiredAmount', 'currentBalance', 'expiresAt', 'topUpLink' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); function getCatLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.namesEn || row.namesEl || row.slug || '' : locale === 'ru' ? row.namesRu || row.namesEl || row.slug || '' : row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; return locale === 'en' ? row.nameEn || row.nameEl || row.slug || '' : locale === 'ru' ? row.nameRu || row.nameEl || row.slug || '' : row.nameEl || row.nameEn || row.slug || ''; } function AdminCatPicker({ catRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", 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: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, 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: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm leading-none shrink-0", children: parent.icon }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, 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: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker({ locRows, locale, selected, onAdd, addLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>!search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || (r.slug ?? '').toLowerCase().includes(lowerSearch); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: `w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ${open ? 'rounded-t-lg border border-blue-400 bg-white text-gray-900' : 'rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 text-blue-400 shrink-0", 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: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3 h-3 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, 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: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-blue-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "Поиск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800", onClick: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-blue-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, 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: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: "w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600", onClick: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } function AdminPage() { const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [tab, setTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('stats'); const [sidebarCollapsed, setSidebarCollapsed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Users const [users, setUsers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [usersPage, setUsersPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [usersTotal, setUsersTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [usersQ, setUsersQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersQInput, setUsersQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersRole, setUsersRole] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Tasks const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [tasksPage, setTasksPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [tasksTotal, setTasksTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [tasksQ, setTasksQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksQInput, setTasksQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksStatus, setTasksStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Reports const [reports, setReports] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [reportsPage, setReportsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [reportsTotal, setReportsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // AI Logs const [logs, setLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [logsPage, setLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [logsTotal, setLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Activity Logs const [activityLog, setActivityLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [activityTotal, setActivityTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [activityPage, setActivityPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [activityEvent, setActivityEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityUserId, setActivityUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateFrom, setActivityDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateTo, setActivityDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityEventTypes, setActivityEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Mail Logs const [mailLog, setMailLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailTotal, setMailTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [mailPage, setMailPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [mailEvent, setMailEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateFrom, setMailDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateTo, setMailDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailEventTypes, setMailEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('ai'); // Notification Logs const [notifLogs, setNotifLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsPage, setNotifLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [notifLogsTotal, setNotifLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [notifLogsType, setNotifLogsType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsTypes, setNotifLogsTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsDateTo, setNotifLogsDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailByDay, setMailByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Balance archive const [balanceRows, setBalanceRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [balanceTotal, setBalanceTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [balancePage, setBalancePage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [balanceUserId, setBalanceUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceKind, setBalanceKind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topUpSaving, setTopUpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [withdrawSaving, setWithdrawSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // User edit modal const [editUser, setEditUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editUserSaving, setEditUserSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyingEmail, setVerifyingEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editUserTab, setEditUserTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('profile'); const [balanceModal, setBalanceModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editUserCards, setEditUserCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [editUserCardsLoading, setEditUserCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardSkillInputs, setCardSkillInputs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardSaving, setCardSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardCatSelects, setCardCatSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardLocSelects, setCardLocSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); // Plans const [planRows, setPlanRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planForm, setPlanForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [planSaving, setPlanSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Locations const [locRows, setLocRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locForm, setLocForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [locSaving, setLocSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [locExpanded, setLocExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Categories const [catRows, setCatRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [catForm, setCatForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [catSaving, setCatSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catExpanded, setCatExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Settings const [settingsTab, setSettingsTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [generalForm, setGeneralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [generalSaved, setGeneralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpForm, setSmtpForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpSaved, setSmtpSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailSending, setTestEmailSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailResult, setTestEmailResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [notifTemplates, setNotifTemplates] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ email_verification: { subject: 'Подтвердите ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'Добро пожаловать в {{siteName}}!', body: '' }, password_reset: { subject: 'Восстановление пароля — {{siteName}}', body: '' }, new_offer: { subject: 'Новое предложение по вашей задаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'Новая задача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше предложение принято: {{taskTitle}}', body: '

Ваше предложение принято! 🎉

Привет, {{userName}}!

Заказчик принял ваше предложение на выполнение задачи:

{{taskTitle}}

Сумма: {{price}}€

Открыть чат →' }, new_message: { subject: 'Новое сообщение от {{senderName}}', body: '

Новое сообщение

Привет, {{userName}}!

Вам написал(а) {{senderName}}:

"{{preview}}"

Ответить →' }, offer_declined: { subject: 'Ваше предложение отклонено: {{taskTitle}}', body: '

Ваше предложение отклонено

Привет, {{userName}}!

К сожалению, заказчик отклонил ваше предложение на:

{{taskTitle}}

Найти другие заказы →' }, offer_other_accepted: { subject: 'Выбран другой исполнитель: {{taskTitle}}', body: '

Выбран другой исполнитель

Привет, {{userName}}!

Заказчик выбрал другого исполнителя для задания:

{{taskTitle}}

Найти другие заказы →' }, task_updated: { subject: 'Задание обновлено: {{taskTitle}}', body: '

Задание обновлено

Привет, {{userName}}!

Заказчик обновил детали задания:

{{taskTitle}}

Смотреть заказ →' }, deadline_reminder: { subject: 'Задание истекает завтра: {{taskTitle}}', body: '

Напоминание о дедлайне

Привет, {{userName}}!

Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.

{{taskTitle}}

Редактировать задание →' }, task_archived: { subject: 'Задание снято с публикации: {{taskTitle}}', body: '

Задание переведено в черновик

Привет, {{userName}}!

Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.

{{taskTitle}}

Редактировать задание →' }, referral_reward: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' }, referral_reward_el: { subject: 'Λάβατε ανταμοιβή παραπομπής — {{siteName}}', body: '

Λάβατε ανταμοιβή παραπομπής! 🎁

Γεια {{userName}},

Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν {{days}} ημέρες πρόσβασης στο πλάνο {{planName}}!

+{{days}} ημέρες — {{planName}}

Δες τον λογαριασμό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы получили реферальную награду — {{siteName}}', body: '

Вы получили реферальную награду! 🎁

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →' } }); const [editingTemplate, setEditingTemplate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [templateLocale, setTemplateLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [templateSaving, setTemplateSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [templateTranslating, setTemplateTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePayForm, setEPayForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePaySaved, setEPaySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralForm, setReferralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ enabled: false, customerPlanId: '', customerDays: '30', specialistPlanId: '', specialistDays: '30' }); const [referralSaving, setReferralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralSaved, setReferralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoForm, setSeoForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitle: '', siteDescription: '' }); const [seoSaving, setSeoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoSaved, setSeoSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialForm, setSocialForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialSaved, setSocialSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupAutoSaving, setBackupAutoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupTables, setBackupTables] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupTablesLoading, setBackupTablesLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupStoredFiles, setBackupStoredFiles] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupExporting, setBackupExporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupImporting, setBackupImporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupRestoring, setBackupRestoring] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsg, setBackupMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsgError, setBackupMsgError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const isAdmin = !isPending && session && session.user?.role === 'admin'; process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); if (!isPending && session && session.user?.role !== 'admin') router.push('/'); }, [ session, isPending ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE().then(setStats).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi().then(setNotifsByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4().then(setMailByDay).catch(()=>{}); }, [ isAdmin ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ setActivityLog(d.data); setActivityTotal(d.total); if (d.eventTypes?.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ setMailLog(d.data); setMailTotal(d.total); if (d.eventTypes?.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ setNotifLogs(d.data); setNotifLogsTotal(d.total); if (d.notifTypes?.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'plans') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'backup') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function toggleUser(id, isActive) { const fn = isActive ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi : _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: editUser.languages ?? [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: editUser.showContactInfo ?? false, notifyNewTasks: editUser.notifyNewTasks ?? false, notifMessages: editUser.notifMessages ?? true, skills: editUser.skills ?? [], siteSettings: editUser.siteSettings ?? {} }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { title: card.title, description: card.description || null, skills: card.skills ?? [], categories: card.categories ?? [], locations: card.locations ?? [], isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function cancelTask(id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm(`${t('admin.tasks.delete.confirm')}\n"${title}"`)) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>(row.task?.id || row.id) !== id)); } async function handleReport(id, status) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'locations') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId ?? null, slug: '', nameEl: '', nameEn: '', nameRu: '', order: 0, isActive: true }); } function openEditLoc(loc) { setLocForm({ id: loc.id, parentId: loc.parentId ?? null, slug: loc.slug, nameEl: loc.nameEl ?? loc.names?.el ?? '', nameEn: loc.nameEn ?? loc.names?.en ?? '', nameRu: loc.nameRu ?? loc.names?.ru ?? '', order: loc.order ?? 0, isActive: loc.isActive ?? true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm(`${t('admin.loc.delete.confirm')}\n"${name}"`)) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'categories') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddCat(parentId) { setCatForm({ parentId: parentId ?? null, slug: '', icon: '📦', namesEl: '', namesEn: '', namesRu: '', order: 0, isActive: true }); } function openEditCat(cat) { setCatForm({ id: cat.id, parentId: cat.parentId ?? null, slug: cat.slug, icon: cat.icon, namesEl: cat.namesEl ?? cat.names?.el ?? '', namesEn: cat.namesEn ?? cat.names?.en ?? '', namesRu: cat.namesRu ?? cat.names?.ru ?? '', order: cat.order ?? 0, isActive: cat.isActive ?? true }); } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm(`${t('admin.cat.delete.confirm')}\n"${name}"`)) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } function openAddPlan() { setPlanForm({ name: '', description: '', role: 'specialist', tier: 'free', price: '0', oldPrice: '', currency: 'EUR', maxTasks: '', maxOffers: '', maxCards: '', maxMessagesPerDay: '', maxOrdersPerDay: '', maxSkills: '', maxProfiles: '', maxPortfolioItems: '', durationDays: '', searchBoost: 0, offersMultiplier: '1.00', features: '', isDefault: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { setPlanForm({ id: plan.id, name: plan.name, description: plan.description ?? '', role: plan.role ?? 'specialist', tier: plan.tier ?? 'free', price: plan.price ?? '0', oldPrice: plan.oldPrice ?? '', currency: plan.currency ?? 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', maxProfiles: plan.maxProfiles != null ? String(plan.maxProfiles) : '', maxPortfolioItems: plan.maxPortfolioItems != null ? String(plan.maxPortfolioItems) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: plan.searchBoost ?? 0, offersMultiplier: plan.offersMultiplier ?? '1.00', features: (plan.features ?? []).join('\n'), isDefault: plan.isDefault ?? false, isActive: plan.isActive ?? true, order: plan.order ?? 0, notifyNewTasks: plan.notifyNewTasks ?? false, canContactFreePlan: plan.canContactFreePlan ?? false, canContactProPlan: plan.canContactProPlan ?? true, canContactAll: plan.canContactAll ?? false, canShowContactInfo: plan.canShowContactInfo ?? false, canViewPhone: plan.canViewPhone ?? false, canUploadVideo: plan.canUploadVideo ?? false, hasFavorites: plan.hasFavorites ?? false, hasGoogleCalendar: plan.hasGoogleCalendar ?? false, hasVerifiedBadge: plan.hasVerifiedBadge ?? false, highlightedReviews: plan.highlightedReviews ?? false, hasPersonalSite: plan.hasPersonalSite ?? false, hasCanHelpNowStatus: plan.hasCanHelpNowStatus ?? false, hasNeedHelpStatus: plan.hasNeedHelpStatus ?? false, hasAutoResponse: plan.hasAutoResponse ?? false, hasAutoMatch: plan.hasAutoMatch ?? false, receiveInstantDispatchFree: plan.receiveInstantDispatchFree ?? false, receiveInstantDispatchPro: plan.receiveInstantDispatchPro ?? false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, maxProfiles: planForm.maxProfiles ? Number(planForm.maxProfiles) : null, maxPortfolioItems: planForm.maxPortfolioItems ? Number(planForm.maxPortfolioItems) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm(`Удалить тариф "${name}"?`)) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC().then((kv)=>{ setGeneralForm({ siteName: kv['general.siteName'] ?? 'CanHelp', siteUrl: kv['general.siteUrl'] ?? '', contactEmail: kv['general.contactEmail'] ?? '', supportPhone: kv['general.supportPhone'] ?? '' }); setSmtpForm({ host: kv['smtp.host'] ?? '', port: kv['smtp.port'] ?? '587', username: kv['smtp.username'] ?? '', password: kv['smtp.password'] ?? '', fromName: kv['smtp.fromName'] ?? 'CanHelp', fromEmail: kv['smtp.fromEmail'] ?? '', encryption: kv['smtp.encryption'] ?? 'tls' }); setEPayForm({ merchantId: kv['payment.epay.merchantId'] ?? '', apiUser: kv['payment.epay.apiUser'] ?? '', apiPassword: kv['payment.epay.apiPassword'] ?? '', environment: kv['payment.epay.environment'] ?? 'test', confirmationUrl: kv['payment.epay.confirmationUrl'] ?? '', cancelUrl: kv['payment.epay.cancelUrl'] ?? '', enabled: kv['payment.epay.enabled'] === 'true' }); setReferralForm({ enabled: kv['referral_enabled'] === 'true', customerPlanId: kv['referral_customer_plan_id'] ?? kv['referral_plan_id'] ?? '', customerDays: kv['referral_customer_days'] ?? kv['referral_days'] ?? '30', specialistPlanId: kv['referral_specialist_plan_id'] ?? kv['referral_plan_id'] ?? '', specialistDays: kv['referral_specialist_days'] ?? kv['referral_days'] ?? '30' }); setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: kv['seo.headScripts'] ?? '', siteTitle: kv['seo.siteTitle'] ?? '', siteDescription: kv['seo.siteDescription'] ?? '' }); setSocialForm({ telegram: kv['social.telegram'] ?? '', instagram: kv['social.instagram'] ?? '', facebook: kv['social.facebook'] ?? '', twitter: kv['social.twitter'] ?? '', youtube: kv['social.youtube'] ?? '', tiktok: kv['social.tiktok'] ?? '', whatsapp: kv['social.whatsapp'] ?? '', viber: kv['social.viber'] ?? '' }); }).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = `${key}_${templateLocale}`; const current = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // Сохраняем исходный язык в БД (если ещё не сохранён) await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, current); // Переводим на остальные языки const results = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // Обновляем state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next[`${key}_${loc}`] = tpl; } return next; }); // Сохраняем каждый перевод в БД await Promise.all(Object.entries(results).map(([loc, tpl])=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(`${key}_${loc}`, tpl))); } catch {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = `${key}_${templateLocale}`; setTemplateSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, notifTemplates[localeKey] ?? { subject: '', body: '' }); setEditingTemplate(null); } catch {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'referral_enabled': String(referralForm.enabled), 'referral_customer_plan_id': referralForm.customerPlanId, 'referral_customer_days': referralForm.customerDays, 'referral_specialist_plan_id': referralForm.specialistPlanId, 'referral_specialist_days': referralForm.specialistDays }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle': seoForm.siteTitle, 'seo.siteDescription': seoForm.siteDescription }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch {} finally{ setSocialSaving(false); } } 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 dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; return locale === 'en' ? cat.namesEn || cat.namesEl : locale === 'ru' ? cat.namesRu || cat.namesEl : cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; return locale === 'en' ? loc.nameEn || loc.nameEl : locale === 'ru' ? loc.nameRu || loc.nameEl : loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }) }, { key: 'users', label: t('admin.tab.users'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" }) ] }) }, { key: 'tasks', label: t('admin.tab.tasks'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "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 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01" }) }) }, { key: 'reports', label: t('admin.tab.reports'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", 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 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" }) }) }, { key: 'locations', label: t('admin.tab.locations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Баланс'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" }) ] }) }, { key: 'backup', label: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }) } ]; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-blue-100 text-blue-700', completed: 'bg-gray-100 text-gray-600', cancelled: 'bg-red-100 text-red-600', draft: 'bg-yellow-100 text-yellow-700' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { spam: 'bg-orange-100 text-orange-700', inappropriate: 'bg-red-100 text-red-700', fraud: 'bg-purple-100 text-purple-700', duplicate: 'bg-blue-100 text-blue-700', other: 'bg-gray-100 text-gray-600' }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-blue-600 transition", 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: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: `shrink-0 transition-all duration-200 ${sidebarCollapsed ? 'w-12' : 'w-52'}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'Развернуть меню' : 'Свернуть меню', className: "w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 transition-transform duration-200 ${sidebarCollapsed ? 'rotate-180' : ''}`, 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: "M15 19l-7-7 7-7" }) }) }), TABS.map(({ key, label, icon })=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: `w-full flex items-center py-3 text-sm font-medium text-left transition ${tab === key ? 'bg-blue-50 text-blue-700 border-r-2 border-blue-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900'} ${sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }) ] }, key)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats?.userCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", 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: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) }), color: 'text-blue-600' }, { label: t('admin.stats.specialists'), value: stats?.specialistCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-8 h-8", 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: "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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats?.taskCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", 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 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" }) }), color: 'text-green-600' }, { label: t('admin.stats.offers'), value: stats?.offerCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", 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: "M8 12h.01M12 12h.01M16 12h.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" }) }), color: 'text-orange-500' }, { label: t('admin.stats.reviews'), value: stats?.reviewCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", 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: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" }) }), color: 'text-yellow-500' } ].map(({ label, value, icon, color })=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: `mb-2 ${color}`, children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: `text-3xl font-bold ${color}`, children: value ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label)) }), stats?.tasksByDay && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-blue-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), stats?.tasksByStatus && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-blue-50', bar: 'bg-blue-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map(({ status, count: c })=>{ const meta = statusMeta[status] ?? { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `flex items-center gap-3 px-3 py-2 rounded-lg ${meta.bg}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: `h-full rounded-full ${meta.bar} transition-all`, style: { width: `${pct}%` } }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number(stats.totalCostUsd ?? 0).toFixed(4) ] }) ] }) ] }), stats.tokensByMonth?.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__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 gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('admin.users.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "customer", children: t('profile.role.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "specialist", children: t('profile.role.specialist') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: "Тариф" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-blue-100 text-blue-700' : 'bg-gray-100 text-gray-600'}`, children: t(`profile.role.${u.role}`) || u.role }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? planRows.find((p)=>p.id === u.planId)?.name ?? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "…" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'}`, children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditUser(u), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200", 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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }), u.role !== 'admin' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: `text-xs px-3 py-1 rounded-lg font-medium ${u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'}`, children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__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 flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('admin.balance.filter.user_id', 'Фильтр по userId'), className: "flex-1 min-w-72 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)("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.balance.filter.all', 'Все операции') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "topup", children: t('admin.balance.kind.topup', 'Пополнение') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Списание за тариф') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Пополнение админом') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Корректировка') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Операция') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Сумма') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Баланс') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Описание') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Дата') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'Записей пока нет') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Пополнение') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Списание за тариф') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Пополнение админом') : t('admin.balance.kind.admin_adjustment', 'Корректировка'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'}`, children: kindLabel }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: `px-4 py-3 font-semibold ${isCredit ? 'text-emerald-700' : 'text-rose-700'}`, children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__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 gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('admin.tasks.search.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: "submit", className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: s, children: t(`task.status.${s}`, s) }, s)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: `/tasks/${task.id}`, className: "hover:text-blue-600 truncate block", target: "_blank", children: task.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 text-xs", children: customer?.name ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[task.status] ?? 'bg-gray-100 text-gray-600'}`, children: t(`task.status.${task.status}`, task.status) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? `${(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(task.budget)}€` : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deleteTask(task.id, task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__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 justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", 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-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__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: t('admin.cat.icon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.icon, onChange: (e)=>setCatForm((f)=>f && { ...f, icon: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "\uD83D\uDCE6" }) ] }), /*#__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: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__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)("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setCatForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, t: t }) }) ] }), tab === 'locations' && /*#__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 justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-blue-50 border border-blue-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", 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-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__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)("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLocForm(null), className: "px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reportStatusColors[r.status] ?? 'bg-gray-100 text-gray-500'}`, children: r.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${reasonColors[r.reason] ?? 'bg-gray-100 text-gray-600'}`, children: r.reason }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: r.targetType === 'task' ? `/tasks/${r.targetId}` : `/users/${r.targetId}`, className: "text-blue-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ "#", r.targetId?.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.id, 'reviewed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: t('admin.reports.reviewed') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.id, 'dismissed'), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.reports.dismiss') }) ] }) ] }) }, r.id)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'logs' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map(({ key, label })=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLogsSubTab(key), className: `px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'}`, children: label }, key)) }), logsSubTab === 'ai' && /*#__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 justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setLogsPage(1); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'}`, children: log.provider }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? `${log.fromLocale} → ${log.toLocale}` : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: log.inputTokens ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: log.outputTokens ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right font-medium", children: log.totalTokens ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-500", children: log.durationMs ?? '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", 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.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 flex justify-center", title: log.error ?? '', children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", 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-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__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-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", 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-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: t(`admin.event.${ev.replace(/\./g, '_')}`, ev) }, ev)) ] }) ] }), /*#__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-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof details?.provider === 'string' ? details.provider : '—'; const recipient = typeof details?.to === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof details?.subject === 'string' ? details.subject : ''; const error = typeof details?.error === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t(`admin.event.${entry.event.replace(/\./g, '_')}`, entry.event) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), 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.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", 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-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__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-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__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-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, className: "text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: n.recipientName ?? n.recipientEmail ?? n.recipientId }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-700", children: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", 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.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 flex justify-center", 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)("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id)) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__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 justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 text-blue-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: openAddPlan, className: "bg-blue-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-blue-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.oldPrice ?? '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.role, onChange: (e)=>setPlanForm({ ...planForm, role: e.target.value }), 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", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "customer", children: t('admin.plans.form.role.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "specialist", children: t('admin.plans.form.role.specialist') }) ] }) ] }), /*#__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: t('admin.plans.form.tier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), 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", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__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: t('admin.plans.form.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), 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)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_profiles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxProfiles, onChange: (e)=>setPlanForm({ ...planForm, maxProfiles: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_portfolio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxPortfolioItems, onChange: (e)=>setPlanForm({ ...planForm, maxPortfolioItems: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), 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)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), 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-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), 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)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map(([key, label])=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map(([key, label])=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), label ] }, key)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-blue-600" }), t('admin.plans.form.active') ] }), /*#__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)("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: savePlan, disabled: planSaving || !planForm.name, className: "bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `flex items-start gap-4 px-4 py-4 ${!plan.isActive ? 'opacity-50' : ''}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-blue-100 text-blue-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.plans.notify_tasks') ] }) ] }), (plan.features ?? []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(plan.id, { isDefault: true }).then(()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.plans.make_default'), 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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id)) }) }) ] }), tab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit", children: [ 'general', 'smtp', 'notifications', 'payment', 'referral', 'seo', 'socials' ].map((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials') }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setSettingsTab(st), className: `px-4 py-2 rounded-lg text-sm font-medium transition ${settingsTab === st ? 'bg-blue-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'}`, children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "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)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__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('admin.settings.general.site_url') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), 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", placeholder: "https://canhelp.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: t('admin.settings.general.contact_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), 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", placeholder: "contact@canhelp.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: t('admin.settings.general.support_phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), 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", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveGeneralSettings, disabled: generalSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "col-span-2", 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('admin.settings.smtp.host') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), 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", placeholder: "smtp.gmail.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: t('admin.settings.smtp.port') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), 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", placeholder: "587" }) ] }) ] }), /*#__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('admin.settings.smtp.encryption') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), 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", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__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('admin.settings.smtp.username') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), 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", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__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('admin.settings.smtp.password') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), 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", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", 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('admin.settings.smtp.from_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), 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", placeholder: "CanHelp" }) ] }), /*#__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('admin.settings.smtp.from_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), 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", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSmtpSettings, disabled: smtpSaving, className: "w-full py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 transition", children: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI(); setTestEmailResult(`✓ Отправлено на ${res.to}`); } catch (e) { setTestEmailResult(`✗ Ошибка: ${e.message}`); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, className: "w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition", children: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center justify-center gap-2", 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: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: `text-sm text-center font-medium ${testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'}`, children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0", children: "PB" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", 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)("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${ePayForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${ePayForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "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)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__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('admin.settings.merchant_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('admin.settings.merchant_id'), 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", { className: "grid grid-cols-2 gap-3", 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: "API User" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", 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: "API Password" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", 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: "Confirmation URL (webhook)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", 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: "Cancel URL" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", 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", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 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)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-2 mb-4 p-3 bg-blue-50 border border-blue-100 rounded-xl text-sm text-blue-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 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)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = `{{${name}}}`; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "mx-0.5 bg-blue-100 text-blue-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-blue-500 shrink-0", 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: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'registration_success', label: t('admin.notif.registration_success'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-500 shrink-0", 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 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'password_reset', label: t('admin.notif.password_reset'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-amber-500 shrink-0", 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: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }) }, { key: 'new_offer', label: t('admin.notif.new_offer'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-purple-500 shrink-0", 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: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) }) }, { key: 'new_task', label: t('admin.notif.new_task'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-indigo-500 shrink-0", 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 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" }) }) }, { key: 'offer_accepted', label: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600 shrink-0", 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: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-pink-500 shrink-0", 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: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }, { key: 'offer_declined', label: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0", 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: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'offer_other_accepted', label: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-orange-500 shrink-0", 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: "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" }) }) }, { key: 'task_updated', label: t('admin.notif.task_updated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-blue-500 shrink-0", 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: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }) }, { key: 'deadline_reminder', label: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", 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 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'task_archived', label: t('admin.notif.task_archived'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-400 shrink-0", 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: "M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6" }) }) }, { key: 'referral_reward', label: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-emerald-500 shrink-0", 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 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-blue-500 shrink-0", 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 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }, { key: 'plan_upgraded', label: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-500 shrink-0", 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: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-orange-400 shrink-0", 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: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }, { key: 'plan_downgrade_applied', label: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-orange-500 shrink-0", 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: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-yellow-500 shrink-0", 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: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" }) }) }, { key: 'plan_insufficient_funds', label: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-red-500 shrink-0", 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 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) } ].map(({ key, label, icon })=>{ const localeKey = `${key}_${templateLocale}`; const tmpl = notifTemplates[localeKey] ?? notifTemplates[key] ?? { subject: '', body: '' }; const isEditing = editingTemplate === key; const templateVars = TEMPLATE_VARS[key] ?? []; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-gray-400 transition-transform ${isEditing ? 'rotate-90' : ''}`, 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.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'ru' ].map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: `px-3 py-1 text-xs font-medium rounded-md transition-colors ${templateLocale === loc ? 'bg-blue-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'}`, children: loc === 'el' ? 'Ελληνικά' : loc === 'en' ? 'English' : 'Русский' }, loc)) }), /*#__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: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, subject: e.target.value } })), 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-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>({ ...prev, [localeKey]: { ...prev[localeKey] ?? { subject: '', body: '' }, body: e.target.value } })), 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 font-mono resize-y", placeholder: "

Уважаемый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = `{{${name}}}`; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5", 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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", 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", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ${referralForm.enabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${referralForm.enabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.customer_section') }), /*#__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('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.customerPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, customerPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'customer').map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_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-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.customerDays, onChange: (e)=>setReferralForm((f)=>({ ...f, customerDays: e.target.value })), 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)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.specialist_section') }), /*#__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('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.specialistPlanId, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistPlanId: e.target.value })), 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", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.filter((p)=>p.role === 'specialist').map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_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-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.specialistDays, onChange: (e)=>setReferralForm((f)=>({ ...f, specialistDays: e.target.value })), 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)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" }) }) }, { key: 'instagram', label: 'Instagram', placeholder: 'https://instagram.com/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z" }) }) }, { key: 'facebook', label: 'Facebook', placeholder: 'https://facebook.com/yourpage', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" }) }) }, { key: 'twitter', label: 'X (Twitter)', placeholder: 'https://x.com/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }) }, { key: 'youtube', label: 'YouTube', placeholder: 'https://youtube.com/@yourchannel', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" }) }) }, { key: 'tiktok', label: 'TikTok', placeholder: 'https://tiktok.com/@yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z" }) }) }, { key: 'whatsapp', label: 'WhatsApp', placeholder: 'https://wa.me/30xxxxxxxxxx', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z" }) }) }, { key: 'viber', label: 'Viber', placeholder: 'viber://chat?number=30xxxxxxxxxx', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z" }) }) } ].map(({ key, label, placeholder, icon })=>/*#__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 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `${socialForm[key] ? 'text-blue-600' : 'text-gray-300'}`, children: icon }), label, !socialForm[key] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "не заполнено" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ${socialForm[key] ? 'border-blue-300 bg-blue-50/30' : 'border-gray-300'}` }) ] }, key)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", 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", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", 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", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: `relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ${seoForm.indexingEnabled ? 'bg-blue-600' : 'bg-gray-300'}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ${seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1'}` }) }) ] }), /*#__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('admin.settings.seo.site_title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: seoForm.siteTitle, onChange: (e)=>setSeoForm((f)=>({ ...f, siteTitle: e.target.value })), 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", placeholder: "CanHelp — Βρες ειδικό για κάθε δουλειά" }) ] }), /*#__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('admin.settings.seo.site_description_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: seoForm.siteDescription, onChange: (e)=>setSeoForm((f)=>({ ...f, siteDescription: e.target.value })), 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", placeholder: "Η ελληνική πλατφόρμα για online ανάθεση εργασιών..." }) ] }), /*#__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('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-blue-600", 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `${backupMsgError ? 'bg-red-50 border-red-200 text-red-700' : 'bg-green-50 border-green-200 text-green-700'} border rounded-lg px-4 py-2 text-sm flex items-center justify-between`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: backupMsg }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBackupMsg(null), className: `${backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700'} ml-4`, children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", 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: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch {} setBackupAutoSaving(false); }, className: `relative w-11 h-6 rounded-full transition-colors ${backupAutoEnabled ? 'bg-blue-600' : 'bg-gray-300'} ${backupAutoSaving ? 'opacity-50' : ''}`, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ${backupAutoEnabled ? 'translate-x-5' : 'translate-x-0'}` }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch(`${BASE}/api/admin/backup/export`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `backup_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, className: "bg-blue-600 hover:bg-blue-700 text-white text-sm px-4 py-2 rounded-lg font-medium disabled:opacity-50 flex items-center gap-2", 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: `bg-gray-100 hover:bg-gray-200 text-gray-700 text-sm px-4 py-2 rounded-lg font-medium cursor-pointer flex items-center gap-2 ${backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''}`, 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: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch(`${BASE}/api/admin/backup/import`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", 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-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-blue-600 hover:text-blue-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 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" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("table", { className: "w-full text-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch(`${BASE}/api/admin/backup/export/${tbl}`, { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `${tbl}_${new Date().toISOString().slice(0, 10)}.sql.gz`; a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.message || 'Error'); } }, className: "text-blue-600 hover:text-blue-800 font-medium text-xs px-2 py-1 rounded border border-blue-200 hover:bg-blue-50", children: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-gray-600 hover:text-gray-800 font-medium text-xs px-2 py-1 rounded border border-gray-200 hover:bg-gray-100 cursor-pointer", children: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ const file = e.target.files?.[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch(`${BASE}/api/admin/backup/import/${tbl}`, { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), editUser && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", 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 flex-shrink-0", 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-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "w-44 flex-shrink-0 border-r border-gray-100 py-3 space-y-0.5 px-2", children: [ { id: 'profile', label: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vy(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: `w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ${editUserTab === item.id ? 'bg-blue-50 text-blue-700 font-medium' : 'text-gray-600 hover:bg-gray-50'}`, children: item.label }, item.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", 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('admin.user_edit.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editUser.firstName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), 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('admin.user_edit.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editUser.lastName ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), 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('admin.user_edit.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editUser.phone ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), 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('admin.user_edit.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editUser.bio ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.target.value })), rows: 5, 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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "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)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full border border-gray-200 bg-gray-50 rounded-lg px-3 py-2 text-sm text-gray-600 select-all", children: editUser.email }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L10 8.586 7.707 6.293a1 1 0 00-1.414 1.414L8.586 10l-2.293 2.293a1 1 0 101.414 1.414L10 11.414l2.293 2.293a1 1 0 001.414-1.414L11.414 10l2.293-2.293z", clipRule: "evenodd" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `text-sm font-medium ${editUser.emailVerified ? 'text-green-700' : 'text-red-600'}`, children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", 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('admin.user_edit.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "customer", children: t('admin.user_edit.role.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "specialist", children: t('admin.user_edit.role.specialist') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__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('admin.user_edit.plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.planId ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__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)("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__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('admin.user_edit.interface_lang') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.locale ?? 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "Ελληνικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", 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-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-5", children: [ 'el', 'en', 'ru' ].map((lang)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (editUser.languages ?? []).includes(lang), onChange: (e)=>{ const langs = editUser.languages ?? []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'Ελληνικά' : lang === 'en' ? 'English' : 'Русский' }) ] }, lang)) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-gray-900", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__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__.jsxs)("button", { onClick: ()=>setBalanceModal('topup'), className: "flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-sm font-medium", 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", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('withdraw'), className: "flex items-center gap-1.5 px-4 py-2 bg-rose-600 hover:bg-rose-700 text-white rounded-lg text-sm font-medium", 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", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.showContactInfo ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.notifyNewTasks ?? false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.notifMessages ?? true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "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)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__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)("div", { className: "flex flex-1 items-center border border-gray-300 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-3 py-2 text-sm text-gray-400 bg-gray-50 border-r border-gray-300 flex-shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editUser.personalSiteSlug ?? '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: `/site/${editUser.personalSiteSlug}`, target: "_blank", rel: "noopener noreferrer", className: "shrink-0 px-3 py-2 border border-gray-300 rounded-lg text-sm text-blue-600 hover:bg-blue-50 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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__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)("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (editUser.siteSettings ?? {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, [item.key]: e.target.checked } })), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }) ] }, item.key)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pt-2", 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('profile.site.theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (editUser.siteSettings ?? {}).siteTheme ?? 'dark', onChange: (e)=>setEditUser((u)=>({ ...u, siteSettings: { ...u.siteSettings ?? {}, siteTheme: e.target.value } })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", 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-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: (editUser.skills ?? []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser((u)=>({ ...u, skills: (u.skills ?? []).filter((x)=>x !== s) })), className: "text-blue-400 hover:text-blue-700 leading-none", 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.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); } }, placeholder: t('admin.user_edit.skill_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", { onClick: ()=>{ const val = skillInput.trim(); if (val && !(editUser.skills ?? []).includes(val)) { setEditUser((u)=>({ ...u, skills: [ ...u.skills ?? [], val ] })); } setSkillInput(''); }, className: "px-3 py-2 bg-blue-600 text-white rounded-lg text-sm hover:bg-blue-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: editUserCards.map((card)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: card.title ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('admin.user_edit.card_title'), 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__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-blue-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.active') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: card.description ?? '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('admin.user_edit.card_description'), 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", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.skills ?? []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs bg-blue-50 text-blue-700 px-2 py-0.5 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: (c.skills ?? []).filter((x)=>x !== s) } : c)), className: "text-blue-400 hover:text-blue-700 leading-none", 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: cardSkillInputs[card.id] ?? '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && (cardSkillInputs[card.id] ?? '').trim()) { e.preventDefault(); const val = (cardSkillInputs[card.id] ?? '').trim().replace(/,$/, ''); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('admin.user_edit.skill_placeholder'), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ const val = (cardSkillInputs[card.id] ?? '').trim(); if (val && !(card.skills ?? []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, skills: [ ...c.skills ?? [], val ] } : c)); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-blue-600 text-white rounded-lg text-xs hover:bg-blue-700", children: "+" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.categories ?? []).map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs bg-purple-50 text-purple-700 px-2 py-0.5 rounded-full", children: [ getCatLabel(catRows.find((c)=>c.slug === slug) ?? { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: (c.categories ?? []).filter((x)=>x !== slug) } : c)), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminCatPicker, { catRows: catRows, locale: locale, selected: card.categories ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, categories: [ ...c.categories ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: (card.locations ?? []).map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs bg-green-50 text-green-700 px-2 py-0.5 rounded-full", children: [ getLocLabel(locRows.find((l)=>l.slug === slug) ?? { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: (c.locations ?? []).filter((x)=>x !== slug) } : c)), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminLocPicker, { locRows: locRows, locale: locale, selected: card.locations ?? [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, locations: [ ...c.locations ?? [], id ] } : c)), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.id], className: "px-4 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-xs font-medium disabled:opacity-50", children: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id)) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-blue-600 hover:bg-blue-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: `bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ${balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: `text-base font-semibold ${balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-gray-700", children: [ Number(editUser.balance ?? 0).toFixed(2), " EUR" ] }) ] }), /*#__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", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: `block text-sm font-medium mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? editUser.topUpAmount ?? '' : editUser.withdrawAmount ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-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 mb-1 ${balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'}`, children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceModal === 'topup' ? editUser.topUpDescription ?? '' : editUser.withdrawDescription ?? '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: `w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ${balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400'}` }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: `flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ${balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'}`, children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } function LocTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : loc.nameEl) || loc.nameEl || loc.slug; return /*#__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 px-4 py-3 hover:bg-gray-50 ${!loc.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-blue-400 shrink-0", 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: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", 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: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree({ rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t }) { const children = rows.filter((r)=>(r.parentId ?? null) === parentId); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>(a.order ?? 0) - (b.order ?? 0)).map((cat)=>{ const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : cat.namesEl) || cat.namesEl || cat.slug; return /*#__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 px-4 py-3 hover:bg-gray-50 ${!cat.isActive ? 'opacity-50' : ''}`, style: { paddingLeft: `${16 + depth * 24}px` }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: `w-5 h-5 flex items-center justify-center text-gray-400 rounded ${hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'}`, children: hasChildren ? isOpen ? /*#__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)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__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)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-lg w-7 text-center", children: cat.icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || cat.names?.en }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: `px-2 py-0.5 rounded-full text-xs font-medium ${cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`, children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, cat.id); }) }); } function Pagination({ page, total, limit, onChange, totalLabel }) { const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch { return null; } } const EVENT_META = { 'user.login': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }), labelKey: 'admin.event.user_login', color: 'bg-blue-50 text-blue-700 border-blue-100' }, 'user.register': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" }) }), labelKey: 'admin.event.user_register', color: 'bg-green-50 text-green-700 border-green-100' }, 'admin.user.deactivate': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "4.93", y1: "4.93", x2: "19.07", y2: "19.07" }) ] }), labelKey: 'admin.event.admin_user_deactivate', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.user.activate': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }), labelKey: 'admin.event.admin_user_activate', color: 'bg-emerald-50 text-emerald-700 border-emerald-100' }, 'admin.user.role_changed': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" }) }), labelKey: 'admin.event.admin_user_role_changed', color: 'bg-purple-50 text-purple-700 border-purple-100' }, 'admin.task.cancelled': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }), labelKey: 'admin.event.admin_task_cancelled', color: 'bg-orange-50 text-orange-700 border-orange-100' }, 'admin.task.deleted': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6m5 0V4a1 1 0 011-1h2a1 1 0 011 1v2" }) ] }), labelKey: 'admin.event.admin_task_deleted', color: 'bg-red-50 text-red-700 border-red-100' }, 'admin.report.reviewed': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }), labelKey: 'admin.event.admin_report_reviewed', color: 'bg-teal-50 text-teal-700 border-teal-100' }, 'admin.report.dismissed': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), labelKey: 'admin.event.admin_report_dismissed', color: 'bg-gray-50 text-gray-600 border-gray-200' }, 'task.created': { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), labelKey: 'admin.event.task_created', color: 'bg-indigo-50 text-indigo-700 border-indigo-100' } }; function ActivityLogRow({ entry, dateLocale, onFilterUser, t }) { const meta = EVENT_META[entry.event] ?? { icon: /*#__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, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), labelKey: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: `shrink-0 mt-0.5 px-2.5 py-1 rounded-lg border text-xs font-semibold flex items-center gap-1.5 ${meta.color}`, children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-blue-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map(([k, v])=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: String(v) }) ] }, k)) }), entry.ipAddress && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = (/* unused pure expression or super */ null && ([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ])); function AdminMonthChart({ series, dateLocale = 'en-US' }) { // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>map[m] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: `0 0 ${W} ${H + 14}`, className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, `bar-${mi}-${si}`); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? ` ${yr}` : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, `xl-${mi}`); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = `M ${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`; for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += ` C ${cpx} ${pts[i - 1][1].toFixed(1)} ${cpx} ${pts[i][1].toFixed(1)} ${pts[i][0].toFixed(1)} ${pts[i][1].toFixed(1)}`; } return d; } function fmtYLabel(v) { if (v >= 1000000) return `${+(v / 1000000).toFixed(1)}M`; if (v >= 1000) return `${Math.round(v / 1000)}K`; return String(v); } function AdminAreaChart({ series, days: daysProp }) { const days = daysProp ?? getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>map[d] ?? 0); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return `${line} L ${lastX} ${chartH.toFixed(1)} L ${padL.toFixed(1)} ${chartH.toFixed(1)} Z`; } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: `0 0 ${W} ${H + 12}`, className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, v); }), xTicks.map(({ i })=>{ const x = padL + i * stepX; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, `vg-${i}`); }), xTicks.map(({ i, label })=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i)), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(seriesVals[si]), fill: s.fill }, `fill-${si}`)), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, `line-${si}`)), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, `dot-${si}`); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71159); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94496); /* 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__(13260); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96484); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91864); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48178); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8293); ReplaceSourceRawSource61146undefined148199undefined201244undefined246274undefined276315undefined317361undefined363395undefined397432undefined434484undefined486532undefined34683475(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35173524(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35793586(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36113616(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined36803688(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42824286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43924396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined48214824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51285131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined53985401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55785581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined59325935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined62186222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined64676470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined66246627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77657769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined78667870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined87378740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined90119014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92929295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined97759778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1027610280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1090310906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1113111134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1168611693(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1173511742(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1179311800(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1182511830(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined1189411902(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1249512499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1260512609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1303413038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1337213375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1369413697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1400714010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1418714190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1454114544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1482714831(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1507615079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1523315236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635916363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1646016464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1731017313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1761317616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1798117984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1826118264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1874418747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1924219246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1986519868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009320096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2053620550undefined2059320601(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined2064720656(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined2068720695(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined2072620733(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2079720804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2086920877(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2099521002(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2105421061(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2110621113(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2115921166(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2120421211(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2126021267(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2131221319(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2136921376(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2142121428(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2147421481(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2151921526(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2157521582(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2163121638(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2169421701(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2175021757(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2180721814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2186321870(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2191321920(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2196421971(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2204022047(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2210022107(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2215722164(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2221622223(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2227822285(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2234422351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2240622413(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2247622483(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2254122548(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2259322600(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2264222649(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2269322700(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2275122758(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2280522812(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2286722874(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2294122948(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2302023027(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2308023087(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2314123148(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2320023207(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2326223269(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2333023337(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2339423401(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2348223489(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2353423541(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2361323620(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2367123678(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2372623733(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2378523792(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2384123848(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2389723904(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2396223969(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2403824045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2410224109(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2416724174(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2422624233(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2429124298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2434724354(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2440724414(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2448124488(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2454824555(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2460224609(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2466424671(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2472624733(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2478924796(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2483924846(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2489524902(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2496324970(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2501125018(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2506525072(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2512425131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2519725204(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2524525252(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2529925306(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2535825365(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2543725444(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2550025507(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2566625673(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2572725734(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2578025787(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2600026007(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2605526062(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2612426131(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2619126198(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2625526262(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3552235529(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3558635593(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3565035657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3572535732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3577835785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3601136018(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3606636073(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3612736134(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3633336340(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3639636403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3644736454(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3664336650(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3669636703(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3675336760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3698536992(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3704437051(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3712937136(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3719837205(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3725937266(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3733137338(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3740237409(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3746637473(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3753337540(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3759937606(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3765337660(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3771737724(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3797737984(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3812638134(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3839538403(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3844938465_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEundefined3850738528_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biundefined3857638596_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4undefined3872238730(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3882138837_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSundefined3918539193(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3928439300_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yjundefined3965239660(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3975339771_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined4004740055(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4014940174_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined4062040628(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4076140778_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined4099541018_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOundefined4154641565_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtundefined4202142041_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brundefined4290242910(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4311443122(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4328643294(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4347743485(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4355043566_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined4370443712(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4377843784(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined4392243928(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined4406344069(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined4432944337(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4442944445_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined4462144629(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4476844776(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4491744925(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined4509645113_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wiundefined4511745132_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .Heundefined4534845365_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mmundefined4594745962_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jdundefined4642646444_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlundefined4759747620_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQundefined4829448318_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0undefined4879348818_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined4949849525_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDundefined5000950034_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined5074550773_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined5139251410_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nfundefined5193151949_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBundefined5214152162_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUundefined5242352431(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5250052520_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined5344153458_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Ntundefined5362753644_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJundefined5435454371_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRundefined5475054758(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5482854849_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined5583155848_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7undefined5601756034_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZundefined5679056807_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7undefined6390163914_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined6408664099_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTundefined6437764393_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined6471364726_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRundefined6489464902(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6499765013_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined6505865077_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCundefined6765867683_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lpundefined6815568177_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined6871868740_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined6970869735_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined6983669866_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcundefined7049470521_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined7079470821_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined7115771179_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined7192971951_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined7260772629_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined7323273254_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined7392173924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7476374766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7500975012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7548975493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7575875761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7599776000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7616976172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7653576538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7678176784(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7722877231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7747477477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7790077903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7814678149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7869778701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7896678969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7924879251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7961479618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7988379886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8015180154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8051580519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8078480787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8106181064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8138481388(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8165381656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8177981782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8211182115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8238082383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8255482557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8347183474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8371783720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8471184714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8480384807(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8492684930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8508485088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8525185254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8551585518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8577185774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8606186065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8606786070(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined8632186324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8667386676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8713587139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8726587268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8745087454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8766487667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8817588178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8864988652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8909189095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8970089703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9003890041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9039890402(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9057590579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9075290755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9120091203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9167491677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9252692530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9306393066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9394693949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9482794830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9530195304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9620496207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9667896681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9761497617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9808898091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9903699040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9929899301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9960599608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9993499937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined100416100420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined100654100658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined100908100911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined101253101257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101525101529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101815101818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102355102359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined102645102648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103193103197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined103483103486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104234104237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined105965105969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106203106206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined106524106527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110434110438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined110741110744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111125111128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111373111376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined112013112016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined112403112407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113397113401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113635113639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113889113892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114239114243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114527114530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115118115121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115924115928(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined116162116166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined116416116419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116765116769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117053117056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117640117643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118428118432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118676118680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118925118928(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119270119274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined119542119546(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined119832119835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120373120377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120663120666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121410121414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121648121652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121946121949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122329122332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122846122850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123138123141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123517123520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124030124034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined124330124333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124708124712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125574125577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127502127506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127619127623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127826127830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined128340128343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128967128970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129535129539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined129972129975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130288130291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130611130614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130938130941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131433131437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined131683131687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined131915131918(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined132110132114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined132282132285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined132673132676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined133065133068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined133456133459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined133835133838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134232134235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134625134628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135063135066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135272135275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135373135376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135849135852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135950135953(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136404136408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136683136686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136908136922(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .formatShortName */ .H)undefined137119137122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137502137505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137715137718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138374138377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138667138671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined139250139253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139708139711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140136140139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140349140352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140993140996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141217141221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141554141557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142012142015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142704142707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined143574143577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144864144867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145536145540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145653145657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145870145873(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146480146484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined146921146924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147255147258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147592147595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147952147955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148309148312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148849148853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined149099149103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined149331149334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined149526149530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined149698149701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150089150092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150505150508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150915150918(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151326151329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151744151747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152327152330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152536152539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152637152640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153119153122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153220153223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154296154300(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined154585154589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined154881154884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155311155314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155897155900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined156110156113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined156693156697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157591157594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157818157822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined158768158771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined159175159178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined159968159971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined160643160647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined160760160764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined160967160971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined161481161484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162108162111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162676162680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined163117163120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163862163865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined164368164372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164618164622(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164850164853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined165045165049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165217165220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined165609165612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166004166007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166397166400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166790166793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167184167187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167622167625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167831167834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167932167935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168408168411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168509168512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169227169231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined169506169509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169754169757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169759169762(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined170443170446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined170848170851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171061171064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171651171654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171881171891(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined172077172080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172508172511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172732172736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173118173121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173759173762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174977174980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175651175655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined175768175772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined175998176001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176294176298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177009177013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177254177258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177632177636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178339178343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178597178601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178762178765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179149179152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180125180129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined180290180293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180677180680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181653181657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181818181821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182206182209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183179183183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183344183348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183980183983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184865184869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined185030185034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined185666185669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186551186555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined186716186720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined187352187355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188348188352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188616188619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189449189453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined189675189678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190277190280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190960190963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191191191194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191445191448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192352192356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192469192473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192699192702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192995192999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined193710193714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined193955193959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined194333194337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined195037195041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined195295195299(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined195460195463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined195847195850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196829196833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196994196998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197630197633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined198513198517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined198678198682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined199314199317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200197200201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200362200366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200998201001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201978201982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined202222202226(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined202466202469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202854202857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203841203845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined204133204136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205151205155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined205377205380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205979205982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206662206665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206893206896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207147207150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208052208056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined208239208242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208499208502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208757208760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208952208956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209206209210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209460209464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209762209765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210232210235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210696210700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined211363211366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211368211371(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined211990211994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212971212975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213434213437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined213974213977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214328214331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214863214867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215127215130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215680215683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216487216490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217024217028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217141217144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218433218436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219005219009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined219138219142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined219392219396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined220002220006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined220239220256_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined220919220923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221542221545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221826221829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined222754222757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223035223038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223298223301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223504223508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined223748223751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223973223977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined224153224156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224545224548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224941224944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225334225337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225728225731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226121226124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226512226515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226904226907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227298227301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227689227692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228273228276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228496228500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228796228799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined229256229259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined229477229480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230093230096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230512230515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230914230917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231382231385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231807231810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined232233232236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined232656232659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233080233083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233327233330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233583233586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234249234252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234662234665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235024235028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235785235788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined236423236426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined237737237740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined238348238352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238481238485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238779238783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238944238947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239337239341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239878239881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240290240293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240904240908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241069241072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined241461241464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242166242170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined242331242334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242721242724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243497243501(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined244336244340(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined244957244960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245475245478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined246326246330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247079247082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247346247349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247537247540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248285248288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248904248908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249037249041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249335249339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249500249503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined249889249893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250422250425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined250826250829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251484251488(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined251649251652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252037252040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252734252738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252899252902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253285253288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined254023254027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined254763254767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined255384255387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255902255905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined256749256753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257490257493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257753257756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257959257963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined258203258206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined258428258432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined258608258611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259000259003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259397259400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259790259793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260186260189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260581260584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261165261168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262333262337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined262643262646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263105263108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263506263509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263727263730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264320264323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264720264723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264964264967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265578265581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265821265824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266200266203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266866266869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267279267282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267664267668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined268425268428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269063269066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined270446270449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271062271066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271195271199(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271493271497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271658271661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined272052272056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272593272596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined272992272995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273606273610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined273771273774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274163274166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274870274874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275035275038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275425275428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276187276191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276941276945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined277562277565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278080278083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278931278935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined279685279688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279954279957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280160280164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280404280407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280629280633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280809280812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281201281204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281592281595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281990281993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282389282392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282977282980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined283203283207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined283503283506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined283961283964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined284405284408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined284626284629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285163285166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285580285583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285824285827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286080286083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286746286749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287159287162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287414287417(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288078288081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289181289184(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289862289866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289979289983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined290209290213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined290483290487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined291062291065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291691291694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292452292455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292981292985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293234293237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293586293590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293824293828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293989293992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined294383294386(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295299295303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined295464295467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295859295862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined297021297025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297186297189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined297585297588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298845298849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined299010299013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299404299408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined300230300233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300626300629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301268301272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined301433301436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301827301831(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined302653302656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303041303044(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303427303430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304162304166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined304311304314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304680304683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305530305533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305886305890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined306124306128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined306289306292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306688306691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307860307864(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined308025308028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308425308428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309599309603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined309764309767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310163310166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311335311339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined311500311503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311906311909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined313096313100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined313261313264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined313665313668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined314851314855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined315016315019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315416315419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined316590316594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316755316758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined317157317160(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined318335318339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined318500318503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined318903318906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined320093320097(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined320258320261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined320661320664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined321938321941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined322293322297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined322531322535(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined322696322699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323098323101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined324198324202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined324363324366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined324770324773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined326051326055(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326200326203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined326566326569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined327494327497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined327851327854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329579329583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined329881329884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330927330930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined331285331288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335364335368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335666335669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336712336716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined336956336960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined337258337261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338288338292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined338590338593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined339617339621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined339880339883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340252340255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341324341328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined341555341558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342165342168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342818342821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343041343044(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343305343308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343545343549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined343843343847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined344109344113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined344418344421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344843344846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345332345335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345949345952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined346329346333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined346652346656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined347023347027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined347866347870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined348743348747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349425349429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined350108350112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined350787350791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined351126351129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351794351797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined352958352961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined353198353202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined353544353547(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined353788353791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined354478354481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined355507355511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined355797355800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined355899355912_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined356109356125_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined356539356542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357135357138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357646357649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined358192358195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359149359153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined359266359269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360775360778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361393361397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined361640361643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361962361966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined362187362191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined362352362355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362757362760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363791363795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined363956363959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364360364363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365404365408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined365569365572(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365978365981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined367115367119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined367280367283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined367689367692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined368739368742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined369629369633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined369876369879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined370195370198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined370506370510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined370731370735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined370993370997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined371267371270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371696371699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined372811372815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372992372995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined373421373424(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined374638374642(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined374803374806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375206375210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined376056376059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined376446376449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined376818376821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377431377435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined377596377599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377997378000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined379121379125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined379286379289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined379687379690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380904380908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined381166381170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined381347381350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381781381784(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined382897382901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined383078383081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined383513383516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined384847384850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined385521385524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined385956385972_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIundefined387120387124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined387411387414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387979387982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined388900388903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined389512389516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined389722389726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined389984389988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined390262390266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined390549390552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined391011391015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined391208391211(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined391641391644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined392346392350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined392650392653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined393052393055(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined393871393874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394598394602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined394847394851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined395028395031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined395457395461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined396321396324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined396738396741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined397435397439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined397616397619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398047398050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined399189399193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined399475399479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined399672399675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined400114400117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined401313401317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined401510401513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined401956401959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403403403407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined403584403587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined404012404015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined405181405185(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined405362405365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined405774405777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined407036407040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined407304407307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined407986407989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined408566408570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined408878408882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined409457409460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined409852409855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined410323410326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined410911410914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined411372411376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined411583411587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined411897411901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined412476412479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined412871412874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined413342413345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined413930413934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined414455414458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415445415448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415966415969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416822416825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined417344417347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418133418136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418655418658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419511419514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined420034420037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined420871420874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined421394421397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined422265422268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined422787422790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined423539423542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined424060424063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined424904424907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined425424425427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426248426251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426771426774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined427712427715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined428233428236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429101429104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429624429627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined430409430412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined430929430932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431767431770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined432291432294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined433351433354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined433872433875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined434668434671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435190435193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435988435991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined436511436514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined437366437369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined437889437892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined438682438685(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439205439208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined440165440168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined440685440688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined442008442012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined442294442298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined442744442747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443103443107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined443393443396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443816443820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444540444543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445111445114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445375445378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445969445972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined446535446539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined446836446839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined447380447383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448258448262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined448447448450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448898448901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450606450610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined450795450798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451243451246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined453213453217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined453545453548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined453980453983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined454449454452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined455229455233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined455525455528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined456314456318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined456998457001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457666457669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined458734458737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459864459868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined460121460125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined460270460273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined460620460623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined461064461068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined461313461317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined461478461481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined461873461876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined462368462371(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined463083463086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined463605463609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463868463871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined464260464264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464425464428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined464832464836(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined465698465701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466140466143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466649466652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined467146467150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined467311467314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined467718467721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined468799468802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined469393469397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined469656469659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined470050470054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined470215470218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined470622470626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined471492471495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471936471939(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined472445472448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined472942472946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473107473110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined473514473517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined474599474602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475193475197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined475432475435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined476082476085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined476627476631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined476884476888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined477033477036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477387477390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined478185478188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined478529478532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined479804479807(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined480148480151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined481702481705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined482046482049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined482969482972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined483313483316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484111484114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484455484458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined485440485443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined485784485787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined486734486737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487078487081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined488830488833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489174489177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491010491014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined491167491171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined491489491492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491981491984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined492496492499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493615493619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined493859493862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined494501494504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined495042495046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined495299495302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined495612495616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined495861495865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined496026496029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496420496423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496921496924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497663497666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined498188498192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined498437498441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined498602498605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined498993498996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined499491499494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500234500237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500759500763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined500908500911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined501284501287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502255502259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined502404502407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502786502789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined503866503870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined504015504018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504393504396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504748504751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined505904505908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined506143506146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined506773506776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507374507378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined507551507555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined507801507804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508265508268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508911508915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined509280509283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined509481509484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined510012510016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined510284510288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined510433510436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined510797510800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511285511288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511666511672(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined512681512684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513156513160(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined513394513397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513733513737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined513969513973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined514396514426"https://api.canhelp.gr"undefined5144315144530undefined516468516471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined517012517015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined517865517869(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined518300518303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined518844518847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519595519598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520796520826"https://api.canhelp.gr"undefined5208315208530undefined522609522613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined522847522850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523226523229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523510523513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523703523707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined524031524035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined524212524215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined524700524704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined525993525996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined526629526635(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined528458528462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined528696528699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529049529053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined529310529314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined529726529729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined530392530395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531112531115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531370531373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531542531545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531723531726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531946531950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined532225532228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined532614532617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined532833532837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined533168533171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined533501533531"https://api.canhelp.gr"undefined5335365335580undefined535961535965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536619536622(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538153538183"https://api.canhelp.gr"undefined5381885382100undefined541580541583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541773541777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542027542031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542313542317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542470542473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542838542842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined543589543592(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined544104544108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined544327544330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined546478546481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined546972547002_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyundefined547167547188_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined547356547376_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined548560548564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined548843548847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined549104549108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined549439549443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined549642549646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined550779550783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined550982550986(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined552233552237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined552531552535(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined552736552739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553215553218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined554359554363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined554564554567(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined555042555045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556321556325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined556510556513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556952556955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558008558012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined558197558200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558637558640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined559943559947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560204560208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560393560396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined560835560838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561450561454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined561798561802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined562146562149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined562626562629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined563273563276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined563751563754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564582564585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565348565351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined566235566239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined566533566537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined566738566741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567211567215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined568157568160(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined568632568635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569111569114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569902569906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined570107570110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570580570584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined571544571547(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined572023572026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined572968572972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined573734573738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined574050574053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined575016575019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined575572575576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined575761575764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576212576216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined577106577109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined577519577522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined577931577934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578633578637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined578822578825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined579273579276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined579861579865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined580227580230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582102582105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined583158583162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583419583423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583777583781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583982583985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined584438584442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined585350585354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined585660585664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined586227586230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586827586830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined587919587923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined588483588486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589083589086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined590462590465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined591011591014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined591201591205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined591504591508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined591847591851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined592060592063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined592549592552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined593192593195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined594352594356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined594695594699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined594908594911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined595396595399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined596038596041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined597196597200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined597539597543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined597752597755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined598238598241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined598878598881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600247600251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined600508600512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined600697600700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined601152601156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601475601479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601920601923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined602454602457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603786603789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined604482604485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined605174605177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined606299606303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined606305606313react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined606492606495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined606957606960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610559610563(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined610940610943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined611406611409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined613166613170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined613470613473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined613943613947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined615281615284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined615746615749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined616825616829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined617086617090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined617275617278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined617718617721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined618004618008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined618512618515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined619751619755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620061620064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622746622749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined624982624986(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined625287625290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined625755625758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626122626125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626482626485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626730626734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined627112627116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined627483627486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628796628800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined629224629227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined630530630533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined631463631466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined632842632846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined633079633082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined633612633615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined633944633948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined634548634551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined636107636111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined636489636492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640658640661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643883643887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644120644123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined644657644660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined644996645000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined645906645909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined647483647486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649394649398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined649631649634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined650167650170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined650505650509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined651413651416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined652986652989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654894654897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655160655163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined656846656850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined657109657112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined657693657696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined658208658211(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined658405658408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined659028659031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined659223659227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659536659540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659778659781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined660234660237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined660753660757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661121661125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661741661745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661954661958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662111662114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined662611662614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664183664187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined664340664343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664850664853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666504666508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined666723666726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668171668174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined669173669176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined669178669186react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined669557669561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669634669638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669977669980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined670331670334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined670689670692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined670863670866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined671221671224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined671395671398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined671600671603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined671953671956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined672350672354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined672742672745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673104673107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673473673477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined673643673646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673891673894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674138674142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined674590674593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674953674957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined675148675151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined675596675599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined675975675978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined676486676489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined677247677250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined677252677260react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined677635677639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined677712677716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined678055678058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678409678412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678767678770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678941678944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679299679302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679473679476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679664679667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679874679878(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined680044680047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined680292680295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined680557680561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined681009681012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined681372681376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined681552681555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined681997682000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined682376682379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined682887682890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined683568683572(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined683742683746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined683930683934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684048684051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined684383684387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684670684673(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685316685319(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685528685531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685955685958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686167686170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686570686574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined686801686804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686956686959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687319687322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687531687534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687909687912(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688121688124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688500688504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined688731688734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688886688889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined689068689071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined689426689430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined689657689660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined689769689772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined690194690197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined690406690409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined690673690677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined690904690907(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691086691089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691434691437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined691646691649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined692177692180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined692389692392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined692834692838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined692993692997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined693343693347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined693465693469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined693648693651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined694004694007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined694306694309(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined694470694474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined694761694764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined695087695090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined695299695302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined695527695526(/* unused pure expression or super */ null && (undefined695661695660))undefined697026697029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined697110697114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697456697460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697547697550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined697897697900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined698559698562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699393699396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699724699727(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702213702216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702297702301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined702613702617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined702704702707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703054703057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703589703592(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703927703930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704264704267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704458704461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704982704985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined705042705045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined705420705423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined__webpack_require____webpack_require__.n__webpack_require__.r__webpack_require__.d