/opt/canhelp/apps/web/.next/cache/webpack/client-production
NameSizeModeActions
0.pack645019950644editdlrm
1.pack6228990644editdlrm
2.pack16053830644editdlrm
3.pack18294750644editdlrm
4.pack13724980644editdlrm
5.pack40780644editdlrm
6.pack18542550644editdlrm
7.pack11179260644editdlrm
8.pack38699010644editdlrm
9.pack40193500644editdlrm
10.pack10927090644editdlrm
11.pack361280644editdlrm
12.pack13004210644editdlrm
13.pack115880644editdlrm
14.pack40780644editdlrm
15.pack214033720644editdlrm
16.pack5411070644editdlrm
17.pack40780644editdlrm
18.pack2954110644editdlrm
19.pack222311380644editdlrm
20.pack2752970644editdlrm
21.pack54214750644editdlrm
index.pack34315280644editdlrm
index.pack.old34732550644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/4.pack (1372498B)
wpcFwebpack/lib/cache/PackFileCacheStrategyPackContentItems `FMinifierWebpackPlugin|static/chunks/app/admin/page-65934f00de3c5fab.jsMinifierWebpackPlugin|static/sDEY6qdapTNnQp2eRZW_m/_ssgManifest.jsMinifierWebpackPlugin|static/sDEY6qdapTNnQp2eRZW_m/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-65934f00de3c5fab.jsRealContentHashPlugin|analyse|static/sDEY6qdapTNnQp2eRZW_m/_ssgManifest.jsRealContentHashPlugin|analyse|static/sDEY6qdapTNnQp2eRZW_m/_buildManifest.jsRealContentHashPlugin|generate|static/sDEY6qdapTNnQp2eRZW_m/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/admin/page-d1e582e735773a52.jsMinifierWebpackPlugin|static/chunks/app/delete-account/page-c5c8474b91706ef1.jsMinifierWebpackPlugin|static/chunks/app/favorites/page-4605336be6c77144.jsMinifierWebpackPlugin|static/chunks/app/become-specialist/page-72aae84d8d34ddc5.jsMinifierWebpackPlugin|static/chunks/app/chat/page-c7ea1500355c91ee.jsMinifierWebpackPlugin|static/chunks/app/page-8f3bc2e3b3d8ba14.jsMinifierWebpackPlugin|static/chunks/app/notifications/page-a3d556b281c53978.jsMinifierWebpackPlugin|static/chunks/app/payment/page-d36e48767c9570ba.jsMinifierWebpackPlugin|static/chunks/app/dashboard/page-02c85e70f2242799.jsMinifierWebpackPlugin|static/chunks/app/pricing/page-3455cb052e70193b.jsMinifierWebpackPlugin|static/chunks/app/schedule/page-45c3bee0ac3db8f3.jsMinifierWebpackPlugin|static/chunks/app/specialist-setup/page-699054a0361a7ea3.jsMinifierWebpackPlugin|static/chunks/app/specialists/page-6746f7e73d3ba8c1.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/offer/page-d521a5600d468145.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/page-def21b68a8fa7042.jsMinifierWebpackPlugin|static/chunks/app/tasks/new/page-56056ad00072438e.jsMinifierWebpackPlugin|static/chunks/app/profile/page-9c3e5ea8b61894a5.jsMinifierWebpackPlugin|static/chunks/app/users/[id]/page-bbe8d25f43bb4821.jsMinifierWebpackPlugin|static/chunks/app/site/[slug]/page-ab852492a6d04e51.jsMinifierWebpackPlugin|static/chunks/webpack-b0e8940d99f95f2e.jsMinifierWebpackPlugin|static/chunks/6467.fc83f07f01616eb7.jsMinifierWebpackPlugin|static/chunks/2982-0bbeeb03d0e488a6.jsCssMinimizerPlugin|static/css/4aa17b3141e2341a.cssRealContentHashPlugin|analyse|static/chunks/app/admin/page-d1e582e735773a52.jsRealContentHashPlugin|analyse|static/chunks/app/delete-account/page-c5c8474b91706ef1.jsRealContentHashPlugin|analyse|static/chunks/app/favorites/page-4605336be6c77144.jsRealContentHashPlugin|analyse|static/chunks/app/become-specialist/page-72aae84d8d34ddc5.jsRealContentHashPlugin|analyse|static/chunks/app/chat/page-c7ea1500355c91ee.jsRealContentHashPlugin|analyse|static/chunks/app/page-8f3bc2e3b3d8ba14.jsRealContentHashPlugin|analyse|static/chunks/app/notifications/page-a3d556b281c53978.jsRealContentHashPlugin|analyse|static/chunks/app/payment/page-d36e48767c9570ba.jsRealContentHashPlugin|analyse|static/chunks/app/dashboard/page-02c85e70f2242799.jsRealContentHashPlugin|analyse|static/chunks/app/pricing/page-3455cb052e70193b.jsRealContentHashPlugin|analyse|static/chunks/app/schedule/page-45c3bee0ac3db8f3.jsRealContentHashPlugin|analyse|static/chunks/app/specialist-setup/page-699054a0361a7ea3.jsRealContentHashPlugin|analyse|static/chunks/app/specialists/page-6746f7e73d3ba8c1.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/offer/page-d521a5600d468145.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/page-def21b68a8fa7042.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/new/page-56056ad00072438e.jsRealContentHashPlugin|analyse|static/chunks/app/profile/page-9c3e5ea8b61894a5.jsRealContentHashPlugin|analyse|static/chunks/app/users/[id]/page-bbe8d25f43bb4821.jsRealContentHashPlugin|analyse|static/chunks/app/site/[slug]/page-ab852492a6d04e51.jsRealContentHashPlugin|analyse|static/chunks/webpack-b0e8940d99f95f2e.jsRealContentHashPlugin|analyse|static/chunks/6467.fc83f07f01616eb7.jsRealContentHashPlugin|analyse|static/css/4aa17b3141e2341a.cssRealContentHashPlugin|analyse|static/chunks/2982-0bbeeb03d0e488a6.jsRealContentHashPlugin|generate|static/chunks/webpack-b0e8940d99f95f2e.jsMinifierWebpackPlugin|static/chunks/app/admin/page-5b7da5c171721568.jsMinifierWebpackPlugin|static/vcwpAI24d4rC1M1eqF_HA/_ssgManifest.jsMinifierWebpackPlugin|static/vcwpAI24d4rC1M1eqF_HA/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-5b7da5c171721568.jsRealContentHashPlugin|analyse|static/vcwpAI24d4rC1M1eqF_HA/_ssgManifest.jsRealContentHashPlugin|analyse|static/vcwpAI24d4rC1M1eqF_HA/_buildManifest.jsRealContentHashPlugin|generate|static/vcwpAI24d4rC1M1eqF_HA/_buildManifest.jsMinifierWebpackPlugin|static/chunks/app/admin/page-2d8d5c52ae2cb493.jsMinifierWebpackPlugin|static/chunks/app/page-eb377a80534a38fb.jsMinifierWebpackPlugin|static/frFMACH1KDzDSmrvs0Vao/_ssgManifest.jsMinifierWebpackPlugin|static/frFMACH1KDzDSmrvs0Vao/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/app/admin/page-2d8d5c52ae2cb493.jsRealContentHashPlugin|analyse|static/chunks/app/page-eb377a80534a38fb.jsRealContentHashPlugin|analyse|static/frFMACH1KDzDSmrvs0Vao/_ssgManifest.jsRealContentHashPlugin|analyse|static/frFMACH1KDzDSmrvs0Vao/_buildManifest.jsRealContentHashPlugin|generate|static/frFMACH1KDzDSmrvs0Vao/_buildManifest.jssourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcex(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{1258:(e,t,s)=>{"use strict";function a(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function n(e,t,s){if(null==e?void 0:e.trim()){let s=null==t?void 0:t.trim();return s?"".concat(e.trim()," ").concat(s[0].toUpperCase(),"."):e.trim()}return a(s)}s.d(t,{E:()=>a,H:()=>n})},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>l,Hh:()=>r,Jv:()=>n,wV:()=>i,yK:()=>a});let a=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:l,signUp:r,useSession:i}=a},4017:(e,t,s)=>{"use strict";function a(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function n(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function l(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}s.d(t,{$g:()=>n,GZ:()=>l,Oj:()=>a})},6961:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>v});var a=s(4568),n=s(7620),l=s(7541),r=s(9664),i=s.n(r),o=s(1592),d=s(9906),c=s(2982),m=s(1258),x=s(4017);let u={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"]},p=Array.from(new Set(Object.values(u).flat())),g=["\uD83D\uDD28","\uD83E\uDDF9","\uD83D\uDE9A","\uD83D\uDCDA","\uD83D\uDCBB","\uD83C\uDFA8","\uD83D\uDC85","\uD83D\uDD29","\uD83C\uDF89","\uD83D\uDCF7","\uD83D\uDC3E","\uD83D\uDE97","⚖️","\uD83D\uDCCA","✨","\uD83D\uDCE6","\uD83C\uDFE0","\uD83C\uDFE2","\uD83D\uDDA5️","\uD83D\uDCF1","\uD83E\uDDF0","\uD83E\uDEB4","\uD83E\uDDD1‍\uD83C\uDFEB","\uD83E\uDDFE","\uD83D\uDEE0️","\uD83D\uDCA1","\uD83E\uDDFC","\uD83E\uDDFD","\uD83E\uDE9A","\uD83E\uDDD1‍\uD83D\uDCBB"];function h(e,t){return e?"en"===t?e.namesEn||e.namesEl||e.slug||"":"ru"===t?e.namesRu||e.namesEl||e.slug||"":"uk"===t?e.namesUk||e.namesEl||e.slug||"":e.namesEl||e.namesEn||e.slug||"":""}function b(e,t){return e?"en"===t?e.nameEn||e.nameEl||e.slug||"":"ru"===t?e.nameRu||e.nameEl||e.slug||"":"uk"===t?e.nameUk||e.nameEl||e.slug||"":e.nameEl||e.nameEn||e.slug||"":""}function f(e){let{value:t,onChange:s}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-green-50 text-2xl",children:t||"\uD83D\uDCE6"}),(0,a.jsx)("input",{value:t,onChange:e=>s(e.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"\uD83D\uDCE6"})]}),(0,a.jsx)("div",{className:"grid grid-cols-6 gap-2 sm:grid-cols-8 lg:grid-cols-10",children:g.map(e=>{let n=t===e;return(0,a.jsx)("button",{type:"button",onClick:()=>s(e),className:"flex h-9 w-9 items-center justify-center rounded-lg border text-lg transition ".concat(n?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"),"aria-label":e,children:e},e)})})]})}function y(e){let{catRows:t,locale:s,selected:l,onAdd:r,addLabel:i}=e,[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(""),[x,u]=(0,n.useState)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let g=t.filter(e=>!e.parentId),b=c.toLowerCase(),f=e=>{var t;return!c||h(e,s).toLowerCase().includes(b)||(null!=(t=e.slug)?t:"").toLowerCase().includes(b)};return(0,a.jsxs)("div",{className:"relative",ref:p,children:[(0,a.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-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:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,a.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,a.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,a.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,a.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,a.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(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"})}),g.map(e=>{let n=t.filter(t=>t.parentId===e.id),i=h(e,s),o=x===e.id,p=n.filter(e=>!l.includes(e.slug)&&f(e)),g=!l.includes(e.slug)&&f(e),b=n.length>0;return!g&&0===p.length&&c?null:(0,a.jsxs)("div",{children:[(0,a.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:()=>{b&&!c?u(o?null:e.id):g&&(r(e.slug),d(!1),m(""))},children:[e.icon?(0,a.jsx)("span",{className:"text-sm leading-none shrink-0",children:e.icon}):null,(0,a.jsx)("span",{className:"flex-1 font-medium",children:i}),b&&!c?(0,a.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,a.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:()=>{r(e.slug),d(!1),m("")},children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,a.jsx)("span",{className:"flex-1",children:h(e,s)})]},e.id))]},e.id)})]})]})}function j(e){let{locRows:t,locale:s,selected:l,onAdd:r,addLabel:i}=e,[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(""),[x,u]=(0,n.useState)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let g=t.filter(e=>!e.parentId),h=c.toLowerCase(),f=e=>{var t;return!c||b(e,s).toLowerCase().includes(h)||(null!=(t=e.slug)?t:"").toLowerCase().includes(h)};return(0,a.jsxs)("div",{className:"relative",ref:p,children:[(0,a.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-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:[(0,a.jsxs)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.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"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,a.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,a.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,a.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,a.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,a.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(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"})}),g.map(e=>{let n=t.filter(t=>t.parentId===e.id),i=b(e,s),o=x===e.id,p=n.length>0,g=n.filter(e=>!l.includes(e.slug)&&f(e)),h=!l.includes(e.slug)&&f(e);return!h&&0===g.length&&c?null:(0,a.jsxs)("div",{children:[(0,a.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:()=>{p&&!c?u(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[(0,a.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.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"})}),(0,a.jsx)("span",{className:"flex-1 font-medium",children:i}),p&&!c?(0,a.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&g.map(e=>(0,a.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:()=>{r(e.slug),d(!1),m("")},children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,a.jsx)("span",{className:"flex-1",children:b(e,s)})]},e.id))]},e.id)})]})]})}function v(){var e,t,s,r,g,v,C,_,S,E,A,I,U,R,W,z,P,F,H,V,O,K,q,G,X,Y;let J=(0,l.useRouter)(),{data:$,isPending:Q}=(0,o.wV)(),{t:Z,locale:ee}=(0,d.Y)(),[et,es]=(0,n.useState)("stats"),[ea,en]=(0,n.useState)(!1);(0,n.useEffect)(()=>{en(window.innerWidth<1024)},[]);let[el,er]=(0,n.useState)(null),[ei,eo]=(0,n.useState)([]),[ed,ec]=(0,n.useState)(1),[em,ex]=(0,n.useState)(0),[eu,ep]=(0,n.useState)(""),[eg,eh]=(0,n.useState)(""),[eb,ef]=(0,n.useState)(""),[ey,ej]=(0,n.useState)([]),[ev,eN]=(0,n.useState)(1),[ek,ew]=(0,n.useState)(0),[eC,e_]=(0,n.useState)(""),[eS,eL]=(0,n.useState)(""),[eD,eE]=(0,n.useState)(""),[eM,eB]=(0,n.useState)([]),[eA,eI]=(0,n.useState)(1),[eT,eU]=(0,n.useState)(0),[eR,eW]=(0,n.useState)([]),[ez,eP]=(0,n.useState)(1),[eF,eH]=(0,n.useState)(0),[eV,eO]=(0,n.useState)(""),[eK,eq]=(0,n.useState)(""),[eG,eX]=(0,n.useState)(""),[eY,eJ]=(0,n.useState)(""),[e$,eQ]=(0,n.useState)(null),[eZ,e0]=(0,n.useState)(""),[e2,e1]=(0,n.useState)(!1),[e4,e5]=(0,n.useState)([]),[e3,e6]=(0,n.useState)(1),[e7,e8]=(0,n.useState)(0),[e9,te]=(0,n.useState)([]),[tt,ts]=(0,n.useState)(0),[ta,tn]=(0,n.useState)(1),[tl,tr]=(0,n.useState)(""),[ti,to]=(0,n.useState)(""),[td,tc]=(0,n.useState)(""),[tm,tx]=(0,n.useState)(""),[tu,tp]=(0,n.useState)([]),[tg,th]=(0,n.useState)([]),[tb,tf]=(0,n.useState)(0),[ty,tj]=(0,n.useState)(1),[tv,tN]=(0,n.useState)(""),[tk,tw]=(0,n.useState)(""),[tC,t_]=(0,n.useState)(""),[tS,tL]=(0,n.useState)([]),[tD,tE]=(0,n.useState)("ai"),[tM,tB]=(0,n.useState)([]),[tA,tI]=(0,n.useState)(1),[tT,tU]=(0,n.useState)(0),[tR,tW]=(0,n.useState)(""),[tz,tP]=(0,n.useState)([]),[tF,tH]=(0,n.useState)(""),[tV,tO]=(0,n.useState)(""),[tK,tq]=(0,n.useState)([]),[tG,tX]=(0,n.useState)([]),[tY,tJ]=(0,n.useState)([]),[t$,tQ]=(0,n.useState)(0),[tZ,t0]=(0,n.useState)(1),[t2,t1]=(0,n.useState)(""),[t4,t5]=(0,n.useState)(""),[t3,t6]=(0,n.useState)(!1),[t7,t8]=(0,n.useState)(!1),[t9,se]=(0,n.useState)(null),[st,ss]=(0,n.useState)(!1),[sa,sn]=(0,n.useState)(!1),[sl,sr]=(0,n.useState)("profile"),[si,so]=(0,n.useState)(null),[sd,sc]=(0,n.useState)(""),[sm,sx]=(0,n.useState)([]),[su,sp]=(0,n.useState)(!1),[sg,sh]=(0,n.useState)({}),[sb,sf]=(0,n.useState)({}),[sy,sj]=(0,n.useState)({}),[sv,sN]=(0,n.useState)({}),[sk,sw]=(0,n.useState)([]),[sC,s_]=(0,n.useState)(null),[sS,sL]=(0,n.useState)(!1),[sD,sE]=(0,n.useState)([]),[sM,sB]=(0,n.useState)(null),[sA,sI]=(0,n.useState)(!1),[sT,sU]=(0,n.useState)(new Set),[sR,sW]=(0,n.useState)([]),[sz,sP]=(0,n.useState)(null),[sF,sH]=(0,n.useState)(!1),[sV,sO]=(0,n.useState)(new Set),[sK,sq]=(0,n.useState)(new Set),[sG,sX]=(0,n.useState)({}),[sY,sJ]=(0,n.useState)(new Set),[s$,sQ]=(0,n.useState)(null),[sZ,s0]=(0,n.useState)(!1),[s2,s1]=(0,n.useState)("general"),[s4,s5]=(0,n.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:""}),[s3,s6]=(0,n.useState)(!1),[s7,s8]=(0,n.useState)(!1),[s9,ae]=(0,n.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[at,as]=(0,n.useState)(!1),[aa,an]=(0,n.useState)(!1),[al,ar]=(0,n.useState)(!1),[ai,ao]=(0,n.useState)(null),[ad,ac]=(0,n.useState)({email_verification:{subject:"Подтвердите ваш email — {{siteName}}",body:""},registration_success:{subject:"Добро пожаловать в {{siteName}}!",body:""},password_reset:{subject:"Восстановление пароля — {{siteName}}",body:""},new_offer:{subject:"Новое предложение по вашей задаче \xab{{taskTitle}}\xbb",body:""},new_task:{subject:"Новая задача: {{taskTitle}}",body:""},offer_accepted:{subject:"Ваше предложение принято: {{taskTitle}}",body:'

Ваше предложение принято! \uD83C\uDF89

Привет, {{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:'

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

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

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

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

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

Λάβατε ανταμοιβή παραπομπής! \uD83C\uDF81

Γεια {{userName}},

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

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

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

You received a referral reward! \uD83C\uDF81

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:'

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

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

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

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

Перейти к аккаунту →'}}),[am,ax]=(0,n.useState)(null),[au,ap]=(0,n.useState)("el"),[ag,ah]=(0,n.useState)(!1),[ab,af]=(0,n.useState)(!1),[ay,aj]=(0,n.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[av,aN]=(0,n.useState)(!1),[ak,aw]=(0,n.useState)(!1),[aC,a_]=(0,n.useState)({enabled:!1,planId:"",days:"30"}),[aS,aL]=(0,n.useState)(!1),[aD,aE]=(0,n.useState)(!1),[aM,aB]=(0,n.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[aA,aI]=(0,n.useState)(!1),[aT,aU]=(0,n.useState)(!1),[aR,aW]=(0,n.useState)("el"),[az,aP]=(0,n.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[aF,aH]=(0,n.useState)(!1),[aV,aO]=(0,n.useState)(!1),[aK,aq]=(0,n.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[aG,aX]=(0,n.useState)(!1),[aY,aJ]=(0,n.useState)(!1),[a$,aQ]=(0,n.useState)(!1),[aZ,a0]=(0,n.useState)(!1),[a2,a1]=(0,n.useState)(null),[a4,a5]=(0,n.useState)(null),[a3,a6]=(0,n.useState)(null),[a7,a8]=(0,n.useState)({}),[a9,ne]=(0,n.useState)(!1),[nt,ns]=(0,n.useState)(null),[na,nn]=(0,n.useState)(!1),[nl,nr]=(0,n.useState)(!1),[ni,no]=(0,n.useState)([]),[nd,nc]=(0,n.useState)(!1),[nm,nx]=(0,n.useState)([]),[nu,np]=(0,n.useState)(!1),[ng,nh]=(0,n.useState)(null),[nb,nf]=(0,n.useState)(null),[ny,nj]=(0,n.useState)(null),[nv,nN]=(0,n.useState)(!1),nk=e=>{nj(e),nN(!1)},nw=e=>{nj(e),nN(!0)},[nC,n_]=(0,n.useState)(null),[nS,nL]=(0,n.useState)(!1),[nD,nE]=(0,n.useState)("uk"),[nM,nB]=(0,n.useState)("el"),[nA,nI]=(0,n.useState)({}),[nT,nU]=(0,n.useState)(null),[nR,nW]=(0,n.useState)(null),[nz,nP]=(0,n.useState)(null),[nF,nH]=(0,n.useState)(!1),[nV,nO]=(0,n.useState)(new Set),[nK,nq]=(0,n.useState)("broadcast"),[nG,nX]=(0,n.useState)(""),[nY,nJ]=(0,n.useState)(""),[n$,nQ]=(0,n.useState)(""),[nZ,n0]=(0,n.useState)("general"),[n2,n1]=(0,n.useState)(""),[n4,n5]=(0,n.useState)(!0),[n3,n6]=(0,n.useState)(!1),[n7,n8]=(0,n.useState)(null),[n9,le]=(0,n.useState)(null),[lt,ls]=(0,n.useState)(!1),la=!Q&&$&&(null==(e=$.user)?void 0:e.role)==="admin";async function ln(){if(nY.trim()){if("user"===nK&&!nG.trim())return void le("Укажите ID пользователя");n6(!0),le(null),n8(null);try{let e={title:nY.trim(),body:n$.trim()||void 0,type:nZ.trim()||void 0,referenceId:n2.trim()||void 0};if("broadcast"===nK){let t=await c.V7({...e,onlyActive:n4});n8(t)}else{let t=await c.g1(nG.trim(),e);n8(t)}}catch(e){le((null==e?void 0:e.message)||"Не удалось отправить push")}finally{n6(!1)}}}async function ll(e,t){let s=t?c.Wi:c.He,a=await s(e).catch(()=>null);a&&eo(t=>t.map(t=>t.id===e?a:t))}async function lr(){if(t9){ss(!0);try{var e,t,s,a,n,l;let r=await c.wl(t9.id,{firstName:t9.firstName,lastName:t9.lastName,phone:t9.phone||null,bio:t9.bio||null,role:t9.role,planId:t9.planId||null,isActive:t9.isActive,locale:t9.locale,languages:null!=(e=t9.languages)?e:[],personalSiteSlug:t9.personalSiteSlug||null,showContactInfo:null!=(t=t9.showContactInfo)&&t,notifyNewTasks:null!=(s=t9.notifyNewTasks)&&s,notifMessages:null==(a=t9.notifMessages)||a,skills:null!=(n=t9.skills)?n:[],siteSettings:null!=(l=t9.siteSettings)?l:{}});eo(e=>e.map(e=>e.id===t9.id?r:e)),se(null)}catch(e){}finally{ss(!1)}}}async function li(){if(t9){sn(!0);try{let e=await c.uQ(t9.id);se(t=>t?{...t,emailVerified:e.emailVerified}:t),eo(t=>t.map(t=>t.id===t9.id?{...t,emailVerified:e.emailVerified}:t))}catch(e){}finally{sn(!1)}}}async function lo(){if(!t9)return;let e=Number(t9.topUpAmount);if(e&&!(e<=0)){t6(!0);try{let t=await c.P0(t9.id,{amount:e,description:t9.topUpDescription||void 0});eo(e=>e.map(e=>e.id===t9.id?t.user:e)),se(e=>e?{...e,...t.user,topUpAmount:"",topUpDescription:""}:e),"balances"===et&&c.g0({page:tZ,userId:t2||void 0,kind:t4||void 0}).then(e=>{tJ(e.data),tQ(e.total)}).catch(()=>{})}catch(e){}finally{t6(!1)}}}async function ld(){if(!t9)return;let e=Number(t9.withdrawAmount);if(e&&!(e<=0)){t8(!0);try{let t=await c.hD(t9.id,{amount:e,description:t9.withdrawDescription||void 0});eo(e=>e.map(e=>e.id===t9.id?t.user:e)),se(e=>e?{...e,...t.user,withdrawAmount:"",withdrawDescription:""}:e),"balances"===et&&c.g0({page:tZ,userId:t2||void 0,kind:t4||void 0}).then(e=>{tJ(e.data),tQ(e.total)}).catch(()=>{})}catch(e){}finally{t8(!1)}}}async function lc(e){let t=sm.find(t=>t.id===e);if(t){sf(t=>({...t,[e]:!0}));try{var s,a,n;let l=await c.oq(e,{title:t.title,description:t.description||null,skills:null!=(s=t.skills)?s:[],categories:null!=(a=t.categories)?a:[],locations:null!=(n=t.locations)?n:[],isActive:t.isActive});sx(t=>t.map(t=>t.id===e?l:t))}catch(e){}finally{sf(t=>({...t,[e]:!1}))}}}async function lm(e){let t=await c.nf(e).catch(()=>null);if(t){let s=t.task||t;ej(t=>t.map(t=>(t.task||t).id===e?{...t,task:s}:t))}}async function lx(e,t){window.confirm("".concat(Z("admin.tasks.delete.confirm"),'\n"').concat(t,'"'))&&await c.GB(e).catch(()=>null)&&ej(t=>t.filter(t=>{var s;return((null==(s=t.task)?void 0:s.id)||t.id)!==e}))}async function lu(e,t){let s=await c.eU(e,t).catch(()=>null);s&&eB(t=>t.map(t=>t.id===e?{...t,...s}:t))}function lp(e){sB({parentId:null!=e?e:null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function lg(){if(sM){sI(!0);try{if(sM.id){let e=await c.Nt(sM.id,sM);sE(t=>t.map(t=>t.id===sM.id?e:t))}else{let e=await c.yJ({slug:sM.slug,nameEl:sM.nameEl,nameEn:sM.nameEn,nameRu:sM.nameRu,nameUk:sM.nameUk,parentId:sM.parentId,order:sM.order});sE(t=>[...t,e])}sB(null)}catch(e){}finally{sI(!1)}}}async function lh(e,t){window.confirm("".concat(Z("admin.loc.delete.confirm"),'\n"').concat(t,'"'))&&await c.zR(e).catch(()=>null)&&sE(t=>t.filter(t=>t.id!==e))}function lb(e){sP({parentId:null!=e?e:null,slug:"",icon:"\uD83D\uDCE6",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function lf(){if(sz){sH(!0);try{if(sz.id){let e=await c.$7(sz.id,sz);sW(t=>t.map(t=>t.id===sz.id?e:t))}else{let e=await c.zZ({slug:sz.slug,icon:sz.icon,namesEl:sz.namesEl,namesEn:sz.namesEn,namesRu:sz.namesRu,namesUk:sz.namesUk,parentId:sz.parentId,order:sz.order});sW(t=>[...t,e])}sP(null)}catch(e){}finally{sH(!1)}}}async function ly(e,t){window.confirm("".concat(Z("admin.cat.delete.confirm"),'\n"').concat(t,'"'))&&await c.K7(e).catch(()=>null)&&sW(t=>t.filter(t=>t.id!==e))}async function lj(e){let t=e.id,s=e.slug;if(sq(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s}),!sG[s]){sJ(e=>new Set(e).add(t));try{let e=await c.i_(s);sX(t=>({...t,[s]:e}))}catch(e){}finally{sJ(e=>{let s=new Set(e);return s.delete(t),s})}}}async function lv(){if(s$){s0(!0);try{if(s$.id){let e=await c.fP(s$.id,{nameEl:s$.nameEl,nameEn:s$.nameEn,nameRu:s$.nameRu,nameUk:s$.nameUk,order:s$.order});sX(t=>{var s;return{...t,[s$.catSlug]:(null!=(s=t[s$.catSlug])?s:[]).map(t=>t.id===s$.id?e:t)}})}else{let e=await c.S9({categorySlug:s$.catSlug,nameEl:s$.nameEl,nameEn:s$.nameEn,nameRu:s$.nameRu,nameUk:s$.nameUk,order:s$.order});sX(t=>{var s;return{...t,[s$.catSlug]:[...null!=(s=t[s$.catSlug])?s:[],e]}})}sQ(null)}catch(e){}finally{s0(!1)}}}async function lN(e,t){(e._skipConfirm||window.confirm('Удалить навык "'.concat(e.nameEl,'"?')))&&(e._skipConfirm||await c.hp(e.id).catch(()=>null))&&sX(s=>{var a;return{...s,[t]:(null!=(a=s[t])?a:[]).filter(t=>t.id!==e.id)}})}async function lk(){if(sC){sL(!0);try{let e={name:sC.name,description:sC.description||void 0,role:sC.role,tier:sC.tier,price:sC.price,oldPrice:sC.oldPrice||null,currency:sC.currency,maxTasks:sC.maxTasks?Number(sC.maxTasks):null,maxOffers:sC.maxOffers?Number(sC.maxOffers):null,maxCards:sC.maxCards?Number(sC.maxCards):null,maxMessagesPerDay:sC.maxMessagesPerDay?Number(sC.maxMessagesPerDay):null,maxOrdersPerDay:sC.maxOrdersPerDay?Number(sC.maxOrdersPerDay):null,maxSkills:sC.maxSkills?Number(sC.maxSkills):null,durationDays:sC.durationDays?Number(sC.durationDays):null,notifyNewTasks:sC.notifyNewTasks,searchBoost:sC.searchBoost,offersMultiplier:sC.offersMultiplier,canContactFreePlan:sC.canContactFreePlan,canContactProPlan:sC.canContactProPlan,canContactAll:sC.canContactAll,canShowContactInfo:sC.canShowContactInfo,canViewPhone:sC.canViewPhone,canUploadVideo:sC.canUploadVideo,hasFavorites:sC.hasFavorites,hasGoogleCalendar:sC.hasGoogleCalendar,hasVerifiedBadge:sC.hasVerifiedBadge,highlightedReviews:sC.highlightedReviews,hasPersonalSite:sC.hasPersonalSite,hasCanHelpNowStatus:sC.hasCanHelpNowStatus,hasNeedHelpStatus:sC.hasNeedHelpStatus,hasAutoResponse:sC.hasAutoResponse,hasAutoMatch:sC.hasAutoMatch,hasPriceList:sC.hasPriceList,receiveInstantDispatchFree:sC.receiveInstantDispatchFree,receiveInstantDispatchPro:sC.receiveInstantDispatchPro,features:sC.features?sC.features.split("\n").map(e=>e.trim()).filter(Boolean):[],isDefault:sC.isDefault,isActive:sC.isActive,order:sC.order};if(sC.id){let t=await c.td(sC.id,e);sw(e=>e.map(e=>e.id===sC.id?t:e))}else{let t=await c.qT(e);sw(e=>[...e,t])}sC.isDefault&&c.OX().then(sw).catch(()=>{}),s_(null)}catch(e){}finally{sL(!1)}}}async function lw(e,t){window.confirm('Удалить тариф "'.concat(t,'"?'))&&await c.bR(e).catch(()=>null)&&sw(t=>t.filter(t=>t.id!==e))}async function lC(){s6(!0);try{await c.CX({"general.siteName":s4.siteName,"general.siteUrl":s4.siteUrl,"general.contactEmail":s4.contactEmail,"general.supportPhone":s4.supportPhone}),s8(!0),setTimeout(()=>s8(!1),2500)}catch(e){}finally{s6(!1)}}async function l_(){as(!0);try{await c.CX({"smtp.host":s9.host,"smtp.port":s9.port,"smtp.username":s9.username,"smtp.password":s9.password,"smtp.fromName":s9.fromName,"smtp.fromEmail":s9.fromEmail,"smtp.encryption":s9.encryption}),an(!0),setTimeout(()=>an(!1),2500)}catch(e){}finally{as(!1)}}async function lS(e){var t,s;let a="".concat(e,"_").concat(au),n=null!=(s=null!=(t=ad[a])?t:ad[e])?s:{subject:"",body:""};if(n.subject||n.body){af(!0);try{await c.jg(a,n);let t=await c.wc({subject:n.subject,body:n.body,fromLocale:au});ac(s=>{let l={...s,[a]:n};for(let[s,a]of Object.entries(t))l["".concat(e,"_").concat(s)]=a;return l}),await Promise.all(Object.entries(t).map(t=>{let[s,a]=t;return c.jg("".concat(e,"_").concat(s),a)}))}catch(e){}finally{af(!1)}}}async function lL(e){let t="".concat(e,"_").concat(au);ah(!0);try{var s;await c.jg(t,null!=(s=ad[t])?s:{subject:"",body:""}),ax(null)}catch(e){}finally{ah(!1)}}async function lD(){aN(!0);try{await c.CX({"payment.epay.merchantId":ay.merchantId,"payment.epay.apiUser":ay.apiUser,"payment.epay.apiPassword":ay.apiPassword,"payment.epay.environment":ay.environment,"payment.epay.confirmationUrl":ay.confirmationUrl,"payment.epay.cancelUrl":ay.cancelUrl,"payment.epay.enabled":String(ay.enabled)}),aw(!0),setTimeout(()=>aw(!1),2500)}catch(e){}finally{aN(!1)}}async function lE(){aL(!0);try{await c.CX({referral_enabled:String(aC.enabled),referral_plan_id:aC.planId,referral_days:aC.days}),aE(!0),setTimeout(()=>aE(!1),2500)}catch(e){}finally{aL(!1)}}async function lM(){aI(!0);try{await c.CX({"seo.maintenanceMode":String(aM.maintenanceMode),"seo.indexingEnabled":String(aM.indexingEnabled),"seo.headScripts":aM.headScripts,"seo.siteTitle.el":aM.siteTitleEl,"seo.siteTitle.en":aM.siteTitleEn,"seo.siteTitle.ru":aM.siteTitleRu,"seo.siteTitle.uk":aM.siteTitleUk,"seo.siteDescription.el":aM.siteDescriptionEl,"seo.siteDescription.en":aM.siteDescriptionEn,"seo.siteDescription.ru":aM.siteDescriptionRu,"seo.siteDescription.uk":aM.siteDescriptionUk}),aU(!0),setTimeout(()=>aU(!1),2500)}catch(e){}finally{aI(!1)}}async function lB(){aH(!0);try{await c.CX({"social.telegram":az.telegram,"social.instagram":az.instagram,"social.facebook":az.facebook,"social.twitter":az.twitter,"social.youtube":az.youtube,"social.tiktok":az.tiktok,"social.whatsapp":az.whatsapp,"social.viber":az.viber}),aO(!0),setTimeout(()=>aO(!1),2500)}catch(e){}finally{aH(!1)}}async function lA(){aX(!0);try{await c.CX({"telegram.botToken":aK.botToken,"telegram.adminChatId":aK.adminChatId,"telegram.channelId.el":aK.channelIdEl,"telegram.channelId.en":aK.channelIdEn,"telegram.channelId.ru":aK.channelIdRu,"telegram.channelId.uk":aK.channelIdUk,"telegram.notifyRegistrations":String(aK.notifyRegistrations),"telegram.postNewTasks":String(aK.postNewTasks)}),aJ(!0),setTimeout(()=>aJ(!1),2500)}catch(e){}finally{aX(!1)}}async function lI(e){var t,s;let a=null!=(t=({admin:aK.adminChatId,el:aK.channelIdEl,en:aK.channelIdEn,ru:aK.channelIdRu,uk:aK.channelIdUk})[e])?t:"";"admin"===e?(aQ(!0),a1(null)):(a6(e),a8(t=>{let s={...t};return delete s[e],s}));try{let t=await c.qX(aK.botToken,a),n={ok:t.ok,msg:t.ok?t.botName?"@".concat(t.botName):Z("admin.settings.telegram.test_ok"):null!=(s=t.error)?s:Z("admin.settings.telegram.test_fail")};"admin"===e?a1(n):a8(t=>({...t,[e]:n}))}catch(s){let t={ok:!1,msg:Z("admin.settings.telegram.test_fail")};"admin"===e?a1(t):a8(s=>({...s,[e]:t}))}finally{"admin"===e?aQ(!1):a6(null)}}async function lT(){ne(!0),ns(null);try{var e;let t=await c.cl(aK.botToken);ns({ok:t.ok,msg:t.ok?"@".concat(t.botName):null!=(e=t.error)?e:Z("admin.settings.telegram.test_fail")})}catch(e){ns({ok:!1,msg:Z("admin.settings.telegram.test_fail")})}finally{ne(!1)}}if((0,n.useEffect)(()=>{var e;Q||$||J.push("/login"),!Q&&$&&(null==(e=$.user)?void 0:e.role)!=="admin"&&J.push("/")},[$,Q]),(0,n.useEffect)(()=>{la&&(c.dE().then(er).catch(()=>{}),c.bi().then(tq).catch(()=>{}),c.u4().then(tX).catch(()=>{}))},[la]),(0,n.useEffect)(()=>{la&&"users"===et&&(ls(!0),c.cS(ed,eu||void 0,eb||void 0).then(e=>{eo(e.data),ex(e.total)}).catch(()=>{}).finally(()=>ls(!1)))},[la,et,ed,eu,eb]),(0,n.useEffect)(()=>{la&&"tasks"===et&&(ls(!0),c.Yj(ev,eC||void 0,eD||void 0).then(e=>{ej(e.data),ew(e.total)}).catch(()=>{}).finally(()=>ls(!1)))},[la,et,ev,eC,eD]),(0,n.useEffect)(()=>{la&&"reports"===et&&(ls(!0),c.z5(eA).then(e=>{eB(e.data),eU(e.total)}).catch(()=>{}).finally(()=>ls(!1)))},[la,et,eA]),(0,n.useEffect)(()=>{if(!la||"support"!==et)return;ls(!0);let e={page:String(ez),limit:"30"};eV&&(e.status=eV),eK&&(e.type=eK),eG&&(e.q=eG),c.KZ(e).then(e=>{eW(e.data),eH(e.total)}).catch(()=>{}).finally(()=>ls(!1))},[la,et,ez,eV,eK,eG]),(0,n.useEffect)(()=>{la&&"balances"===et&&(ls(!0),c.g0({page:tZ,userId:t2||void 0,kind:t4||void 0}).then(e=>{tJ(e.data),tQ(e.total)}).catch(()=>{}).finally(()=>ls(!1)))},[la,et,tZ,t2,t4]),(0,n.useEffect)(()=>{la&&"logs"===et&&("ai"===tD?(ls(!0),c.j_(e3).then(e=>{e5(e.data),e8(e.total)}).catch(()=>{}).finally(()=>ls(!1))):"activity"===tD?c.yO({page:ta,event:tl||void 0,userId:ti||void 0,dateFrom:td||void 0,dateTo:tm||void 0}).then(e=>{var t;te(e.data),ts(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tp(e.eventTypes)}).catch(()=>{}):"mail"===tD?c.qt({page:ty,event:tv||void 0,dateFrom:tk||void 0,dateTo:tC||void 0}).then(e=>{var t;th(e.data),tf(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tL(e.eventTypes)}).catch(()=>{}):"notifications"===tD&&c.Br({page:tA,type:tR||void 0,dateFrom:tF||void 0,dateTo:tV||void 0}).then(e=>{var t;tB(e.data),tU(e.total),(null==(t=e.notifTypes)?void 0:t.length)&&tP(e.notifTypes)}).catch(()=>{}))},[la,et,tD,e3,ta,tl,ti,td,tm,ty,tv,tk,tC,tA,tR,tF,tV]),(0,n.useEffect)(()=>{tn(1)},[tl,ti,td,tm]),(0,n.useEffect)(()=>{tj(1)},[tv,tk,tC]),(0,n.useEffect)(()=>{tI(1)},[tR,tF,tV]),(0,n.useEffect)(()=>{la&&"plans"===et&&c.OX().then(sw).catch(()=>{})},[la,et]),(0,n.useEffect)(()=>{la&&"translations"===et&&(nL(!0),c.YQ().then(e=>n_(e.tables)).catch(()=>{}).finally(()=>nL(!1)))},[la,et]),(0,n.useEffect)(()=>{la&&"backup"===et&&((0,c.Em)("/admin/backup/settings").then(e=>nn(!!e.autoEnabled)).catch(()=>{}),nc(!0),(0,c.Em)("/admin/backup/tables").then(e=>no(e.tables||[])).catch(()=>{}).finally(()=>nc(!1)),(0,c.Em)("/admin/backup/list").then(e=>nx(e.files||[])).catch(()=>{}))},[la,et]),(0,n.useEffect)(()=>{la&&"referrals"===et&&(nH(!0),c.cJ().then(e=>nP(e)).catch(()=>{}).finally(()=>nH(!1)))},[la,et]),(0,n.useEffect)(()=>{la&&"users"===et&&0===sk.length&&c.OX().then(sw).catch(()=>{})},[la,et]),(0,n.useEffect)(()=>{ec(1)},[eu,eb]),(0,n.useEffect)(()=>{eN(1)},[eC,eD]),(0,n.useEffect)(()=>{t0(1)},[t2,t4]),(0,n.useEffect)(()=>{la&&"locations"===et&&c.k_().then(sE).catch(()=>{})},[la,et]),(0,n.useEffect)(()=>{la&&"categories"===et&&c.KD().then(sW).catch(()=>{})},[la,et]),(0,n.useEffect)(()=>{la&&"settings"===et&&(0===sk.length&&c.OX().then(sw).catch(()=>{}),c.rC().then(e=>{var t,s,a,n,l,r,i,o,d,c,m,x,u,p,g,h,b,f,y,j,v,N,k,w,C,_,S,L,D,E,M,B,A,I,T,U,R,W,z,P,F,H,V,O,K,q,G,X;s5({siteName:null!=(t=e["general.siteName"])?t:"CanHelp",siteUrl:null!=(s=e["general.siteUrl"])?s:"",contactEmail:null!=(a=e["general.contactEmail"])?a:"",supportPhone:null!=(n=e["general.supportPhone"])?n:""}),ae({host:null!=(l=e["smtp.host"])?l:"",port:null!=(r=e["smtp.port"])?r:"587",username:null!=(i=e["smtp.username"])?i:"",password:null!=(o=e["smtp.password"])?o:"",fromName:null!=(d=e["smtp.fromName"])?d:"CanHelp",fromEmail:null!=(c=e["smtp.fromEmail"])?c:"",encryption:null!=(m=e["smtp.encryption"])?m:"tls"}),aj({merchantId:null!=(x=e["payment.epay.merchantId"])?x:"",apiUser:null!=(u=e["payment.epay.apiUser"])?u:"",apiPassword:null!=(p=e["payment.epay.apiPassword"])?p:"",environment:null!=(g=e["payment.epay.environment"])?g:"test",confirmationUrl:null!=(h=e["payment.epay.confirmationUrl"])?h:"",cancelUrl:null!=(b=e["payment.epay.cancelUrl"])?b:"",enabled:"true"===e["payment.epay.enabled"]}),a_({enabled:"true"===e.referral_enabled,planId:null!=(j=null!=(y=null!=(f=e.referral_plan_id)?f:e.referral_customer_plan_id)?y:e.referral_specialist_plan_id)?j:"",days:null!=(k=null!=(N=null!=(v=e.referral_days)?v:e.referral_customer_days)?N:e.referral_specialist_days)?k:"30"}),aB({maintenanceMode:"true"===e["seo.maintenanceMode"],indexingEnabled:"false"!==e["seo.indexingEnabled"],headScripts:null!=(w=e["seo.headScripts"])?w:"",siteTitleEl:null!=(_=null!=(C=e["seo.siteTitle.el"])?C:e["seo.siteTitle"])?_:"",siteTitleEn:null!=(S=e["seo.siteTitle.en"])?S:"",siteTitleRu:null!=(L=e["seo.siteTitle.ru"])?L:"",siteTitleUk:null!=(D=e["seo.siteTitle.uk"])?D:"",siteDescriptionEl:null!=(M=null!=(E=e["seo.siteDescription.el"])?E:e["seo.siteDescription"])?M:"",siteDescriptionEn:null!=(B=e["seo.siteDescription.en"])?B:"",siteDescriptionRu:null!=(A=e["seo.siteDescription.ru"])?A:"",siteDescriptionUk:null!=(I=e["seo.siteDescription.uk"])?I:""}),aP({telegram:null!=(T=e["social.telegram"])?T:"",instagram:null!=(U=e["social.instagram"])?U:"",facebook:null!=(R=e["social.facebook"])?R:"",twitter:null!=(W=e["social.twitter"])?W:"",youtube:null!=(z=e["social.youtube"])?z:"",tiktok:null!=(P=e["social.tiktok"])?P:"",whatsapp:null!=(F=e["social.whatsapp"])?F:"",viber:null!=(H=e["social.viber"])?H:""}),aq({botToken:null!=(V=e["telegram.botToken"])?V:"",adminChatId:null!=(O=e["telegram.adminChatId"])?O:"",channelIdEl:null!=(K=e["telegram.channelId.el"])?K:"",channelIdEn:null!=(q=e["telegram.channelId.en"])?q:"",channelIdRu:null!=(G=e["telegram.channelId.ru"])?G:"",channelIdUk:null!=(X=e["telegram.channelId.uk"])?X:"",notifyRegistrations:"true"===e["telegram.notifyRegistrations"],postNewTasks:"true"===e["telegram.postNewTasks"]})}).catch(()=>{}),c.Lp().then(e=>{let t={};for(let s of e)t[s.key]={subject:s.subject,body:s.body};ac(e=>({...e,...t}))}).catch(()=>{}))},[la,et]),Q)return(0,a.jsx)("div",{className:"text-center py-20 text-gray-500",children:Z("common.loading")});let lU="ru"===ee?"ru-RU":"en"===ee?"en-US":"el-GR",lR=[{key:"stats",label:Z("admin.tab.stats"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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:Z("admin.tab.users"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),(0,a.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,a.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:Z("admin.tab.tasks"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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:Z("admin.tab.reports"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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:Z("admin.tab.categories"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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:Z("admin.tab.locations"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.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"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})},{key:"balances",label:Z("admin.tab.balances","Баланс"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.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"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z"})]})},{key:"plans",label:Z("admin.tab.plans"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,a.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]})},{key:"logs",label:Z("admin.tab.logs"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,a.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})},{key:"settings",label:Z("admin.tab.settings"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,a.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:"support",label:Z("admin.tab.support","Support"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})})},{key:"push",label:Z("admin.tab.push","Push"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.17V11a6 6 0 10-12 0v3.17a2 2 0 01-.6 1.43L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"backup",label:Z("admin.tab.backup","Backup"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})})},{key:"translations",label:Z("admin.tab.translations","Translations"),icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})})},{key:"dbcheck",label:Z("admin.tab.dbcheck","Проверка БД"),icon:(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})},{key:"referrals",label:"Рефералы",icon:(0,a.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}],lW={open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",completed:"bg-gray-100 text-gray-600",cancelled:"bg-red-100 text-red-600",draft:"bg-yellow-100 text-yellow-700"},lz={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},lP={spam:"bg-green-100 text-green-700",inappropriate:"bg-red-100 text-red-700",fraud:"bg-purple-100 text-purple-700",duplicate:"bg-green-100 text-green-700",other:"bg-gray-100 text-gray-600"};return(0,a.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("svg",{className:"w-7 h-7 text-yellow-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z"})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:Z("admin.title")})]}),(0,a.jsxs)(i(),{href:"/",className:"flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition",children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),Z("admin.back_home")]})]}),(0,a.jsxs)("div",{className:"flex gap-6",children:[(0,a.jsx)("aside",{className:"shrink-0 transition-all duration-200 ".concat(ea?"w-12":"w-52"),children:(0,a.jsxs)("nav",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,a.jsx)("button",{type:"button",onClick:()=>en(e=>!e),title:ea?"Развернуть меню":"Свернуть меню",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:(0,a.jsx)("svg",{className:"w-4 h-4 transition-transform duration-200 ".concat(ea?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),lR.map(e=>{let{key:t,label:s,icon:n}=e;return(0,a.jsxs)("button",{onClick:()=>es(t),title:ea?s:void 0,className:"w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(et===t?"bg-green-50 text-green-700 border-r-2 border-green-600":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"," ").concat(ea?"justify-center px-3":"gap-3 px-4"),children:[(0,a.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:n}),!ea&&(0,a.jsx)("span",{children:s})]},t)})]})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:["stats"===et&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:Z("admin.stats.users"),value:null==el?void 0:el.userCount,icon:(0,a.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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-green-600"},{label:Z("admin.stats.specialists"),value:null==el?void 0:el.specialistCount,icon:(0,a.jsxs)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,a.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"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),color:"text-purple-600"},{label:Z("admin.stats.tasks"),value:null==el?void 0:el.taskCount,icon:(0,a.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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:Z("admin.stats.offers"),value:null==el?void 0:el.offerCount,icon:(0,a.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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-green-600"},{label:Z("admin.stats.reviews"),value:null==el?void 0:el.reviewCount,icon:(0,a.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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(e=>{let{label:t,value:s,icon:n,color:l}=e;return(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,a.jsx)("div",{className:"mb-2 ".concat(l),children:n}),(0,a.jsx)("div",{className:"text-3xl font-bold ".concat(l),children:null!=s?s:"—"}),(0,a.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:t})]},t)})}),(null==el?void 0:el.tasksByDay)&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800",children:Z("admin.stats.activity_30d")}),(0,a.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),Z("admin.stats.users_label")]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-purple-400 inline-block rounded"}),Z("admin.stats.specialists_label")]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),Z("admin.stats.tasks_label")]})]})]}),(0,a.jsx)(T,{series:[{data:el.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:Z("admin.stats.users_label")},{data:el.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:Z("admin.stats.specialists_label")},{data:el.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:Z("admin.stats.tasks_label")}]})]}),(null==el?void 0:el.tasksByStatus)&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800 mb-5",children:Z("admin.stats.tasks_by_status")}),(0,a.jsx)("div",{className:"space-y-3",children:(()=>{let e=el.tasksByStatus.reduce((e,t)=>e+Number(t.count),0)||1,t={open:{label:Z("admin.task_status.open"),bg:"bg-green-50",bar:"bg-green-500"},in_progress:{label:Z("admin.task_status.in_progress"),bg:"bg-green-50",bar:"bg-green-500"},completed:{label:Z("admin.task_status.completed"),bg:"bg-gray-50",bar:"bg-gray-400"},cancelled:{label:Z("admin.task_status.cancelled"),bg:"bg-red-50",bar:"bg-red-400"},draft:{label:Z("admin.task_status.draft"),bg:"bg-yellow-50",bar:"bg-yellow-400"}},s=["open","in_progress","completed","draft","cancelled"];return[...el.tasksByStatus].sort((e,t)=>s.indexOf(e.status)-s.indexOf(t.status)).map(s=>{var n;let{status:l,count:r}=s,i=null!=(n=t[l])?n:{label:l,bg:"bg-gray-50",bar:"bg-gray-300"},o=Math.round(Number(r)/e*100);return(0,a.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg ".concat(i.bg),children:[(0,a.jsx)("span",{className:"text-sm text-gray-600 w-28 shrink-0",children:i.label}),(0,a.jsx)("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-full ".concat(i.bar," transition-all"),style:{width:"".concat(o,"%")}})}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-700 w-8 text-right",children:r}),(0,a.jsxs)("span",{className:"text-xs text-gray-400 w-8",children:[o,"%"]})]},l)})})()})]}),tK.length>0&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800",children:Z("admin.stats.notif_chart_title")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-orange-500 inline-block rounded"}),Z("admin.stats.notif_label")]})]}),(0,a.jsx)(T,{series:[{data:tK,color:"#f97316",fill:"#f9731615",label:Z("admin.stats.notif_label")}]})]}),tG.length>0&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800",children:Z("admin.stats.mail_chart_title")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),Z("admin.stats.mail_label")]})]}),(0,a.jsx)(T,{series:[{data:tG,color:"#0ea5e9",fill:"#0ea5e915",label:Z("admin.stats.mail_label")}]})]}),el&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800",children:Z("admin.stats.tokens_title")}),(0,a.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-violet-500 inline-block rounded"}),Z("admin.stats.tokens_out")]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),Z("admin.stats.tokens_in")]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"rounded-lg bg-violet-50 border border-violet-100 px-4 py-3",children:[(0,a.jsx)("div",{className:"text-xs text-violet-600 mb-1",children:Z("admin.stats.tokens_out_label")}),(0,a.jsx)("div",{className:"text-2xl font-bold text-violet-700",children:Number(el.totalOutputTokens).toLocaleString()})]}),(0,a.jsxs)("div",{className:"rounded-lg bg-sky-50 border border-sky-100 px-4 py-3",children:[(0,a.jsx)("div",{className:"text-xs text-sky-600 mb-1",children:Z("admin.stats.tokens_in_label")}),(0,a.jsx)("div",{className:"text-2xl font-bold text-sky-700",children:Number(el.totalInputTokens).toLocaleString()})]}),(0,a.jsxs)("div",{className:"rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3",children:[(0,a.jsx)("div",{className:"text-xs text-emerald-600 mb-1",children:Z("admin.stats.cost_label")}),(0,a.jsxs)("div",{className:"text-2xl font-bold text-emerald-700",children:["$",Number(null!=(s=el.totalCostUsd)?s:0).toFixed(4)]})]})]}),(null==(t=el.tokensByMonth)?void 0:t.length)>0&&(0,a.jsx)(B,{dateLocale:lU,series:[{data:el.tokensByMonth.map(e=>({month:e.month,count:Number(e.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:Z("admin.stats.tokens_out_label")},{data:el.tokensByMonth.map(e=>({month:e.month,count:Number(e.input)})),color:"#0ea5e9",fill:"#0ea5e915",label:Z("admin.stats.tokens_in_label")}]})]})]}),"users"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,a.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),ep(eg)},children:[(0,a.jsx)("input",{value:eg,onChange:e=>eh(e.target.value),placeholder:Z("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"}),(0,a.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:Z("tasks.search.btn")})]}),(0,a.jsxs)("select",{value:eb,onChange:e=>ef(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:Z("admin.filter.all_roles")}),(0,a.jsx)("option",{value:"user",children:Z("admin.user_edit.role.user")}),(0,a.jsx)("option",{value:"admin",children:Z("profile.role.admin")})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.user")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.email")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.role")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:"Тариф"}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.registered")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.status")}),(0,a.jsx)("th",{className:"px-4 py-3"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:lt?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:Z("common.loading")})}):0===ei.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):ei.map(e=>{var t,s;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:(0,m.H)(e.firstName,e.lastName,e.name)}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.email}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("admin"===e.role?"bg-red-100 text-red-700":"specialist"===e.role?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"),children:Z("profile.role.".concat(e.role))||e.role})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-400 text-xs",children:e.planId?null!=(s=null==(t=sk.find(t=>t.id===e.planId))?void 0:t.name)?s:(0,a.jsxs)("span",{className:"font-mono",children:[e.planId.slice(0,8),"…"]}):(0,a.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(e.createdAt).toLocaleDateString(lU)}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(!1!==e.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-600"),children:!1!==e.isActive?Z("admin.users.active"):Z("admin.users.inactive")})}),(0,a.jsx)("td",{className:"px-4 py-3 text-right",children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,a.jsx)("button",{onClick:()=>{sr("profile"),sc(""),so(null),sx([]),sh({}),sf({}),sj({}),sN({}),se({...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),c.jd(e.id).then(e=>se(t=>t&&t.id===e.id?{...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}:t)).catch(()=>{})},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:(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})})}),"admin"!==e.role&&(0,a.jsx)("button",{onClick:()=>ll(e.id,!1!==e.isActive),className:"text-xs px-3 py-1 rounded-lg font-medium ".concat(!1!==e.isActive?"bg-red-50 text-red-600 hover:bg-red-100":"bg-green-50 text-green-600 hover:bg-green-100"),children:!1!==e.isActive?Z("admin.users.deactivate"):Z("admin.users.activate")})]})})]},e.id)})})]}),(0,a.jsx)(L,{page:ed,total:em,limit:20,onChange:ec,totalLabel:Z("admin.pagination.total")})]})]}),"balances"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,a.jsx)("input",{value:t2,onChange:e=>t1(e.target.value),placeholder:Z("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"}),(0,a.jsxs)("select",{value:t4,onChange:e=>t5(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:Z("admin.balance.filter.all","Все операции")}),(0,a.jsx)("option",{value:"topup",children:Z("admin.balance.kind.topup","Пополнение")}),(0,a.jsx)("option",{value:"plan_purchase",children:Z("admin.balance.kind.plan_purchase","Списание за тариф")}),(0,a.jsx)("option",{value:"admin_topup",children:Z("admin.balance.kind.admin_topup","Пополнение админом")}),(0,a.jsx)("option",{value:"admin_adjustment",children:Z("admin.balance.kind.admin_adjustment","Корректировка")})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.user")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.balance.col.operation","Операция")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.balance.col.amount","Сумма")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.balance.col.result","Баланс")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.balance.col.description","Описание")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.balance.col.date","Дата")})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:lt?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:Z("common.loading")})}):0===tY.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:Z("admin.balance.empty","Записей пока нет")})}):tY.map(e=>{let t="credit"===e.direction,s="topup"===e.kind?Z("admin.balance.kind.topup","Пополнение"):"plan_purchase"===e.kind?Z("admin.balance.kind.plan_purchase","Списание за тариф"):"admin_topup"===e.kind?Z("admin.balance.kind.admin_topup","Пополнение админом"):Z("admin.balance.kind.admin_adjustment","Корректировка");return(0,a.jsxs)("tr",{className:"hover:bg-gray-50 align-top",children:[(0,a.jsxs)("td",{className:"px-4 py-3",children:[(0,a.jsx)("div",{className:"font-medium text-gray-800",children:e.userName||"—"}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.userEmail||e.userId})]}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(t?"bg-emerald-50 text-emerald-700":"bg-rose-50 text-rose-700"),children:s})}),(0,a.jsxs)("td",{className:"px-4 py-3 font-semibold ".concat(t?"text-emerald-700":"text-rose-700"),children:[t?"+":"-",Number(e.amount).toFixed(2)," ",e.currency]}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:(0,a.jsxs)("div",{children:[Number(e.balanceBefore).toFixed(2)," → ",Number(e.balanceAfter).toFixed(2)," ",e.currency]})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 max-w-sm",children:e.description||"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(lU)})]},e.id)})})]}),(0,a.jsx)(L,{page:tZ,total:t$,limit:50,onChange:t0,totalLabel:Z("admin.pagination.total")})]})]}),"tasks"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,a.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),e_(eS)},children:[(0,a.jsx)("input",{value:eS,onChange:e=>eL(e.target.value),placeholder:Z("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"}),(0,a.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:Z("tasks.search.btn")})]}),(0,a.jsxs)("select",{value:eD,onChange:e=>eE(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:Z("admin.filter.all_statuses")}),["open","in_progress","completed","cancelled","draft"].map(e=>(0,a.jsx)("option",{value:e,children:Z("task.status.".concat(e),e)},e))]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.title")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.customer")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.status")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.budget")}),(0,a.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:Z("admin.col.created")}),(0,a.jsx)("th",{className:"px-4 py-3"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:lt?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:Z("common.loading")})}):0===ey.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):ey.map(e=>{var t,s;let n=e.task||e,l=e.customer;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800 max-w-xs",children:(0,a.jsx)(i(),{href:"/tasks/".concat(n.id),className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===ee&&n.titleEn||"ru"===ee&&n.titleRu||"uk"===ee&&n.titleUk||n.titleEl||n.title})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:null!=(t=null==l?void 0:l.name)?t:"—"}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(s=lW[n.status])?s:"bg-gray-100 text-gray-600"),children:Z("task.status.".concat(n.status),n.status)})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500",children:n.budget?"".concat((0,x.$g)(n.budget),"€"):"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(n.createdAt).toLocaleDateString(lU)}),(0,a.jsx)("td",{className:"px-4 py-3 text-right",children:(0,a.jsxs)("div",{className:"flex gap-1.5 justify-end",children:["cancelled"!==n.status&&"completed"!==n.status&&(0,a.jsx)("button",{onClick:()=>lm(n.id),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100",children:Z("admin.tasks.cancel")}),(0,a.jsx)("button",{onClick:()=>lx(n.id,"en"===ee&&n.titleEn||"ru"===ee&&n.titleRu||"uk"===ee&&n.titleUk||n.titleEl||n.title),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100",children:Z("admin.tasks.delete")})]})})]},n.id)})})]}),(0,a.jsx)(L,{page:ev,total:ek,limit:20,onChange:eN,totalLabel:Z("admin.pagination.total")})]})]}),"categories"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)("p",{className:"text-sm text-gray-500",children:Z("admin.cat.hint")}),(0,a.jsxs)("button",{onClick:()=>lb(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",Z("admin.cat.add_root")]})]}),sz&&(0,a.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,a.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[sz.id?Z("admin.cat.edit"):Z("admin.cat.new"),sz.parentId&&(0,a.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",Z("admin.cat.subcategory"),")"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.cat.slug")}),(0,a.jsx)("input",{value:sz.slug,onChange:e=>sP(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. repairs"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.cat.icon")}),(0,a.jsx)(f,{value:sz.icon,onChange:e=>sP(t=>t&&{...t,icon:e})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.cat.order")}),(0,a.jsx)("input",{type:"number",value:sz.order,onChange:e=>sP(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,a.jsx)("input",{value:sz.namesEl,onChange:e=>sP(t=>t&&{...t,namesEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,a.jsx)("input",{value:sz.namesEn,onChange:e=>sP(t=>t&&{...t,namesEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,a.jsx)("input",{value:sz.namesRu,onChange:e=>sP(t=>t&&{...t,namesRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,a.jsx)("input",{value:sz.namesUk,onChange:e=>sP(t=>t&&{...t,namesUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),sz.id&&(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mb-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:sz.isActive,onChange:e=>sP(t=>t&&{...t,isActive:e.target.checked})}),Z("admin.cat.active")]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:lf,disabled:sF,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sF?Z("common.saving"):Z("common.save")}),(0,a.jsx)("button",{onClick:()=>sP(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:Z("common.cancel")})]})]}),(0,a.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===sR.length?(0,a.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:Z("admin.cat.empty")}):(0,a.jsx)(w,{rows:sR,parentId:null,depth:0,locale:ee,expanded:sV,onToggle:function(e){sO(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onEdit:function(e){var t,s,a,n,l,r,i,o,d,c,m,x,u,p,g;sP({id:e.id,parentId:null!=(l=e.parentId)?l:null,slug:e.slug,icon:e.icon,namesEl:null!=(i=null!=(r=e.namesEl)?r:null==(t=e.names)?void 0:t.el)?i:"",namesEn:null!=(d=null!=(o=e.namesEn)?o:null==(s=e.names)?void 0:s.en)?d:"",namesRu:null!=(m=null!=(c=e.namesRu)?c:null==(a=e.names)?void 0:a.ru)?m:"",namesUk:null!=(u=null!=(x=e.namesUk)?x:null==(n=e.names)?void 0:n.uk)?u:"",order:null!=(p=e.order)?p:0,isActive:null==(g=e.isActive)||g})},onDelete:ly,onAddChild:lb,skillsExpanded:sK,skillsCache:sG,skillsLoading:sY,onToggleSkills:lj,skillForm:s$,skillSaving:sZ,onOpenAddSkill:function(e){sQ({catSlug:e,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(e,t){var s,a,n,l,r;sQ({id:e.id,catSlug:t,nameEl:null!=(s=e.nameEl)?s:"",nameEn:null!=(a=e.nameEn)?a:"",nameRu:null!=(n=e.nameRu)?n:"",nameUk:null!=(l=e.nameUk)?l:"",order:null!=(r=e.order)?r:0})},onSaveSkill:lv,onDeleteSkill:lN,onCancelSkillForm:()=>sQ(null),onSkillFormChange:sQ,t:Z})})]}),"locations"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)("p",{className:"text-sm text-gray-500",children:Z("admin.loc.hint")}),(0,a.jsxs)("button",{onClick:()=>lp(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",Z("admin.loc.add_city")]})]}),sM&&(0,a.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,a.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[sM.id?Z("admin.loc.edit"):Z("admin.loc.new"),sM.parentId&&(0,a.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",Z("admin.loc.district"),")"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.cat.slug")}),(0,a.jsx)("input",{value:sM.slug,onChange:e=>sB(t=>t&&{...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,a.jsx)("input",{value:sM.nameEl,onChange:e=>sB(t=>t&&{...t,nameEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,a.jsx)("input",{value:sM.nameEn,onChange:e=>sB(t=>t&&{...t,nameEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,a.jsx)("input",{value:sM.nameRu,onChange:e=>sB(t=>t&&{...t,nameRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Z("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,a.jsx)("input",{value:sM.nameUk,onChange:e=>sB(t=>t&&{...t,nameUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,a.jsxs)("div",{className:"w-24",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.cat.order")}),(0,a.jsx)("input",{type:"number",value:sM.order,onChange:e=>sB(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),sM.id&&(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mt-4",children:[(0,a.jsx)("input",{type:"checkbox",checked:sM.isActive,onChange:e=>sB(t=>t&&{...t,isActive:e.target.checked})}),Z("admin.cat.active")]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:lg,disabled:sA,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sA?Z("common.saving"):Z("common.save")}),(0,a.jsx)("button",{onClick:()=>sB(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:Z("common.cancel")})]})]}),(0,a.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===sD.length?(0,a.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:Z("admin.loc.empty")}):(0,a.jsx)(k,{rows:sD,parentId:null,depth:0,locale:ee,expanded:sT,onToggle:function(e){sU(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onEdit:function(e){var t,s,a,n,l,r,i,o,d,c,m,x,u,p,g;sB({id:e.id,parentId:null!=(l=e.parentId)?l:null,slug:e.slug,nameEl:null!=(i=null!=(r=e.nameEl)?r:null==(t=e.names)?void 0:t.el)?i:"",nameEn:null!=(d=null!=(o=e.nameEn)?o:null==(s=e.names)?void 0:s.en)?d:"",nameRu:null!=(m=null!=(c=e.nameRu)?c:null==(a=e.names)?void 0:a.ru)?m:"",nameUk:null!=(u=null!=(x=e.nameUk)?x:null==(n=e.names)?void 0:n.uk)?u:"",order:null!=(p=e.order)?p:0,isActive:null==(g=e.isActive)||g})},onDelete:lh,onAddChild:lp,t:Z})})]}),"reports"===et&&(0,a.jsxs)("div",{className:"space-y-3",children:[lt?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("common.loading")}):0===eM.length?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("admin.reports.none")}):eM.map(e=>{var t,s,n;return(0,a.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(s=lz[e.status])?s:"bg-gray-100 text-gray-500"),children:e.status}),(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(n=lP[e.reason])?n:"bg-gray-100 text-gray-600"),children:e.reason}),(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["task"===e.targetType?Z("admin.reports.target.task"):Z("admin.reports.target.user"),":"," ",e.targetTitle?(0,a.jsx)(i(),{href:"task"===e.targetType?"/tasks/".concat(e.targetId):"/users/".concat(e.targetId),className:"text-green-600 hover:underline font-medium",target:"_blank",children:e.targetTitle}):(0,a.jsxs)("span",{className:"font-mono",children:["#",null==(t=e.targetId)?void 0:t.slice(0,8)]})]})]}),e.reporterName&&(0,a.jsxs)("p",{className:"text-xs text-gray-400 mb-1",children:[Z("admin.col.reporter"),": ",(0,a.jsx)("span",{className:"font-medium text-gray-600",children:e.reporterName})]}),e.description&&(0,a.jsx)("p",{className:"text-sm text-gray-700",children:e.description}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:new Date(e.createdAt).toLocaleString(lU)})]}),"pending"===e.status&&(0,a.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,a.jsx)("button",{onClick:()=>lu(e.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:Z("admin.reports.reviewed")}),(0,a.jsx)("button",{onClick:()=>lu(e.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:Z("admin.reports.dismiss")})]})]})},e.id)}),(0,a.jsx)(L,{page:eA,total:eT,limit:20,onChange:eI,totalLabel:Z("admin.pagination.total")})]}),"logs"===et&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit",children:[{key:"ai",label:Z("admin.logs.subtab.ai")},{key:"activity",label:Z("admin.logs.subtab.activity")},{key:"mail",label:Z("admin.logs.subtab.mail")},{key:"notifications",label:Z("admin.logs.subtab.notifications")}].map(e=>{let{key:t,label:s}=e;return(0,a.jsx)("button",{onClick:()=>tE(t),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(tD===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:s},t)})}),"ai"===tD&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:[Z("admin.pagination.total"),": ",e7]}),(0,a.jsxs)("button",{onClick:()=>{e6(1),c.j_(1).then(e=>{e5(e.data),e8(e.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:[(0,a.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),Z("common.refresh")]})]}),lt?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("common.loading")}):0===e4.length?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("admin.logs.empty")}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.date")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.provider")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.model")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.action")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.langs")}),(0,a.jsx)("th",{className:"px-4 py-3 text-right",children:Z("admin.logs.in")}),(0,a.jsx)("th",{className:"px-4 py-3 text-right",children:Z("admin.logs.out")}),(0,a.jsx)("th",{className:"px-4 py-3 text-right",children:Z("admin.logs.total")}),(0,a.jsx)("th",{className:"px-4 py-3 text-right",children:Z("admin.logs.ms")}),(0,a.jsx)("th",{className:"px-4 py-3 text-center",children:Z("admin.logs.status")})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:e4.map(e=>{var t,s,n,l,r;return(0,a.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(lU)}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("anthropic"===e.provider?"bg-purple-100 text-purple-700":"bg-green-100 text-green-700"),children:e.provider})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600 font-mono text-xs",children:e.model}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.action}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.fromLocale&&e.toLocale?"".concat(e.fromLocale," → ").concat(e.toLocale):"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(t=e.inputTokens)?t:"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(s=e.outputTokens)?s:"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-right font-medium",children:null!=(n=e.totalTokens)?n:"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:null!=(l=e.durationMs)?l:"—"}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:e.success?(0,a.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,a.jsx)("span",{className:"text-red-500 flex justify-center",title:null!=(r=e.error)?r:"",children:(0,a.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,a.jsx)(L,{page:e3,total:e7,limit:50,onChange:e6,totalLabel:Z("admin.pagination.total")})]}),"activity"===tD&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.activity.event")}),(0,a.jsxs)("select",{value:tl,onChange:e=>tr(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]",children:[(0,a.jsx)("option",{value:"",children:Z("admin.activity.all_events")}),tu.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.activity.from")}),(0,a.jsx)("input",{type:"date",value:td,onChange:e=>tc(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.activity.to")}),(0,a.jsx)("input",{type:"date",value:tm,onChange:e=>tx(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tl||td||tm||ti)&&(0,a.jsxs)("button",{onClick:()=>{tr(""),tc(""),tx(""),to("")},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:[(0,a.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Z("admin.activity.reset")]}),(0,a.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[Z("admin.activity.total"),": ",tt]})]}),0===e9.length?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("admin.activity.empty")}):(0,a.jsx)("div",{className:"space-y-2",children:e9.map(e=>(0,a.jsx)(M,{entry:e,dateLocale:lU,onFilterUser:e=>{to(e),tr("")},t:Z},e.id))}),(0,a.jsx)(L,{page:ta,total:tt,limit:50,onChange:tn,totalLabel:Z("admin.pagination.total")})]}),"mail"===tD&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.mail.event")}),(0,a.jsxs)("select",{value:tv,onChange:e=>tN(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,a.jsx)("option",{value:"",children:Z("admin.mail.all_events")}),tS.map(e=>(0,a.jsx)("option",{value:e,children:Z("admin.event.".concat(e.replace(/\./g,"_")),e)},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.mail.from")}),(0,a.jsx)("input",{type:"date",value:tk,onChange:e=>tw(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.mail.to")}),(0,a.jsx)("input",{type:"date",value:tC,onChange:e=>t_(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tv||tk||tC)&&(0,a.jsxs)("button",{onClick:()=>{tN(""),tw(""),t_("")},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:[(0,a.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Z("admin.mail.reset")]}),(0,a.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[Z("admin.mail.total"),": ",tb]})]}),0===tg.length?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("admin.mail.empty")}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.date")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.mail.recipient")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.mail.event")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.mail.provider")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.mail.details")}),(0,a.jsx)("th",{className:"px-4 py-3 text-center",children:Z("admin.mail.status")})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:tg.map(e=>{let t=D(e.details),s="string"==typeof(null==t?void 0:t.provider)?t.provider:"—",n="string"==typeof(null==t?void 0:t.to)?t.to:e.userEmail||"—",l="string"==typeof(null==t?void 0:t.subject)?t.subject:"",r="string"==typeof(null==t?void 0:t.error)?t.error:"",i="email.sent"===e.event||"admin.email.test.sent"===e.event;return(0,a.jsxs)("tr",{className:"bg-white hover:bg-gray-50 align-top",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(lU)}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-700",children:n}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700",children:Z("admin.event.".concat(e.event.replace(/\./g,"_")),e.event)})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600",children:s}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-md",children:(0,a.jsx)("div",{className:"truncate",title:l||r||void 0,children:l||r||"—"})}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:i?(0,a.jsx)("span",{className:"text-green-600 inline-flex justify-center",title:Z("admin.mail.success"),children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,a.jsx)("span",{className:"text-red-500 inline-flex justify-center",title:r||Z("admin.mail.failed"),children:(0,a.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,a.jsx)(L,{page:ty,total:tb,limit:50,onChange:tj,totalLabel:Z("admin.pagination.total")})]}),"notifications"===tD&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.notif_logs.type")}),(0,a.jsxs)("select",{value:tR,onChange:e=>tW(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,a.jsx)("option",{value:"",children:Z("admin.filter.all")}),tz.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.activity.from")}),(0,a.jsx)("input",{type:"date",value:tF,onChange:e=>tH(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.activity.to")}),(0,a.jsx)("input",{type:"date",value:tV,onChange:e=>tO(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tR||tF||tV)&&(0,a.jsxs)("button",{onClick:()=>{tW(""),tH(""),tO("")},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:[(0,a.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Z("admin.activity.reset")]}),(0,a.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[Z("admin.pagination.total"),": ",tT]})]}),0===tM.length?(0,a.jsx)("div",{className:"text-center py-10 text-gray-400",children:Z("admin.notif_logs.empty")}):(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.logs.date")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.col.user")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.notif_logs.type")}),(0,a.jsx)("th",{className:"px-4 py-3 text-left",children:Z("admin.notif_logs.title")}),(0,a.jsx)("th",{className:"px-4 py-3 text-center",children:Z("admin.notif_logs.read")})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-100",children:tM.map(e=>{var t,s;return(0,a.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(lU)}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-700",children:null!=(s=null!=(t=e.recipientName)?t:e.recipientEmail)?s:e.recipientId}),(0,a.jsx)("td",{className:"px-4 py-3",children:(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:e.type})}),(0,a.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-xs truncate",children:e.title}),(0,a.jsx)("td",{className:"px-4 py-3 text-center",children:e.isRead?(0,a.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,a.jsx)("span",{className:"text-gray-400 flex justify-center",children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"})})})})]},e.id)})})]})}),(0,a.jsx)(L,{page:tA,total:tT,limit:50,onChange:tI,totalLabel:Z("admin.pagination.total")})]})]}),"plans"===et&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,a.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,a.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),Z("admin.plans.title")]}),(0,a.jsx)("button",{onClick:function(){s_({name:"",description:"",role:"customer",tier:"free",price:"0",oldPrice:"",currency:"EUR",maxTasks:"",maxOffers:"",maxCards:"",maxMessagesPerDay:"",maxOrdersPerDay:"",maxSkills:"",durationDays:"",searchBoost:0,offersMultiplier:"1.00",features:"",isDefault:!1,isActive:!0,order:0,notifyNewTasks:!1,canContactFreePlan:!1,canContactProPlan:!0,canContactAll:!1,canShowContactInfo:!1,canViewPhone:!1,canUploadVideo:!1,hasFavorites:!1,hasGoogleCalendar:!1,hasVerifiedBadge:!1,highlightedReviews:!1,hasPersonalSite:!1,hasCanHelpNowStatus:!1,hasNeedHelpStatus:!1,hasAutoResponse:!1,hasAutoMatch:!1,hasPriceList:!1,receiveInstantDispatchFree:!1,receiveInstantDispatchPro:!1})},className:"bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium",children:Z("admin.plans.add")})]}),sC&&(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800",children:sC.id?Z("admin.plans.form.edit"):Z("admin.plans.form.new")}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.name")}),(0,a.jsx)("input",{value:sC.name,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.price")}),(0,a.jsx)("input",{type:"number",min:"0",step:"0.01",value:sC.price,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.old_price")}),(0,a.jsx)("input",{type:"number",min:"0",step:"0.01",value:null!=(r=sC.oldPrice)?r:"",onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.tier")}),(0,a.jsxs)("select",{value:sC.tier,onChange:e=>s_({...sC,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:[(0,a.jsx)("option",{value:"free",children:Z("admin.plans.form.tier.free")}),(0,a.jsx)("option",{value:"pro",children:Z("admin.plans.form.tier.pro")}),(0,a.jsx)("option",{value:"ultimate",children:Z("admin.plans.form.tier.ultimate")})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.description")}),(0,a.jsx)("input",{value:sC.description,onChange:e=>s_({...sC,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"})]}),(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:Z("admin.plans.form.section.limits")}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_tasks")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxTasks,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_offers")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxOffers,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_cards")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxCards,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_messages_day")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxMessagesPerDay,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_orders_day")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxOrdersPerDay,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.max_skills")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.maxSkills,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.duration_days")}),(0,a.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:sC.durationDays,onChange:e=>s_({...sC,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"})]})]}),(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:Z("admin.plans.form.section.boost")}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.search_boost")}),(0,a.jsx)("input",{type:"number",min:"0",value:sC.searchBoost,onChange:e=>s_({...sC,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.offers_multiplier")}),(0,a.jsx)("input",{type:"number",min:"0",step:"0.01",value:sC.offersMultiplier,onChange:e=>s_({...sC,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"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.plans.form.features")}),(0,a.jsx)("textarea",{rows:3,value:sC.features,onChange:e=>s_({...sC,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"})]}),(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:Z("admin.plans.form.section.contact")}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["canContactFreePlan",Z("admin.plans.form.can_contact_free")],["canContactProPlan",Z("admin.plans.form.can_contact_pro")],["canContactAll",Z("admin.plans.form.can_contact_all")],["canShowContactInfo",Z("admin.plans.form.can_show_contact")],["canViewPhone",Z("admin.plans.form.can_view_phone")]].map(e=>{let[t,s]=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,a.jsx)("input",{type:"checkbox",checked:sC[t],onChange:e=>s_({...sC,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),s]},t)})}),(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:Z("admin.plans.form.section.features")}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["notifyNewTasks",Z("admin.plans.form.notify")],["canUploadVideo",Z("admin.plans.form.upload_video")],["hasFavorites",Z("admin.plans.form.favorites")],["hasGoogleCalendar",Z("admin.plans.form.google_calendar")],["hasVerifiedBadge",Z("admin.plans.form.verified_badge")],["highlightedReviews",Z("admin.plans.form.highlighted_reviews")],["hasPersonalSite",Z("admin.plans.form.personal_site")],["hasCanHelpNowStatus",Z("admin.plans.form.can_help_now")],["hasNeedHelpStatus",Z("admin.plans.form.need_help")],["hasAutoResponse",Z("admin.plans.form.auto_response")],["hasAutoMatch",Z("admin.plans.form.auto_match")],["hasPriceList",Z("admin.plans.form.price_list")],["receiveInstantDispatchFree",Z("admin.plans.form.instant_dispatch_free")],["receiveInstantDispatchPro",Z("admin.plans.form.instant_dispatch_pro")]].map(e=>{let[t,s]=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,a.jsx)("input",{type:"checkbox",checked:sC[t],onChange:e=>s_({...sC,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),s]},t)})}),(0,a.jsxs)("div",{className:"flex items-center gap-6 pt-1",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,a.jsx)("input",{type:"checkbox",checked:sC.isDefault,onChange:e=>s_({...sC,isDefault:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),Z("admin.plans.form.default")]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,a.jsx)("input",{type:"checkbox",checked:sC.isActive,onChange:e=>s_({...sC,isActive:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),Z("admin.plans.form.active")]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{className:"text-xs text-gray-600",children:Z("admin.plans.form.order")}),(0,a.jsx)("input",{type:"number",value:sC.order,onChange:e=>s_({...sC,order:Number(e.target.value)}),className:"w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none"})]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)("button",{onClick:lk,disabled:sS||!sC.name,className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sS?"...":Z("common.save")}),(0,a.jsx)("button",{onClick:()=>s_(null),className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100",children:Z("common.cancel")})]})]}),(0,a.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:0===sk.length?(0,a.jsx)("div",{className:"px-4 py-8 text-center text-gray-400 text-sm",children:Z("admin.plans.empty")}):(0,a.jsx)("div",{className:"divide-y divide-gray-100",children:sk.sort((e,t)=>{var s,a;return(null!=(s=e.order)?s:0)-(null!=(a=t.order)?a:0)}).map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-start gap-4 px-4 py-4 ".concat(e.isActive?"":"opacity-50"),children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-semibold text-gray-900",children:e.name}),e.isDefault&&(0,a.jsx)("span",{className:"bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium",children:Z("admin.plans.badge.default")}),!e.isActive&&(0,a.jsx)("span",{className:"bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full",children:Z("admin.plans.badge.inactive")})]}),e.description&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 mt-1 text-xs text-gray-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-gray-800",children:[e.oldPrice&&(0,a.jsxs)("span",{className:"font-normal text-gray-400 line-through",children:[e.oldPrice," ",e.currency]}),(0,a.jsxs)("span",{children:[e.price," ",e.currency]})]}),null!=e.maxTasks&&(0,a.jsxs)("span",{children:[Z("admin.plans.tasks"),": ",e.maxTasks]}),null!=e.maxOffers&&(0,a.jsxs)("span",{children:[Z("admin.plans.offers"),": ",e.maxOffers]}),null!=e.maxCards&&(0,a.jsxs)("span",{children:[Z("admin.plans.cards"),": ",e.maxCards]}),e.notifyNewTasks&&(0,a.jsxs)("span",{className:"text-green-700 flex items-center gap-1",children:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})}),Z("admin.plans.notify_tasks")]})]}),(null!=(t=e.features)?t:[]).length>0&&(0,a.jsx)("ul",{className:"mt-1.5 space-y-0.5",children:e.features.map((e,t)=>(0,a.jsxs)("li",{className:"text-xs text-gray-600 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-green-500",children:(0,a.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",e]},t))})]}),(0,a.jsxs)("div",{className:"flex gap-1 shrink-0",children:[!e.isDefault&&(0,a.jsx)("button",{onClick:()=>c.td(e.id,{isDefault:!0}).then(()=>c.OX().then(sw)).catch(()=>{}),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:Z("admin.plans.make_default"),children:(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})})}),(0,a.jsx)("button",{onClick:()=>{var t,s,a,n,l,r,i,o,d,c,m,x,u,p,g,h,b,f,y,j,v,N,k,w,C,_,S,L,D,E,M;s_({id:e.id,name:e.name,description:null!=(t=e.description)?t:"",role:null!=(s=e.role)?s:"customer",tier:null!=(a=e.tier)?a:"free",price:null!=(n=e.price)?n:"0",oldPrice:null!=(l=e.oldPrice)?l:"",currency:null!=(r=e.currency)?r:"EUR",maxTasks:null!=e.maxTasks?String(e.maxTasks):"",maxOffers:null!=e.maxOffers?String(e.maxOffers):"",maxCards:null!=e.maxCards?String(e.maxCards):"",maxMessagesPerDay:null!=e.maxMessagesPerDay?String(e.maxMessagesPerDay):"",maxOrdersPerDay:null!=e.maxOrdersPerDay?String(e.maxOrdersPerDay):"",maxSkills:null!=e.maxSkills?String(e.maxSkills):"",durationDays:null!=e.durationDays?String(e.durationDays):"",searchBoost:null!=(i=e.searchBoost)?i:0,offersMultiplier:null!=(o=e.offersMultiplier)?o:"1.00",features:(null!=(d=e.features)?d:[]).join("\n"),isDefault:null!=(c=e.isDefault)&&c,isActive:null==(m=e.isActive)||m,order:null!=(x=e.order)?x:0,notifyNewTasks:null!=(u=e.notifyNewTasks)&&u,canContactFreePlan:null!=(p=e.canContactFreePlan)&&p,canContactProPlan:null==(g=e.canContactProPlan)||g,canContactAll:null!=(h=e.canContactAll)&&h,canShowContactInfo:null!=(b=e.canShowContactInfo)&&b,canViewPhone:null!=(f=e.canViewPhone)&&f,canUploadVideo:null!=(y=e.canUploadVideo)&&y,hasFavorites:null!=(j=e.hasFavorites)&&j,hasGoogleCalendar:null!=(v=e.hasGoogleCalendar)&&v,hasVerifiedBadge:null!=(N=e.hasVerifiedBadge)&&N,highlightedReviews:null!=(k=e.highlightedReviews)&&k,hasPersonalSite:null!=(w=e.hasPersonalSite)&&w,hasCanHelpNowStatus:null!=(C=e.hasCanHelpNowStatus)&&C,hasNeedHelpStatus:null!=(_=e.hasNeedHelpStatus)&&_,hasAutoResponse:null!=(S=e.hasAutoResponse)&&S,hasAutoMatch:null!=(L=e.hasAutoMatch)&&L,hasPriceList:null!=(D=e.hasPriceList)&&D,receiveInstantDispatchFree:null!=(E=e.receiveInstantDispatchFree)&&E,receiveInstantDispatchPro:null!=(M=e.receiveInstantDispatchPro)&&M})},className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:Z("common.edit")}),(0,a.jsx)("button",{onClick:()=>lw(e.id,e.name),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:Z("common.delete")})]})]},e.id)})})})]}),"settings"===et&&(0,a.jsxs)("div",{children:[(0,a.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","telegram"].map(e=>{let t={general:Z("admin.settings.tab.general"),smtp:Z("admin.settings.tab.smtp"),notifications:Z("admin.settings.tab.notifications"),payment:Z("admin.settings.tab.payment"),referral:Z("admin.settings.tab.referral"),seo:Z("admin.settings.tab.seo"),socials:Z("admin.settings.tab.socials"),telegram:Z("admin.settings.tab.telegram")};return(0,a.jsx)("button",{onClick:()=>s1(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition ".concat(s2===e?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"),children:t[e]},e)})}),"general"===s2&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800 mb-5",children:Z("admin.settings.general.title")}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.general.site_name")}),(0,a.jsx)("input",{value:s4.siteName,onChange:e=>s5(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.general.site_url")}),(0,a.jsx)("input",{value:s4.siteUrl,onChange:e=>s5(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.general.contact_email")}),(0,a.jsx)("input",{type:"email",value:s4.contactEmail,onChange:e=>s5(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.general.support_phone")}),(0,a.jsx)("input",{value:s4.supportPhone,onChange:e=>s5(t=>({...t,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"})]}),(0,a.jsx)("button",{onClick:lC,disabled:s3,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:s3?Z("admin.settings.saving"):s7?Z("admin.settings.saved"):Z("common.save")})]})]}),"smtp"===s2&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:Z("admin.settings.smtp.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-400 mb-5",children:Z("admin.settings.smtp.hint")}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.host")}),(0,a.jsx)("input",{value:s9.host,onChange:e=>ae(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.port")}),(0,a.jsx)("input",{value:s9.port,onChange:e=>ae(t=>({...t,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"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.encryption")}),(0,a.jsxs)("select",{value:s9.encryption,onChange:e=>ae(t=>({...t,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:[(0,a.jsx)("option",{value:"none",children:Z("admin.settings.smtp.enc.none")}),(0,a.jsx)("option",{value:"tls",children:"STARTTLS (587)"}),(0,a.jsx)("option",{value:"ssl",children:"SSL/TLS (465)"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.username")}),(0,a.jsx)("input",{value:s9.username,onChange:e=>ae(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.password")}),(0,a.jsx)("input",{type:"password",value:s9.password,onChange:e=>ae(t=>({...t,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:"••••••••••••"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.from_name")}),(0,a.jsx)("input",{value:s9.fromName,onChange:e=>ae(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.smtp.from_email")}),(0,a.jsx)("input",{type:"email",value:s9.fromEmail,onChange:e=>ae(t=>({...t,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"})]})]}),(0,a.jsx)("button",{onClick:l_,disabled:at,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:at?Z("admin.settings.saving"):aa?Z("admin.settings.saved"):Z("common.save")}),(0,a.jsx)("button",{onClick:async()=>{ar(!0),ao(null);try{let e=await c.FI();ao("✓ Отправлено на ".concat(e.to))}catch(e){ao("✗ Ошибка: ".concat(e.message))}finally{ar(!1),setTimeout(()=>ao(null),5e3)}},disabled:al,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:al?Z("admin.settings.smtp.sending"):(0,a.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})}),Z("admin.settings.smtp.test")]})}),ai&&(0,a.jsx)("p",{className:"text-sm text-center font-medium ".concat(ai.startsWith("✓")?"text-green-600":"text-red-500"),children:ai})]})]}),"payment"===s2&&(0,a.jsxs)("div",{className:"space-y-6 max-w-lg",children:[(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.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"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800",children:"ePay — Piraeus Bank"}),(0,a.jsx)("p",{className:"text-xs text-gray-400",children:"Греческий платёжный шлюз"})]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,a.jsx)("span",{className:"text-sm text-gray-500",children:Z("admin.settings.active")}),(0,a.jsx)("button",{type:"button",onClick:()=>aj(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ay.enabled?"bg-green-600":"bg-gray-300"),children:(0,a.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ay.enabled?"translate-x-5":"translate-x-1")})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.env.label")}),(0,a.jsxs)("select",{value:ay.environment,onChange:e=>aj(t=>({...t,environment:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,a.jsx)("option",{value:"test",children:Z("admin.settings.env.test")}),(0,a.jsx)("option",{value:"production",children:Z("admin.settings.env.prod")})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.merchant_id")}),(0,a.jsx)("input",{value:ay.merchantId,onChange:e=>aj(t=>({...t,merchantId:e.target.value})),placeholder:Z("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"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API User"}),(0,a.jsx)("input",{value:ay.apiUser,onChange:e=>aj(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Password"}),(0,a.jsx)("input",{type:"password",value:ay.apiPassword,onChange:e=>aj(t=>({...t,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"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmation URL (webhook)"}),(0,a.jsx)("input",{value:ay.confirmationUrl,onChange:e=>aj(t=>({...t,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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cancel URL"}),(0,a.jsx)("input",{value:ay.cancelUrl,onChange:e=>aj(t=>({...t,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"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-5",children:[(0,a.jsx)("button",{onClick:lD,disabled:av,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:av?Z("admin.settings.saving"):Z("common.save")}),ak&&(0,a.jsx)("span",{className:"text-sm text-green-600",children:Z("admin.settings.saved")})]})]}),(0,a.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:[(0,a.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,a.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,a.jsx)("span",{children:Z("admin.settings.payment.hint")})]})]}),"notifications"===s2&&(0,a.jsxs)("div",{className:"space-y-3 max-w-2xl",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 mb-4 p-3 bg-green-50 border border-green-100 rounded-xl text-sm text-green-700",children:[(0,a.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,a.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,a.jsxs)("p",{children:[Z("admin.notif.vars_hint")," ",p.map(e=>{let t="{{".concat(e,"}}");return(0,a.jsx)("code",{className:"mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})]})]}),[{key:"email_verification",label:Z("admin.notif.email_verification"),icon:(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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:Z("admin.notif.registration_success"),icon:(0,a.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:(0,a.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:Z("admin.notif.password_reset"),icon:(0,a.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:(0,a.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:Z("admin.notif.new_offer"),icon:(0,a.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:(0,a.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:Z("admin.notif.new_task"),icon:(0,a.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:(0,a.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:Z("admin.notif.offer_accepted"),icon:(0,a.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:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},{key:"new_message",label:Z("admin.notif.new_message"),icon:(0,a.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:(0,a.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:Z("admin.notif.offer_declined"),icon:(0,a.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:(0,a.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:Z("admin.notif.offer_other_accepted"),icon:(0,a.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:(0,a.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:Z("admin.notif.task_updated"),icon:(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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:Z("admin.notif.deadline_reminder"),icon:(0,a.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:(0,a.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:Z("admin.notif.task_archived"),icon:(0,a.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:(0,a.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:Z("admin.notif.referral_reward"),icon:(0,a.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:(0,a.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"})})},{key:"plan_activated",label:Z("admin.email_template.plan_activated"),icon:(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.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:Z("admin.email_template.plan_upgraded"),icon:(0,a.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:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})},{key:"plan_downgrade_scheduled",label:Z("admin.email_template.plan_downgrade_scheduled"),icon:(0,a.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:(0,a.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:Z("admin.email_template.plan_downgrade_applied"),icon:(0,a.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:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})},{key:"plan_renewal_reminder",label:Z("admin.email_template.plan_renewal_reminder"),icon:(0,a.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:(0,a.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:Z("admin.email_template.plan_insufficient_funds"),icon:(0,a.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:(0,a.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(e=>{var t,s,n;let{key:l,label:r,icon:i}=e,o="".concat(l,"_").concat(au),d=null!=(s=null!=(t=ad[o])?t:ad[l])?s:{subject:"",body:""},c=am===l,m=null!=(n=u[l])?n:[];return(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none",onClick:()=>ax(c?null:l),children:[(0,a.jsx)("span",{className:"text-xl shrink-0",children:i}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"font-medium text-gray-800 text-sm",children:r}),d.subject?(0,a.jsxs)("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:[Z("admin.notif.tmpl.subject_label"),": ",d.subject]}):(0,a.jsx)("div",{className:"text-xs text-gray-300 mt-0.5 italic",children:Z("admin.notif.tmpl.not_set")})]}),(0,a.jsx)("span",{className:"text-gray-400 transition-transform ".concat(c?"rotate-90":""),children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),c&&(0,a.jsxs)("div",{className:"px-5 pb-5 border-t border-gray-100 pt-4 space-y-3",children:[(0,a.jsx)("div",{className:"flex gap-1 pb-2",children:["el","en","uk","ru"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>ap(e),className:"px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(au===e?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:"el"===e?"Ελληνικά":"en"===e?"English":"uk"===e?"Українська":"Русский"},e))}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.notif.tmpl.subject_label")}),(0,a.jsx)("input",{value:d.subject,onChange:e=>ac(t=>{var s;return{...t,[o]:{...null!=(s=t[o])?s:{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"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Z("admin.notif.tmpl.body_label")}),(0,a.jsx)("textarea",{rows:7,value:d.body,onChange:e=>ac(t=>{var s;return{...t,[o]:{...null!=(s=t[o])?s:{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}},

..."})]}),m.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-amber-800 mb-1",children:Z("admin.notif.vars_hint")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(e=>{let t="{{".concat(e,"}}");return(0,a.jsx)("code",{className:"bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})})]}),(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,a.jsx)("button",{onClick:()=>lL(l),disabled:ag||ab,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:ag?Z("admin.notif.tmpl.saving"):Z("admin.notif.tmpl.save")}),(0,a.jsxs)("button",{onClick:()=>lS(l),disabled:ag||ab,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:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.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"})}),ab?Z("admin.notif.tmpl.translating"):Z("admin.notif.tmpl.translate")]}),(0,a.jsx)("button",{onClick:()=>ax(null),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200",children:Z("admin.notif.tmpl.close")})]})]})]},l)})]}),"referral"===s2&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800",children:Z("admin.settings.referral.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:Z("admin.settings.referral.hint")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-700",children:Z("admin.settings.referral.enabled_label")}),(0,a.jsx)("p",{className:"text-xs text-gray-400",children:Z("admin.settings.referral.enabled_hint")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>a_(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(aC.enabled?"bg-green-600":"bg-gray-300"),children:(0,a.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(aC.enabled?"translate-x-5":"translate-x-1")})})]}),(0,a.jsxs)("div",{className:"border border-gray-100 rounded-lg p-4 space-y-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:Z("admin.settings.referral.shared_section")}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.referral.plan_label")}),(0,a.jsxs)("select",{value:aC.planId,onChange:e=>a_(t=>({...t,planId: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:[(0,a.jsx)("option",{value:"",children:Z("admin.settings.referral.no_plan")}),sk.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:Z("admin.settings.referral.plan_hint")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.referral.days_label")}),(0,a.jsx)("input",{type:"number",min:"1",max:"365",value:aC.days,onChange:e=>a_(t=>({...t,days: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"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:Z("admin.settings.referral.days_hint")})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{onClick:lE,disabled:aS,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aS?Z("admin.settings.saving"):Z("common.save")}),aD&&(0,a.jsx)("span",{className:"text-sm text-green-600",children:Z("admin.settings.saved")})]})]}),"socials"===s2&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:Z("admin.settings.socials.title")}),(0,a.jsx)("p",{className:"text-xs text-gray-400",children:Z("admin.settings.socials.hint")})]}),[{key:"telegram",label:"Telegram",placeholder:"https://t.me/yourname",icon:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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:(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.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(e=>{let{key:t,label:s,placeholder:n,icon:l}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"".concat(az[t]?"text-green-600":"text-gray-300"),children:l}),s,!az[t]&&(0,a.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"не заполнено"})]}),(0,a.jsx)("input",{type:"url",value:az[t],onChange:e=>aP(s=>({...s,[t]:e.target.value})),placeholder:n,className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(az[t]?"border-green-300 bg-green-50/30":"border-gray-300")})]},t)}),(0,a.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,a.jsx)("button",{onClick:lB,disabled:aF,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aF?Z("admin.settings.saving"):Z("common.save")}),aV&&(0,a.jsx)("span",{className:"text-sm text-green-600",children:Z("admin.settings.saved")})]})]}),"seo"===s2&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-800",children:Z("admin.settings.seo.title")}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-700",children:Z("admin.settings.seo.maintenance_label")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:Z("admin.settings.seo.maintenance_hint")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>aB(e=>({...e,maintenanceMode:!e.maintenanceMode})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(aM.maintenanceMode?"bg-red-500":"bg-gray-300"),children:(0,a.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(aM.maintenanceMode?"translate-x-5":"translate-x-1")})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-700",children:Z("admin.settings.seo.indexing_label")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:Z("admin.settings.seo.indexing_hint")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>aB(e=>({...e,indexingEnabled:!e.indexingEnabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(aM.indexingEnabled?"bg-green-600":"bg-gray-300"),children:(0,a.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(aM.indexingEnabled?"translate-x-5":"translate-x-1")})})]}),(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:[Z("admin.settings.seo.site_title_label")," / ",Z("admin.settings.seo.site_description_label")]}),(0,a.jsx)("div",{className:"flex gap-1 mb-3",children:[{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"EL"},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"EN"},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"RU"},{code:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"UK"}].map(e=>{let{code:t,flag:s,label:n}=e;return(0,a.jsxs)("button",{type:"button",onClick:()=>aW(t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(aR===t?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:[s," ",n]},t)})}),(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.settings.seo.site_title_label")}),(0,a.jsx)("input",{value:aM["siteTitle".concat(aR.charAt(0).toUpperCase()+aR.slice(1))],onChange:e=>aB(t=>({...t,["siteTitle".concat(aR.charAt(0).toUpperCase()+aR.slice(1))]: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 mb-3",placeholder:"el"===aR?"CanHelp — Κάθε άνθρωπος έχει κάτι να προσφέρει":"en"===aR?"CanHelp — Everyone has something valuable to offer":"ru"===aR?"CanHelp — Каждый человек может чем-то помочь":"CanHelp — Кожен має навичку, яка може допомогти іншому"}),(0,a.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:Z("admin.settings.seo.site_description_label")}),(0,a.jsx)("textarea",{rows:3,value:aM["siteDescription".concat(aR.charAt(0).toUpperCase()+aR.slice(1))],onChange:e=>aB(t=>({...t,["siteDescription".concat(aR.charAt(0).toUpperCase()+aR.slice(1))]: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:"el"===aR?"Η ελληνική πλατφόρμα για online ανάθεση εργασιών...":"en"===aR?"The Greek platform for online task delegation...":"ru"===aR?"Греческая платформа для онлайн-поиска специалистов...":"Грецька платформа для пошуку фахівців онлайн..."})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:Z("admin.settings.seo.head_scripts_label")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:Z("admin.settings.seo.head_scripts_hint")}),(0,a.jsx)("textarea",{rows:6,value:aM.headScripts,onChange:e=>aB(t=>({...t,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:"\x3c!-- Google Tag Manager --\x3e\n