/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/7.pack (1117926B)
wpcwebpack/lib/cache/PackFileCacheStrategyPackContentItems `CMinifierWebpackPlugin|static/chunks/app/layout-1c7dc4e88db81e86.jsMinifierWebpackPlugin|static/chunks/app/become-specialist/page-78e0ea72212af0d5.jsMinifierWebpackPlugin|static/chunks/app/dashboard/page-dc59b150af62ac09.jsMinifierWebpackPlugin|static/chunks/app/delete-account/page-4d3d106810f48ac4.jsMinifierWebpackPlugin|static/chunks/app/chat/page-387268f3413ed2c0.jsMinifierWebpackPlugin|static/chunks/app/favorites/page-5ed0441aab08d0bf.jsMinifierWebpackPlugin|static/chunks/app/notifications/page-ab533fb104e26b80.jsMinifierWebpackPlugin|static/chunks/app/payment/page-b5e39b35c5b6f76a.jsMinifierWebpackPlugin|static/chunks/app/pricing/page-837d23a9f30a95e4.jsMinifierWebpackPlugin|static/chunks/app/schedule/page-77257ba1353d86c4.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/page-f4599f916c20f262.jsMinifierWebpackPlugin|static/chunks/app/specialists/page-6a092b518f085704.jsMinifierWebpackPlugin|static/chunks/app/support/page-dfb7a9da42f1a48c.jsMinifierWebpackPlugin|static/chunks/app/tasks/new/page-c7fa66ab963e5040.jsMinifierWebpackPlugin|static/chunks/app/tasks/[id]/offer/page-01ac55de4ae69041.jsMinifierWebpackPlugin|static/chunks/app/site/[slug]/page-ffb03cccf17b8b51.jsMinifierWebpackPlugin|static/chunks/webpack-4b530420abdbb925.jsMinifierWebpackPlugin|static/chunks/6467.7848e607a6de9648.jsMinifierWebpackPlugin|static/chunks/2982-36ac0e544ca2b5a3.jsRealContentHashPlugin|analyse|static/chunks/app/layout-1c7dc4e88db81e86.jsRealContentHashPlugin|analyse|static/chunks/app/become-specialist/page-78e0ea72212af0d5.jsRealContentHashPlugin|analyse|static/chunks/app/dashboard/page-dc59b150af62ac09.jsRealContentHashPlugin|analyse|static/chunks/app/delete-account/page-4d3d106810f48ac4.jsRealContentHashPlugin|analyse|static/chunks/app/chat/page-387268f3413ed2c0.jsRealContentHashPlugin|analyse|static/chunks/app/favorites/page-5ed0441aab08d0bf.jsRealContentHashPlugin|analyse|static/chunks/app/notifications/page-ab533fb104e26b80.jsRealContentHashPlugin|analyse|static/chunks/app/payment/page-b5e39b35c5b6f76a.jsRealContentHashPlugin|analyse|static/chunks/app/pricing/page-837d23a9f30a95e4.jsRealContentHashPlugin|analyse|static/chunks/app/schedule/page-77257ba1353d86c4.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/page-f4599f916c20f262.jsRealContentHashPlugin|analyse|static/chunks/app/specialists/page-6a092b518f085704.jsRealContentHashPlugin|analyse|static/chunks/app/support/page-dfb7a9da42f1a48c.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/new/page-c7fa66ab963e5040.jsRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/offer/page-01ac55de4ae69041.jsRealContentHashPlugin|analyse|static/chunks/app/site/[slug]/page-ffb03cccf17b8b51.jsRealContentHashPlugin|analyse|static/chunks/webpack-4b530420abdbb925.jsRealContentHashPlugin|analyse|static/chunks/6467.7848e607a6de9648.jsRealContentHashPlugin|analyse|static/chunks/2982-36ac0e544ca2b5a3.jsRealContentHashPlugin|generate|static/chunks/webpack-4b530420abdbb925.jsMinifierWebpackPlugin|static/chunks/app/admin/page-5f7cc70c16f6d8c5.jsMinifierWebpackPlugin|static/chunks/app/page-c2aeee7c3604a316.jsMinifierWebpackPlugin|static/wzg1RZjc_-qC27IiXcFEP/_ssgManifest.jsMinifierWebpackPlugin|static/wzg1RZjc_-qC27IiXcFEP/_buildManifest.jsCssMinimizerPlugin|static/css/b9c8097ed57fade3.cssRealContentHashPlugin|analyse|static/chunks/app/admin/page-5f7cc70c16f6d8c5.jsRealContentHashPlugin|analyse|static/chunks/app/page-c2aeee7c3604a316.jsRealContentHashPlugin|analyse|static/css/b9c8097ed57fade3.cssRealContentHashPlugin|analyse|static/wzg1RZjc_-qC27IiXcFEP/_ssgManifest.jsRealContentHashPlugin|analyse|static/wzg1RZjc_-qC27IiXcFEP/_buildManifest.jsRealContentHashPlugin|generate|static/wzg1RZjc_-qC27IiXcFEP/_buildManifest.jsMinifierWebpackPlugin|static/dNx6zI6waKkX-ypOy801i/_ssgManifest.jsMinifierWebpackPlugin|static/dNx6zI6waKkX-ypOy801i/_buildManifest.jsRealContentHashPlugin|analyse|static/dNx6zI6waKkX-ypOy801i/_ssgManifest.jsRealContentHashPlugin|analyse|static/dNx6zI6waKkX-ypOy801i/_buildManifest.jsRealContentHashPlugin|generate|static/dNx6zI6waKkX-ypOy801i/_buildManifest.jsMinifierWebpackPlugin|static/CpnLaK_V6EKmycsw0Auky/_ssgManifest.jsMinifierWebpackPlugin|static/CpnLaK_V6EKmycsw0Auky/_buildManifest.jsRealContentHashPlugin|analyse|static/CpnLaK_V6EKmycsw0Auky/_ssgManifest.jsRealContentHashPlugin|analyse|static/CpnLaK_V6EKmycsw0Auky/_buildManifest.jsRealContentHashPlugin|generate|static/CpnLaK_V6EKmycsw0Auky/_buildManifest.jsMinifierWebpackPlugin|static/chunks/9906-f2bb8097517b0bb3.jsMinifierWebpackPlugin|static/4h1n5wPkhCD0Wa4o-JGU6/_ssgManifest.jsMinifierWebpackPlugin|static/4h1n5wPkhCD0Wa4o-JGU6/_buildManifest.jsRealContentHashPlugin|analyse|static/chunks/9906-f2bb8097517b0bb3.jsRealContentHashPlugin|analyse|static/4h1n5wPkhCD0Wa4o-JGU6/_ssgManifest.jsRealContentHashPlugin|analyse|static/4h1n5wPkhCD0Wa4o-JGU6/_buildManifest.jsRealContentHashPlugin|generate|static/4h1n5wPkhCD0Wa4o-JGU6/_buildManifest.jssourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceF(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{300:(e,t,r)=>{"use strict";r.d(t,{AdminRolePreview:()=>d});var n=r(4568),s=r(1592),a=r(7541),l=r(7620),o=r(2982);let i="canhelp_admin_orig_plan",c={free:"bg-slate-100 text-slate-600",pro:"bg-green-100 text-green-700",ultimate:"bg-amber-100 text-amber-700"};function d(){var e,t;let{data:r}=(0,s.wV)(),d=(0,a.useRouter)(),h=(null==r||null==(e=r.user)?void 0:e.role)==="admin",u=null==r||null==(t=r.user)?void 0:t.id,[x,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)([]),[g,v]=(0,l.useState)(null),[j,k]=(0,l.useState)(!1),[b,w]=(0,l.useState)(!1),y=(0,l.useRef)(null);if((0,l.useEffect)(()=>m(!0),[]),(0,l.useEffect)(()=>{y.current=localStorage.getItem(i)},[]),(0,l.useEffect)(()=>{h&&(0,o.T9)().then(p).catch(()=>{})},[h]),(0,l.useEffect)(()=>{var e,t;v(null!=(t=null==r||null==(e=r.user)?void 0:e.planId)?t:null)},[r]),!x||!h)return null;let N=async e=>{if(u){k(!0);try{!y.current&&g&&(localStorage.setItem(i,g),y.current=g),await (0,o.wl)(u,{planId:e}),v(e),window.dispatchEvent(new CustomEvent("canhelp:plan-changed",{detail:{planId:e}})),d.refresh()}catch(e){}k(!1)}},C=async()=>{let e=y.current;localStorage.removeItem(i),y.current=null,await N(null!=e?e:null)},L=!!y.current;return(0,n.jsxs)("div",{className:"fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none",style:{minWidth:130},children:[(0,n.jsxs)("button",{onClick:()=>w(e=>!e),className:"flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl",children:[(0,n.jsx)("span",{children:"\uD83D\uDC41 Preview"}),(0,n.jsx)("span",{className:"text-slate-300",children:b?"▲":"▼"})]}),b&&(0,n.jsx)("div",{className:"flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2",children:f.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-slate-400 px-1 mt-2 mb-0.5",children:"Plan"}),f.map(e=>{var t;return(0,n.jsxs)("button",{disabled:j,onClick:()=>N(e.id===g?null:e.id),className:"flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(g===e.id?"bg-indigo-600 text-white":"text-slate-600 hover:bg-slate-100"," ").concat(j?"opacity-50":""),children:[(0,n.jsx)("span",{className:"truncate max-w-[90px]",children:e.name}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(g===e.id?"bg-white/20 text-white":null!=(t=c[e.tier])?t:c.free),children:e.tier})]},e.id)}),g&&(0,n.jsx)("button",{disabled:j,onClick:()=>N(null),className:"px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left",children:"✕ No plan"}),L&&(0,n.jsx)("button",{disabled:j,onClick:C,className:"px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left",children:"↩ Restore"})]})})]})}},1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>l,Jv:()=>s,wV:()=>o,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:l,useSession:o}=n},2568:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,8761,23)),Promise.resolve().then(r.bind(r,300)),Promise.resolve().then(r.bind(r,9808)),Promise.resolve().then(r.bind(r,9649)),Promise.resolve().then(r.bind(r,7380)),Promise.resolve().then(r.bind(r,9906)),Promise.resolve().then(r.bind(r,4029))},3042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(6035)},3625:(e,t,r)=>{"use strict";function n(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(4568),r(7509),r(3042),r(1271)},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>o,z:()=>i});var n=r(4568),s=r(7620),a=r(2982);let l=(0,s.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function o(e){let{children:t,initialSlug:r=""}=e,[o,i]=(0,s.useState)(r),[c,d]=(0,s.useState)([]),[h,u]=(0,s.useState)(!0);(0,s.useEffect)(()=>{i(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,s.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>u(!1))},[]);let x=(0,s.useCallback)(e=>{i(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),m=(0,s.useCallback)(e=>{if(!o)return"";for(let s of c){var t,r,n;if(s.slug===o)return null!=(t=s.names[e])?t:s.names.el;for(let t of null!=(r=s.children)?r:[])if(t.slug===o)return null!=(n=t.names[e])?n:t.names.el}return o},[o,c]);return(0,n.jsx)(l.Provider,{value:{locationSlug:o,locationTree:c,locationLoading:h,setLocation:x,getLabel:m},children:t})}function i(){return(0,s.useContext)(l)}},5575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(4931)._(r(7007));function s(e,t){var r;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:null==(r=a.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(9113).createAsyncLocalStorage)()},6442:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var n=r(5575),s=r.n(n)},6452:(e,t,r)=>{"use strict";function n(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(9800)},7007:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(4568),s=r(7620),a=r(6452);function l(e){return{default:e&&"default"in e?e.default:e}}r(3625);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?s.Suspense:s.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},7380:(e,t,r)=>{"use strict";r.d(t,{ScrollToTopButton:()=>a});var n=r(4568),s=r(7620);function a(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=()=>{t(window.scrollY>200)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsx)("button",{className:"scroll-to-top-btn".concat(e?" visible":""),"aria-label":"Наверх",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M10 16V4M10 4L4 10M10 4L16 10",stroke:"white",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})})})}},8761:()=>{},9113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new n}function l(e){return s?s.bind(e):n.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},9649:(e,t,r)=>{"use strict";r.d(t,{Header:()=>g});var n=r(4568),s=r(9664),a=r.n(s),l=r(7541),o=r(1592),i=r(9906),c=r(1258),d=r(7620),h=r(4962);function u(){var e;let{locale:t,setLocale:r}=(0,i.Y)(),[s,a]=(0,d.useState)(!1),l=(0,d.useRef)(null),o=null!=(e=h.YZ.find(e=>e.code===t))?e:h.YZ[0];return(0,d.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&a(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,n.jsxs)("div",{ref:l,className:"relative",children:[(0,n.jsxs)("button",{onClick:()=>a(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700","aria-label":"Change language",children:[(0,n.jsx)("span",{children:o.code.toUpperCase()}),(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 transition-transform ".concat(s?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),s&&(0,n.jsx)("div",{className:"absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden",children:h.YZ.map(e=>(0,n.jsxs)("button",{onClick:()=>{r(e.code),a(!1)},className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(t===e.code?"bg-green-50 text-green-700 font-medium":"text-gray-700"),children:[(0,n.jsx)("span",{children:e.label}),t===e.code&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 ml-auto text-green-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},e.code))})]})}var x=r(2982),m=r(2838);function f(){var e;if("undefined"==typeof document)return null;let t=document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/);return null!=(e=null==t?void 0:t[1])?e:null}let p=(0,r(6442).default)(()=>r.e(6467).then(r.bind(r,6467)),{loadableGenerated:{webpack:()=>[6467]},ssr:!1});function g(){var e;(0,l.useRouter)();let t=(0,l.usePathname)(),{data:r}=(0,o.wV)(),{t:s,locale:h}=(0,i.Y)(),[g,v]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),[b,w]=(0,d.useState)(!1),[y,N]=(0,d.useState)(0),[C,L]=(0,d.useState)(0),[M,_]=(0,d.useState)(null),[z,E]=(0,d.useState)(null),S=(0,d.useRef)(null),B=(0,d.useRef)(null),W=(0,d.useRef)(null),P=(0,d.useRef)(t);(0,d.useEffect)(()=>{P.current=t},[t]),(0,d.useEffect)(()=>{function e(e){S.current&&!S.current.contains(e.target)&&k(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let H=(null==r||null==(e=r.user)?void 0:e.role)==="admin",V="specialist"===function(){var e;let{data:t}=(0,o.wV)(),r=null==t||null==(e=t.user)?void 0:e.role,n="admin"===r,[s,a]=(0,d.useState)(null);return((0,d.useEffect)(()=>{if(!n)return;a(f());let e=()=>a(f());return window.addEventListener("canhelp:preview-role",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:preview-role",e),document.removeEventListener("visibilitychange",e)}},[n]),r)?n&&s?s:r:null}(),O=function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?t===e:t===e||t.startsWith(e+"/")},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"font-medium text-sm transition ".concat(O(e,t)?"text-green-600":"text-gray-600 hover:text-green-600")},R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"flex items-center gap-2 font-medium py-1 ".concat(O(e,t)?"text-green-600":"text-gray-700")};return(0,d.useEffect)(()=>{"/chat"===t&&L(0)},[t]),(0,d.useEffect)(()=>{if(!r)return;let e=(0,m.io)("https://api.canhelp.gr",{withCredentials:!0,transports:["websocket","polling"]});return e.on("new_message",e=>{"/chat"!==P.current&&(L(e=>e+1),W.current&&clearTimeout(W.current),_(e),W.current=setTimeout(()=>_(null),5e3))}),()=>{e.disconnect(),W.current&&clearTimeout(W.current)}},[r]),(0,d.useEffect)(()=>{if(!r)return void N(0);let e=()=>(0,x.$M)().then(e=>N(e.count)).catch(()=>{});e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]),(0,d.useEffect)(()=>{if(!r)return void E(null);(0,x.H)().then(e=>{var t,r;return E(null!=(r=null==(t=e.plan)?void 0:t.tier)?r:null)}).catch(()=>{})},[r]),(0,d.useEffect)(()=>{let e=()=>{B.current&&(window.scrollY>40?B.current.classList.add("header-shrink"):B.current.classList.remove("header-shrink"))};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("header",{ref:B,className:"header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between h-16 header-content transition-all duration-300",children:[(0,n.jsxs)(a(),{href:"/",className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)("img",{src:"/logo.png",alt:"CanHelp",className:"w-8 h-8 object-contain"}),(0,n.jsx)("span",{className:"logo-text text-2xl font-bold text-green-600 transition-all duration-300",children:"CanHelp"})]}),(0,n.jsxs)("nav",{className:"hidden md:flex items-center gap-5 ml-auto",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.find_tasks")}),(0,n.jsx)(a(),{href:"/dashboard",className:A("/dashboard"),children:s("nav.dashboard")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks/new",className:A("/tasks/new",!0),children:s("dashboard.new_task")})," ",(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.tasks")})," ",(0,n.jsx)(a(),{href:"/specialists",className:A("/specialists"),children:s("nav.specialists")})]}),(0,n.jsx)(a(),{href:"/pricing",className:A("/pricing",!0),children:s("nav.pricing","Pricing")}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),y>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:y>99?"99+":y})]}),(0,n.jsxs)(a(),{href:"/chat",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),C>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:C>99?"99+":C})]}),(0,n.jsxs)("div",{className:"relative",ref:S,children:[(0,n.jsxs)("button",{onClick:()=>k(!j),className:"flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600",children:[(0,n.jsx)("span",{className:"truncate max-w-[100px]",children:(0,c.H)(r.user.firstName,r.user.lastName,r.user.name)}),"pro"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none",children:"Pro"}),"ultimate"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none",children:"★"}),(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),j&&(0,n.jsxs)("div",{className:"absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/chat",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none",children:C>99?"99+":C})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.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,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.profile")]}),(0,n.jsxs)(a(),{href:"/favorites",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50",onClick:()=>{k(!1),w(!0)},children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("support.title")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50",onClick:()=>{k(!1),(0,o.CI)().then(()=>{window.location.href="/"})},children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-600 hover:text-green-600 font-medium text-sm",children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm",children:s("nav.register")})]}),(0,n.jsx)(u,{})]}),(0,n.jsxs)("div",{className:"md:hidden flex items-center gap-2",children:[(0,n.jsx)(u,{}),(0,n.jsx)("button",{className:"p-2",onClick:()=>v(!g),"aria-label":"Toggle menu",children:(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),g&&(0,n.jsxs)("div",{className:"md:hidden py-4 border-t border-gray-100 flex flex-col gap-3",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s("nav.find_tasks")]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.tasks")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.specialists")]})]}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/chat",className:R("/chat",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full",children:C})]}),V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:R("/notifications",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(0,n.jsxs)(a(),{href:"/favorites",className:R("/favorites",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:R("/schedule",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:R("/admin"),onClick:()=>v(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.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,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:R("/profile",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.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"})}),s("nav.profile")]}),(0,n.jsxs)("button",{onClick:()=>{v(!1),(0,o.CI)().then(()=>{window.location.href="/"})},className:"flex items-center gap-2 text-left text-red-500 py-1 font-medium",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-700 font-medium py-1",onClick:()=>v(!1),children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"text-green-600 font-medium py-1",onClick:()=>v(!1),children:s("nav.register")})]})]})]})}),M&&(0,n.jsx)("div",{className:"fixed bottom-5 right-5 z-[200] max-w-sm w-full",children:(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in",children:[(0,n.jsx)("span",{className:"text-2xl shrink-0",children:"\uD83D\uDCAC"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:s("chat.toast_title")}),(0,n.jsx)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:M.body})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>_(null),className:"text-gray-400 hover:text-gray-600 text-lg leading-none","aria-label":"close",children:"\xd7"}),(0,n.jsx)(a(),{href:"/chat?room=".concat(M.roomId),onClick:()=>_(null),className:"text-xs text-green-600 hover:underline font-medium",children:s("chat.toast_open")})]})]})}),b&&(0,n.jsx)(p,{onClose:()=>w(!1)})]})}},9808:(e,t,r)=>{"use strict";r.d(t,{Footer:()=>d});var n=r(4568),s=r(9906),a=r(7620),l=r(9664),o=r.n(l);let i=[{key:"telegram",label:"Telegram",hoverClass:"hover:text-sky-500",svg:''},{key:"instagram",label:"Instagram",hoverClass:"hover:text-pink-500",svg:''},{key:"facebook",label:"Facebook",hoverClass:"hover:text-green-600",svg:''},{key:"twitter",label:"X",hoverClass:"hover:text-gray-900",svg:''},{key:"youtube",label:"YouTube",hoverClass:"hover:text-red-600",svg:''},{key:"tiktok",label:"TikTok",hoverClass:"hover:text-black",svg:''},{key:"whatsapp",label:"WhatsApp",hoverClass:"hover:text-green-500",svg:''},{key:"viber",label:"Viber",hoverClass:"hover:text-purple-600",svg:''}];function c(e){let{className:t="",links:r}=e,s=i.filter(e=>{let{key:t}=e;return null==r?void 0:r[t]});return 0===s.length?null:(0,n.jsx)("div",{className:"flex gap-4 flex-wrap ".concat(t),children:s.map(e=>{let{key:t,label:s,hoverClass:a,svg:l}=e;return(0,n.jsx)("a",{href:r[t],target:"_blank",rel:"noopener noreferrer","aria-label":s,className:"text-gray-500 transition ".concat(a),children:(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"currentColor",dangerouslySetInnerHTML:{__html:l}})},t)})})}function d(){let{t:e}=(0,s.Y)(),t=new Date().getFullYear(),[r,l]=(0,a.useState)({});return(0,a.useEffect)(()=>{fetch("".concat("https://api.canhelp.gr","/api/admin/social-public")).then(e=>e.ok?e.json():{}).then(e=>{let t={};for(let[r,n]of Object.entries(e))n&&(t[r.replace("social.","")]=n);l(t)}).catch(()=>{})},[]),(0,n.jsx)("footer",{className:"bg-white border-t border-gray-200 mt-16",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start gap-10",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-[200px] flex flex-col items-start",children:[(0,n.jsx)("span",{className:"logo-text text-3xl text-green-700 font-bold mb-2",children:"CanHelp"}),(0,n.jsx)("p",{className:"text-base text-gray-600 mb-4",children:e("footer.slogan")})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.links")}),(0,n.jsxs)("ul",{className:"space-y-2",children:[(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/",className:"hover:text-green-600 transition",children:e("nav.home")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/tasks",className:"hover:text-green-600 transition",children:e("nav.tasks")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/specialists",className:"hover:text-green-600 transition",children:e("nav.specialists")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/pricing",className:"hover:text-green-600 transition",children:e("nav.pricing")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/support",className:"hover:text-green-600 transition",children:e("support.title")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/privacy",className:"hover:text-green-600 transition",children:e("nav.privacy")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/delete-account",className:"hover:text-red-500 transition",children:e("nav.delete_account")})})]})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.socials")}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mb-2",children:"info@canhelp.gr"}),(0,n.jsx)(c,{className:"mt-2",links:r})]})]}),(0,n.jsxs)("div",{className:"mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm",children:["\xa9 ",t," CanHelp. ",e("footer.rights")]})]})})}}},e=>{e.O(0,[9950,1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=2568)),_N_E=e.O()}]); ^(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1240],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>c,Hh:()=>a,Jv:()=>l,wV:()=>n,yK:()=>i});let i=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:c,signUp:a,useSession:n}=i},9621:(e,t,s)=>{Promise.resolve().then(s.bind(s,9991))},9991:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var i=s(4568),l=s(7620),c=s(7541),a=s(1592),n=s(9906),r=s(2982);function x(){let{data:e,isPending:t}=(0,a.wV)(),s=(0,c.useRouter)(),{t:x}=(0,n.Y)(),[o,d]=(0,l.useState)(!1),[m,b]=(0,l.useState)("");async function p(){d(!0),b("");try{await (0,r.Em)("/users/me/offer-help",{method:"POST"}),s.push("/specialist-setup")}catch(e){b(x("common.error")),d(!1)}}if(t)return(0,i.jsx)("div",{className:"text-center py-20 text-white",children:x("common.loading")});let h=[{n:1,title:x("become_specialist.step1.title"),desc:x("become_specialist.step1.desc"),icon:"\uD83D\uDDC2️"},{n:2,title:x("become_specialist.step2.title"),desc:x("become_specialist.step2.desc"),icon:"\uD83D\uDD0D"},{n:3,title:x("become_specialist.step3.title"),desc:x("become_specialist.step3.desc"),icon:"\uD83D\uDCB0"}],g=[{icon:"\uD83C\uDFAF",text:x("become_specialist.benefit1")},{icon:"⭐",text:x("become_specialist.benefit2")},{icon:"\uD83D\uDCC5",text:x("become_specialist.benefit3")},{icon:"❤️",text:x("become_specialist.benefit4")}];return(0,i.jsxs)("div",{children:[(0,i.jsx)("section",{className:"bg-gradient-to-br from-green-700 to-green-600 text-white py-20 px-4",children:(0,i.jsxs)("div",{className:"max-w-3xl mx-auto text-center",children:[(0,i.jsx)("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:x("become_specialist.hero.title")}),(0,i.jsx)("p",{className:"text-xl text-green-100 mb-8",children:x("become_specialist.hero.subtitle")})]})}),(0,i.jsxs)("section",{className:"max-w-4xl mx-auto px-4 py-16",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-white mb-10 text-center",children:x("become_specialist.how.title")}),(0,i.jsx)("div",{className:"grid md:grid-cols-3 gap-8",children:h.map(e=>(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"w-14 h-14 bg-green-50 border-2 border-green-200 rounded-2xl flex items-center justify-center text-2xl mx-auto mb-4",children:e.icon}),(0,i.jsx)("div",{className:"w-7 h-7 bg-green-600 text-white rounded-full flex items-center justify-center text-sm font-bold mx-auto -mt-1 mb-3",children:e.n}),(0,i.jsx)("h3",{className:"font-semibold text-white text-lg mb-2",children:e.title}),(0,i.jsx)("p",{className:"text-green-100 text-sm leading-relaxed",children:e.desc})]},e.n))})]}),(0,i.jsx)("section",{className:"bg-gray-50 py-14 px-4",children:(0,i.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-8 text-center",children:x("become_specialist.benefits.title")}),(0,i.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:g.map((e,t)=>(0,i.jsxs)("div",{className:"flex items-start gap-4 bg-white rounded-xl border border-gray-200 p-5",children:[(0,i.jsx)("span",{className:"text-2xl shrink-0",children:e.icon}),(0,i.jsx)("p",{className:"text-gray-700 font-medium leading-snug",children:e.text})]},t))})]})}),(0,i.jsx)("section",{className:"py-16 px-4 text-center",children:(0,i.jsxs)("div",{className:"max-w-md mx-auto",children:[m&&(0,i.jsx)("p",{className:"text-red-500 text-sm mb-4",children:m}),e?(0,i.jsx)("button",{onClick:p,disabled:o,className:"w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 disabled:opacity-60 transition",children:o?x("common.loading"):x("profile.become_specialist")}):(0,i.jsx)("a",{href:"/register",className:"block w-full bg-green-600 text-white px-8 py-4 rounded-xl font-bold text-lg hover:bg-green-700 transition text-center",children:x("profile.become_specialist")})]})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=9621)),_N_E=e.O()}]); ^(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{252:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var a=t(4568),r=t(7620),l=t(7541),n=t(9664),i=t.n(n),d=t(1592),c=t(9906),o=t(2982),x=t(4017),m=t(2035);function h(e){let{current:s,limit:t,label:r,className:l=""}=e;if(null===t)return(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsx)("span",{className:"text-xs font-semibold text-green-600",children:"∞"})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-green-100",children:(0,a.jsx)("div",{className:"h-full w-full rounded-full bg-green-400"})})]});let n=t>0?Math.min(100,Math.round(s/t*100)):100,i=Math.max(0,t-s);return(0,a.jsxs)("div",{className:l,children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsxs)("span",{className:"text-xs font-semibold ".concat(n>=100?"text-red-600":n>=80?"text-amber-600":"text-gray-600"),children:[i," / ",t]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(n>=100?"bg-red-500":n>=80?"bg-amber-400":"bg-green-500"),style:{width:"".concat(n,"%")}})})]})}function u(e){let{dashboard:s,t}=e,r=s.plan,l=s.planExpiration,n=s.usage,d=s.stats,c=l?Math.max(0,Math.min(100,Math.round(l.daysLeft/30*100))):100,o=l?l.daysLeft<=3?"bg-red-500":l.daysLeft<=7?"bg-amber-400":"bg-green-400":"bg-green-400";return(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 p-5 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800 text-sm",children:t("dashboard.plan.title","My Plan")}),r?(0,a.jsx)(m.d,{tier:r.tier,size:"sm"}):(0,a.jsx)("span",{className:"text-xs text-gray-400",children:t("dashboard.plan.no_plan","Free")})]}),(0,a.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-green-600 hover:underline",children:(null==r?void 0:r.tier)==="ultimate"?null:t("dashboard.plan.upgrade","Upgrade")})]}),l&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[(0,a.jsx)("span",{children:t("dashboard.plan.expires","Expires in {n} days").replace("{n}",String(l.daysLeft))}),(0,a.jsxs)("span",{children:[l.daysLeft," ",t("pricing.days","days")]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(o),style:{width:"".concat(c,"%")}})})]}),(void 0!==n.messagesSent||void 0!==n.ordersMade)&&(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:t("dashboard.plan.limits","Daily limits")}),(0,a.jsx)(h,{current:n.messagesSent,limit:null!==n.messagesLeft?n.messagesSent+n.messagesLeft:null,label:t("dashboard.plan.messages","Messages")}),(0,a.jsx)(h,{current:n.ordersMade,limit:null!==n.ordersLeft?n.ordersMade+n.ordersLeft:null,label:t("dashboard.plan.orders","Orders")})]}),Object.keys(d).length>0&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(d).map(e=>{let[s,r]=e;return(0,a.jsxs)("div",{className:"bg-gray-50 rounded-xl px-3 py-2 text-center",children:[(0,a.jsx)("p",{className:"text-lg font-bold text-gray-800",children:r}),(0,a.jsx)("p",{className:"text-[10px] text-gray-400 uppercase tracking-wide",children:t("dashboard.stats.".concat(s),s)})]},s)})})]})}function g(){var e,s,t;let{data:n,isPending:m}=(0,d.wV)(),h=(0,l.useRouter)(),g=(0,l.useSearchParams)(),{t:p,locale:b}=(0,c.Y)(),[f,j]=(0,r.useState)([]),[N,v]=(0,r.useState)([]),[y,w]=(0,r.useState)([]),[k,L]=(0,r.useState)([]),[M,_]=(0,r.useState)(!0),[C,E]=(0,r.useState)(null),[S,D]=(0,r.useState)(null),[B,R]=(0,r.useState)(null);if((0,r.useEffect)(()=>{m||n||h.push("/login")},[n,m]),(0,r.useEffect)(()=>{if(!n)return;let e=g.get("ref");if(!e)return;(0,o.C0)(e).catch(()=>{});let s=new URLSearchParams(g.toString());s.delete("ref");let t=s.toString()?"?".concat(s.toString()):window.location.pathname;h.replace(t)},[n]),(0,r.useEffect)(()=>{n&&(0,o.Bb)().then(e=>{let{cards:s}=e;return R(s.length>0)}).catch(()=>R(null))},[n]),(0,r.useEffect)(()=>{n&&Promise.all([(0,o.Fu)(),(0,o.aT)(),(0,o.q7)(),(0,o.Tr)(),(0,o.H)()]).then(e=>{let[s,t,a,r,l]=e;j(s),v(t),w(a),L(r.filter(e=>"task_invite"===e.type)),E(l)}).catch(()=>{}).finally(()=>_(!1))},[n]),(0,r.useEffect)(()=>{var e;n&&("specialist"===(null==(e=n.user)?void 0:e.role)?(0,o.zk)().then(D).catch(()=>{}):(0,o.ML)().then(D).catch(()=>{}))},[n]),m||M)return(0,a.jsx)("div",{className:"text-center py-20 text-white",children:p("common.loading")});let z="ru"===b?"ru-RU":"uk"===b?"uk-UA":"en"===b?"en-US":"el-GR",O=f.filter(e=>"completed"!==e.status&&"cancelled"!==e.status),P=f.filter(e=>"completed"===e.status||"cancelled"===e.status),F=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"!==s.status&&(null==t?void 0:t.status)!=="completed"&&(null==t?void 0:t.status)!=="cancelled"}),H=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"===s.status||(null==t?void 0:t.status)==="completed"||(null==t?void 0:t.status)==="cancelled"});function U(e){var s,t;let{task:r}=e,l=null!=(s=r.offerCount)?s:0,n=null!=(t=r.declinedCount)?t:0;return(0,a.jsx)(i(),{href:"/tasks/".concat(r.id),className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(0,x.Oj)(r,b)}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(r.createdAt).toLocaleDateString(z)}),l>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,a.jsxs)("span",{className:"text-xs text-green-600 font-medium",children:["\uD83D\uDCBC ",l," ",p("dashboard.offers_count","предл.")]}),n>0&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["✕ ",n," ",p("dashboard.declined_count","откл.")]})]})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat("open"===r.status||"in_progress"===r.status?"bg-green-100 text-green-700":"completed"===r.status?"bg-gray-100 text-gray-600":"bg-red-100 text-red-600"),children:p("task.status.".concat(r.status),r.status)}),r.budget&&(0,a.jsxs)("p",{className:"text-sm font-bold text-green-600 mt-1",children:[(0,x.$g)(r.budget),"€"]})]})]})})}function W(e){var s,t;let{row:r}=e,l=r.offer||r,n=r.task,d=(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&null!=(t=null==(s=y.find(e=>{var s;return(null==(s=e.review)?void 0:s.taskId)===(null==n?void 0:n.id)}))?void 0:s.review)?t:null;return(0,a.jsxs)(i(),{href:n?"/tasks/".concat(n.id):"#",className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(null==n?void 0:n.title)||p("chat.task_fallback")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(l.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsxs)("p",{className:"font-bold text-green-600",children:[(0,x.$g)(l.price),"€"]}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat("accepted"===l.status?"bg-green-100 text-green-700":"declined"===l.status?"bg-red-100 text-red-700":"other_accepted"===l.status?"bg-green-100 text-green-600":"bg-gray-100 text-gray-700"),children:p("offer.status.".concat(l.status),l.status)})]})]}),d&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(e=>(0,a.jsx)("span",{className:"text-sm ".concat(e<=d.rating?"text-yellow-400":"text-gray-200"),children:"★"},e))}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-gray-700",children:[d.rating,"/5"]}),d.comment&&(0,a.jsx)("span",{className:"text-xs text-gray-500 truncate",children:d.comment})]}),(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&!d&&(0,a.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:p("dashboard.review_pending")})]})}let T=(null==n||null==(e=n.user)?void 0:e.role)==="specialist";return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:p("dashboard.title")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:p("dashboard.new_task")})]}),!1===B&&(0,a.jsxs)("div",{className:"mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("div",{className:"px-5 pt-5 pb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:p("dashboard.onboarding.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:p("dashboard.onboarding.subtitle")})]}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-2 gap-3 p-5 pt-2",children:[(0,a.jsxs)(i(),{href:"/specialist-setup",className:"group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDEE0️"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.helper.title")})]}),(0,a.jsx)("p",{className:"text-sm text-green-700/80 mb-3 flex-1",children:p("dashboard.onboarding.helper.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-green-700",children:[p("dashboard.onboarding.helper.cta")," →"]})]}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDCDD"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.requester.title")})]}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mb-3 flex-1",children:p("dashboard.onboarding.requester.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-gray-700",children:[p("dashboard.onboarding.requester.cta")," →"]})]})]})]}),C&&(0,a.jsx)(u,{dashboard:C,t:p}),S&&(T?(S.missedCount>0||S.missedEarnings>0)&&(0,a.jsxs)("div",{className:"mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-amber-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-amber-800",children:[p("fomo.specialist_missed","Вы пропустили {n} заказов").replace("{n}",String(null!=(t=S.missedCount)?t:0)),S.missedEarnings>0&&(0,a.jsxs)("span",{className:"ml-1 text-amber-600",children:["на €",S.missedEarnings]})]}),(null==(s=S.topCategories)?void 0:s.length)>0&&(0,a.jsxs)("p",{className:"text-sm text-amber-600 mt-0.5",children:[p("fomo.top_categories","Категории"),": ",S.topCategories.slice(0,3).join(", ")]})]}),(0,a.jsx)(i(),{href:"/pricing",className:"shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition",children:p("dashboard.plan.upgrade")})]}):S.totalTasks>0&&(0,a.jsx)("div",{className:"mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 bg-green-100 rounded-xl p-2",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-green-600",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"})})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-gray-800",children:[S.totalOffers," ",p("fomo.offers_received","предложений получено")]}),S.avgOffersPerTask>0&&(0,a.jsx)("p",{className:"text-sm text-gray-500",children:p("fomo.avg_offers","В среднем {n}/задача").replace("{n}",Number(S.avgOffersPerTask).toFixed(1))})]})]}),void 0!==S.completionRate&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)("p",{className:"text-2xl font-bold text-green-700",children:[Math.round(100*S.completionRate),"%"]}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:p("fomo.completion_rate","завершено")})]})]})})),T&&(0,a.jsxs)(i(),{href:"/tasks",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsxs)("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("find_tasks.title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("find_tasks.banner_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_tasks")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",O.length,")"]})]}),0===O.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.tasks.empty")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.tasks.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:O.map(e=>(0,a.jsx)(U,{task:e},e.id))})]}),P.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_tasks")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",P.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:P.map(e=>(0,a.jsx)(U,{task:e},e.id))})]})]}),(0,a.jsx)("div",{className:"space-y-8",children:T?(0,a.jsxs)(a.Fragment,{children:[k.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.invitations")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",k.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3",children:k.map(e=>(0,a.jsxs)(i(),{href:e.referenceId?"/tasks/".concat(e.referenceId):"/tasks",className:"flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(e.isRead?"bg-white/90 border-white/20 hover:bg-white":"bg-white border-amber-300 shadow-sm hover:bg-amber-50"),children:[(0,a.jsx)("span",{className:"text-2xl",children:"\uD83D\uDCCB"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium truncate ".concat(e.isRead?"text-gray-600":"text-gray-900"),children:p("notif.type.task_invite",e.title)}),e.body&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:(()=>{let s=function(e){var s;if(!e)return null;let t=e.match(/[«""](.+?)[»""]/);return null!=(s=null==t?void 0:t[1])?s:null}(e.body),t=p("notif.body.task_invite","");return s&&t?t.replace("{title}",s):e.body})()}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(e.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1.5 shrink-0",children:[!e.isRead&&(0,a.jsx)("span",{className:"w-2 h-2 bg-amber-400 rounded-full mt-2"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"→"})]})]},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_offers")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",F.length,")"]})]}),0===F.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.offers.empty")}),(0,a.jsx)(i(),{href:"/tasks",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.offers.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:F.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]}),H.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_offers")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",H.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:H.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i(),{href:"/specialists",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-white",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 0z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("dashboard.customer.specialists_title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("dashboard.customer.specialists_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-gray-800 mb-4",children:p("dashboard.customer.how_title")}),(0,a.jsx)("div",{className:"space-y-3",children:[{num:"1",text:p("dashboard.customer.step1"),icon:"M12 4v16m8-8H4"},{num:"2",text:p("dashboard.customer.step2"),icon:"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"},{num:"3",text:p("dashboard.customer.step3"),icon:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}].map(e=>{let{num:s,text:t,icon:r}=e;return(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center",children:s}),(0,a.jsx)("p",{className:"text-sm text-gray-600 pt-1",children:t})]},s)})}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"mt-4 inline-block text-sm font-medium text-green-600 hover:underline",children:[f.length>0?p("dashboard.tasks.add_new"):p("dashboard.tasks.empty.cta")," →"]})]})]})})]})]})}},1592:(e,s,t)=>{"use strict";t.d(s,{CI:()=>l,Hh:()=>n,Jv:()=>r,wV:()=>i,yK:()=>a});let a=(0,t(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:l,signUp:n,useSession:i}=a},2035:(e,s,t)=>{"use strict";t.d(s,{d:()=>l});var a=t(4568);let r={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:s,verified:t,size:l="sm",className:d=""}=e;if("free"===s&&!t)return null;let c="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(t&&"free"!==s)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(c," ").concat(r[s].class," ").concat(d),children:["ultimate"===s?(0,a.jsx)(n,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),r[s].label]});if(t)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(c," bg-green-100 text-green-700 border border-green-200 ").concat(d),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let o=r[s];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(c," ").concat(o.class," ").concat(d),children:["pro"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),o.label]})}function n(e){let{className:s=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:s=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},4017:(e,s,t)=>{"use strict";function a(e,s){return"el"===s&&e.titleEl?e.titleEl:"en"===s&&e.titleEn?e.titleEn:"ru"===s&&e.titleRu?e.titleRu:e.title}function r(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function l(e,s){return"el"===s&&e.descriptionEl?e.descriptionEl:"en"===s&&e.descriptionEn?e.descriptionEn:"ru"===s&&e.descriptionRu?e.descriptionRu:e.description}t.d(s,{$g:()=>r,GZ:()=>l,Oj:()=>a})},4658:(e,s,t)=>{Promise.resolve().then(t.bind(t,252))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=4658)),_N_E=e.O()}]); (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4466],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>l,Hh:()=>n,Jv:()=>a,wV:()=>d,yK:()=>r});let r=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:l,signUp:n,useSession:d}=r},5845:(e,t,s)=>{Promise.resolve().then(s.bind(s,9623))},9623:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(4568),a=s(7620),l=s(9664),n=s.n(l),d=s(9906),c=s(1592),o=s(2982);function i(){let{t:e}=(0,d.Y)(),{data:t}=(0,c.wV)(),[s,l]=(0,a.useState)(""),[i,x]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),j=async e=>{if(e.preventDefault(),i&&!m){u(!0),p(null);try{await (0,o.mq)({type:"delete_account",subject:"Account deletion request",body:s.trim()||"No reason provided."}),b(!0)}catch(e){var t;p(null!=(t=null==e?void 0:e.message)?t:"Error")}finally{u(!1)}}};return(0,r.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,r.jsxs)("div",{className:"max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsxs)(n(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",e("nav.home")]})}),(0,r.jsx)("h1",{className:"text-2xl font-extrabold text-gray-900 mb-2",children:e("delete_account.title")}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-8",children:e("delete_account.subtitle")}),h?(0,r.jsxs)("div",{className:"rounded-xl bg-green-50 border border-green-200 p-6 text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,r.jsx)("h2",{className:"text-base font-semibold text-green-800 mb-1",children:e("delete_account.success_title")}),(0,r.jsx)("p",{className:"text-sm text-green-700",children:e("delete_account.success_body")})]}):(null==t?void 0:t.user)?(0,r.jsxs)("form",{onSubmit:j,className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,r.jsx)("p",{className:"text-sm text-red-700",children:e("delete_account.warning")})]}),(0,r.jsx)("div",{className:"rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700",children:(0,r.jsx)("span",{className:"font-medium",children:t.user.email})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:e("delete_account.reason_label")}),(0,r.jsx)("textarea",{value:s,onChange:e=>l(e.target.value),placeholder:e("delete_account.reason_placeholder"),rows:4,maxLength:2e3,className:"w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none"})]}),(0,r.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:i,onChange:e=>x(e.target.checked),className:"mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e("delete_account.confirm_label")})]}),g&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:g}),(0,r.jsx)("button",{type:"submit",disabled:!i||m,className:"w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition",children:e(m?"delete_account.submitting":"delete_account.submit")})]}):(0,r.jsxs)("div",{className:"rounded-xl bg-amber-50 border border-amber-200 p-6 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-amber-800 mb-4",children:e("delete_account.login_required")}),(0,r.jsx)(n(),{href:"/login",className:"inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition",children:e("delete_account.login_btn")})]})]})})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=5845)),_N_E=e.O()}]); ;=(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8457],{1258:(e,t,r)=>{"use strict";function l(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 s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return l(r)}r.d(t,{E:()=>l,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>n,Hh:()=>a,Jv:()=>s,wV:()=>i,yK:()=>l});let l=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:n,signUp:a,useSession:i}=l},4251:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var l=r(4568),s=r(7620),n=r(7541),a=r(9664),i=r.n(a),o=r(1592),c=r(9906),d=r(2982),u=r(1258),x=r(2838);let m="https://api.canhelp.gr";function h(){var e,t,r,a,h,g,f;let p=(0,n.useRouter)(),v=(0,n.useSearchParams)(),{data:b,isPending:j}=(0,o.wV)(),{t:y,locale:w}=(0,c.Y)(),[N,k]=(0,s.useState)([]),[C,L]=(0,s.useState)(!0),[M,_]=(0,s.useState)(null),[S,U]=(0,s.useState)([]),[E,D]=(0,s.useState)(!1),[T,A]=(0,s.useState)(""),[R,B]=(0,s.useState)(!1),[H,W]=(0,s.useState)(null),[I,z]=(0,s.useState)(!1),[V,P]=(0,s.useState)(null),K=(0,s.useRef)(null),O=(0,s.useRef)(null),F=(0,s.useRef)(null),G=(0,s.useRef)(null);(0,s.useEffect)(()=>{j||b||p.push("/login")},[b,j]),(0,s.useEffect)(()=>{b&&((0,d.Zp)().then(e=>{k(e);let t=v.get("room");t&&_(t)}).catch(e=>console.error("[chat] getChatRooms error:",e)).finally(()=>L(!1)),(0,d.z4)().then(e=>W({left:e.messagesLeft,sent:e.messagesSent})).catch(e=>console.error("[chat] getDailyUsage error:",e)))},[b]),(0,s.useEffect)(()=>{if(!b)return;let e=(0,x.io)(m,{withCredentials:!0,transports:["websocket","polling"]});return K.current=e,e.on("connect",()=>B(!0)),e.on("disconnect",()=>B(!1)),e.on("new_message",e=>{U(t=>{var r,l;if(t.some(t=>t.message.id===e.id))return t;let s=b.user&&b.user.id===e.senderId?{id:b.user.id,name:null!=(r=b.user.name)?r:"",image:null!=(l=b.user.image)?l:void 0}:null;return[...t,{message:e,sender:s}]}),k(t=>t.map(t=>{var r,l;return t.room.id===e.roomId?{...t,lastMessage:{body:e.body,createdAt:e.createdAt,translations:null!=(r=e.translations)?r:null,imageUrl:null!=(l=e.imageUrl)?l:null}}:t}).sort((e,t)=>{var r,l;let s=(null==(r=e.lastMessage)?void 0:r.createdAt)?new Date(e.lastMessage.createdAt).getTime():new Date(e.room.createdAt).getTime();return((null==(l=t.lastMessage)?void 0:l.createdAt)?new Date(t.lastMessage.createdAt).getTime():new Date(t.room.createdAt).getTime())-s}))}),e.on("message_translated",e=>{let{id:t,roomId:r,translations:l}=e;U(e=>e.map(e=>e.message.id===t?{...e,message:{...e.message,translations:l}}:e)),r&&k(e=>e.map(e=>e.room.id===r&&e.lastMessage?{...e,lastMessage:{...e.lastMessage,translations:l}}:e))}),()=>{e.disconnect(),K.current=null}},[b]),(0,s.useEffect)(()=>{var e,t;M&&(D(!0),U([]),(0,d.VL)(M).then(U).catch(e=>console.error("[chat] getMessages error:",e)).finally(()=>D(!1)),null==(e=K.current)||e.emit("join_room",M),null==(t=K.current)||t.emit("mark_read",M))},[M]),(0,s.useEffect)(()=>{if(!M)return;let e=setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50);return()=>clearTimeout(e)},[M]),(0,s.useEffect)(()=>{var e;null==(e=O.current)||e.scrollIntoView({behavior:"smooth",block:"nearest"})},[S]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&P(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let J=(0,s.useCallback)(()=>{let e=T.trim();e&&M&&K.current&&(H&&null!==H.left&&H.left<=0||(K.current.emit("send_message",{roomId:M,body:e,locale:w}),A(""),W(e=>e&&null!==e.left?{...e,left:e.left-1,sent:e.sent+1}:e)))},[T,M,H]),Y=(0,s.useCallback)(async e=>{if(M&&K.current){z(!0);try{let t=new FormData;t.append("file",e);let r=await fetch("".concat(m,"/api/uploads"),{method:"POST",credentials:"include",body:t});if(!r.ok)throw Error("Upload failed");let{url:l}=await r.json();K.current.emit("send_message",{roomId:M,body:"",imageUrl:l,locale:w})}catch(e){}finally{z(!1),G.current&&(G.current.value="")}}},[M,w]),Z=null!=(g=({ru:"ru-RU",en:"en-US",el:"el-GR"})[w])?g:"el-GR";if(j||C)return(0,l.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let q=N.find(e=>e.room.id===M),Q=null==b||null==(e=b.user)?void 0:e.id;return(0,l.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4",children:[(0,l.jsxs)("div",{className:"w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col",children:[(0,l.jsxs)("div",{className:"p-4 border-b border-gray-100",children:[(0,l.jsx)("h1",{className:"font-bold text-gray-900 text-lg",children:y("nav.chat")}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,l.jsx)("span",{className:"w-2 h-2 rounded-full ".concat(R?"bg-green-400":"bg-gray-300")}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:R?y("chat.connected"):y("chat.disconnected")})]})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===N.length?(0,l.jsx)("div",{className:"p-6 text-center text-gray-400 text-sm",children:y("chat.no_rooms")}):N.map(e=>{var t,r,s;let{room:n,task:a,otherUser:i,lastMessage:o}=e,c=null!=(r=null==a?void 0:a.title)?r:(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||y("chat.direct_chat"),d=a?(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||"":y("chat.direct_chat");return(0,l.jsxs)("button",{onClick:()=>{_(n.id),setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50)},className:"w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(M===n.id?"bg-green-50 border-l-2 border-l-green-500":""),children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-1",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-gray-800 line-clamp-1 flex-1",children:c}),o&&(0,l.jsx)("span",{className:"text-[10px] text-gray-400 shrink-0 mt-0.5",children:function(e){let t=new Date(e),r=new Date,l=Math.floor((r.getTime()-t.getTime())/6e4);return l<1?y("chat.just_now"):l<60?"".concat(l).concat(y("chat.min_ago")):t.toDateString()===r.toDateString()?t.toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString(Z,{day:"2-digit",month:"2-digit"})}(o.createdAt)})]}),o?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:o.imageUrl&&!o.body?"\uD83D\uDCF7":null!=(s=null==(t=o.translations)?void 0:t[w])?s:o.body}):a?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:d}):null]},n.id)})})]}),(0,l.jsx)("div",{className:"flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden",children:M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"px-5 py-4 border-b border-gray-100",children:(0,l.jsx)("p",{className:"font-semibold text-gray-800 text-sm",children:null!=(f=null==q||null==(t=q.task)?void 0:t.title)?f:(0,u.H)(null==q||null==(r=q.otherUser)?void 0:r.firstName,null==q||null==(a=q.otherUser)?void 0:a.lastName,null==q||null==(h=q.otherUser)?void 0:h.name)||y("chat.direct_chat")})}),(null==q?void 0:q.task)&&(0,l.jsxs)(i(),{href:"/tasks/".concat(q.task.id),className:"flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0",children:(0,l.jsxs)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),(0,l.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-xs text-gray-500 font-medium",children:y("chat.linked_task")}),(0,l.jsx)("p",{className:"text-sm font-semibold text-gray-800 truncate group-hover:underline",children:q.task.title})]}),(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("polyline",{points:"9 18 15 12 9 6"})})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-3",children:[E?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("common.loading")}):0===S.length?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("chat.no_messages")}):S.map(e=>{var t,r,s,n,a;let{message:i,sender:o}=e,c=i.senderId===Q;return(0,l.jsxs)("div",{className:"flex gap-2.5 ".concat(c?"flex-row-reverse":""),children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden",children:(null==o?void 0:o.image)?(0,l.jsx)("img",{src:o.image,alt:o.name,className:"w-full h-full object-cover"}):null!=(n=null==o||null==(r=o.name)||null==(t=r[0])?void 0:t.toUpperCase())?n:"?"}),(0,l.jsxs)("div",{className:"max-w-[70%] ".concat(c?"items-end":"items-start"," flex flex-col gap-1"),children:[!c&&(0,l.jsx)("span",{className:"text-xs text-gray-400 px-1",children:(0,u.H)(null==o?void 0:o.firstName,null==o?void 0:o.lastName,null==o?void 0:o.name)}),i.imageUrl?(0,l.jsx)("button",{type:"button",onClick:()=>P("".concat(m).concat(i.imageUrl)),className:"block focus:outline-none",children:(0,l.jsx)("img",{src:"".concat(m).concat(i.imageUrl),alt:"photo",className:"rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition"})}):(0,l.jsx)("div",{className:"px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(c?"bg-green-600 text-white rounded-tr-sm":"bg-gray-100 text-gray-800 rounded-tl-sm"),children:null!=(a=null==(s=i.translations)?void 0:s[w])?a:i.body}),(0,l.jsx)("span",{className:"text-xs text-gray-300 px-1",children:new Date(i.createdAt).toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"})})]})]},i.id)}),(0,l.jsx)("div",{ref:O})]}),V&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:()=>P(null),children:(0,l.jsxs)("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("img",{src:V,alt:"photo",className:"max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl"}),(0,l.jsx)("button",{onClick:()=>P(null),className:"absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Close",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsx)("a",{href:V,download:!0,target:"_blank",rel:"noreferrer",className:"absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Download",onClick:e=>e.stopPropagation(),children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})})})]})}),(0,l.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100",children:[" ",(0,l.jsx)("input",{ref:G,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];r&&Y(r)}})," ",H&&null!==H.left&&H.left<=0&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-red-700 flex-1",children:y("chat.limit_reached","Дневной лимит сообщений исчерпан")}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-red-700 underline",children:y("plan.upgrade")})]}),H&&null!==H.left&&H.left>0&&H.left<=Math.ceil((H.left+H.sent)*.2)&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-amber-700 flex-1",children:y("chat.limit_warning","Осталось {n} сообщений сегодня").replace("{n}",String(H.left))}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-amber-700 underline",children:y("plan.upgrade")})]}),(0,l.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=G.current)?void 0:e.click()},disabled:I||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition",title:"Send photo",children:I?(0,l.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}):(0,l.jsxs)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,l.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3",ry:"3"}),(0,l.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,l.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}),(0,l.jsx)("textarea",{ref:F,value:T,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),J())},rows:1,placeholder:y("chat.placeholder"),disabled:!!(H&&null!==H.left&&H.left<=0),className:"flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400",style:{minHeight:"40px"}}),(0,l.jsx)("button",{onClick:J,disabled:!T.trim()||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M12 5l7 7-7 7"})})})]})]})]}):(0,l.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-400 text-sm",children:y("chat.select")})})]})}function g(){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)("div",{className:"text-center py-20 text-white",children:"..."}),children:(0,l.jsx)(h,{})})}},7016:(e,t,r)=>{Promise.resolve().then(r.bind(r,4251))}},e=>{e.O(0,[1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=7016)),_N_E=e.O()}]);  (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4040],{1258:(e,t,s)=>{"use strict";function i(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,s){if(null==e?void 0:e.trim()){let s=null==t?void 0:t.trim();return s?"".concat(e.trim()," ").concat(s[0].toUpperCase(),"."):e.trim()}return i(s)}s.d(t,{E:()=>i,H:()=>l})},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>a,yK:()=>i});let i=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:a}=i},3383:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var i=s(4568),l=s(7620),n=s(9664),r=s.n(n),a=s(7541),c=s(1592),o=s(9906),d=s(2982),m=s(1258);function u(){let{data:e,isPending:t}=(0,c.wV)(),s=(0,a.useRouter)(),{t:n}=(0,o.Y)(),[u,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(!0);async function f(e){await (0,d.sD)(e).catch(()=>{}),h(t=>t.filter(t=>{var s;return(null==(s=t.specialist)?void 0:s.id)!==e}))}return((0,l.useEffect)(()=>{if(!t&&!e)return void s.push("/login");e&&(0,d.pD)().then(h).catch(()=>{}).finally(()=>p(!1))},[e,t]),t||x)?(0,i.jsx)("div",{className:"text-center py-20 text-white",children:n("common.loading")}):(0,i.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-10",children:[(0,i.jsx)("h1",{className:"text-2xl font-bold text-white mb-6",children:n("favorites.specialists.title")}),0===u.length?(0,i.jsxs)("div",{className:"text-center py-20 text-white/70",children:[(0,i.jsx)("p",{className:"text-4xl mb-4",children:"\uD83E\uDD0D"}),(0,i.jsx)("p",{className:"text-lg",children:n("favorites.specialists.empty")}),(0,i.jsxs)(r(),{href:"/specialists",className:"mt-4 inline-block text-white hover:text-white/80 text-sm",children:[n("specialists.view")," →"]})]}):(0,i.jsx)("div",{className:"space-y-3",children:u.map(e=>{var t,s,l,a,c,o;let d=e.specialist;if(!d)return null;let u=(0,m.H)(d.firstName,d.lastName,d.name),h="".concat(null!=(c=null==(t=d.firstName)?void 0:t[0])?c:"").concat(null!=(o=null==(s=d.lastName)?void 0:s[0])?o:"").toUpperCase()||(null==(a=d.name)||null==(l=a[0])?void 0:l.toUpperCase())||"?";return(0,i.jsxs)("div",{className:"flex items-center gap-4 bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm transition",children:[(0,i.jsxs)(r(),{href:"/users/".concat(d.id),className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,i.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100",children:d.image?(0,i.jsx)("img",{src:d.image,alt:u,className:"w-full h-full object-cover"}):h}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"font-semibold text-gray-900 truncate",children:u}),d.bio&&(0,i.jsx)("p",{className:"text-sm text-gray-500 line-clamp-1",children:d.bio})]})]}),(0,i.jsx)("button",{onClick:()=>f(d.id),title:n("specialist.unfavorite"),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center text-pink-400 hover:text-pink-600 hover:bg-pink-50 rounded-full transition",children:"❤️"})]},e.id)})})]})}},4381:(e,t,s)=>{Promise.resolve().then(s.bind(s,3383))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=4381)),_N_E=e.O()}]); W(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6173],{1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>i,Hh:()=>o,Jv:()=>s,wV:()=>a,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:i,signUp:o,useSession:a}=n},3854:(e,t,r)=>{Promise.resolve().then(r.bind(r,8666))},8666:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var n=r(4568),s=r(7620),i=r(7541),o=r(1592),a=r(9906),l=r(2982);function c(e){let{type:t}=e,r="w-5 h-5";switch(t){case"new_offer":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2"}),(0,n.jsx)("path",{d:"M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16"})]});case"offer_accepted":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("polyline",{points:"9 12 11 14 15 10"})]});case"offer_declined":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,n.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]});case"task_completed":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})});case"task_cancelled":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),(0,n.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,n.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"new_message":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})});case"new_review":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.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"})});case"task_invite":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),(0,n.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]});default:return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,n.jsx)("path",{d:"M13.73 21a2 2 0 01-3.46 0"})]})}}let d={new_offer:"bg-green-100 text-green-600",offer_accepted:"bg-green-100 text-green-600",offer_declined:"bg-red-100 text-red-600",task_completed:"bg-emerald-100 text-emerald-600",task_cancelled:"bg-amber-100 text-amber-600",new_message:"bg-purple-100 text-purple-600",new_review:"bg-yellow-100 text-yellow-600",task_invite:"bg-indigo-100 text-indigo-600"};function u(){let{data:e,isPending:t}=(0,o.wV)(),r=(0,i.useRouter)(),{t:u,locale:x}=(0,a.Y)(),[h,f]=(0,s.useState)([]),[p,m]=(0,s.useState)(!0);async function g(){await (0,l.NL)(),f(e=>e.map(e=>({...e,isRead:!0})))}async function y(e){await (0,l.Ip)(e),f(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t))}async function k(e,t){e.stopPropagation(),await (0,l.yk)(t).catch(()=>{}),f(e=>e.filter(e=>e.id!==t))}if((0,s.useEffect)(()=>{t||e||r.push("/login")},[e,t]),(0,s.useEffect)(()=>{e&&(0,l.Tr)().then(f).catch(()=>{}).finally(()=>m(!1))},[e]),t||p)return(0,n.jsx)("div",{className:"text-center py-20 text-white",children:u("common.loading")});let j=h.filter(e=>!e.isRead).length,w="ru"===x?"ru-RU":"uk"===x?"uk-UA":"en"===x?"en-US":"el-GR";return(0,n.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,n.jsxs)("h1",{className:"text-2xl font-bold text-white",children:[u("notif.title")," ",j>0&&(0,n.jsxs)("span",{className:"text-white/70 font-normal text-xl",children:["(",j,")"]})]}),j>0&&(0,n.jsx)("button",{onClick:g,className:"text-sm text-white/80 hover:text-white hover:underline transition",children:u("notif.mark_all")})]}),0===h.length?(0,n.jsx)("div",{className:"text-center py-20 text-white/60",children:u("notif.empty")}):(0,n.jsx)("div",{className:"space-y-2",children:h.map(e=>{var t;let s="referral_reward"===e.type?"/profile?tab=referral":e.referenceId?"new_message"===e.type?"/chat?room=".concat(e.referenceId):"/tasks/".concat(e.referenceId):null,i=async()=>{e.isRead||await y(e.id),s&&r.push(s)};return(0,n.jsxs)("div",{onClick:i,className:"flex items-start gap-3 p-4 rounded-xl border transition ".concat(s?"cursor-pointer":"cursor-default"," ").concat(e.isRead?"bg-white/90 border-white/20 hover:bg-white":"bg-white border-green-300 shadow-sm hover:bg-green-50"),children:[(0,n.jsx)("div",{className:"p-2.5 rounded-xl flex-shrink-0 ".concat(null!=(t=d[e.type])?t:"bg-gray-100 text-gray-500"),children:(0,n.jsx)(c,{type:e.type})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"font-medium ".concat(e.isRead?"text-gray-600":"text-gray-900"),children:u("notif.type.".concat(e.type),e.title)}),e.body&&(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:(()=>{if("new_message"===e.type)return e.body;if("new_review"===e.type){let t=function(e){var t;if(!e)return null;let r=e.match(/(\d+)\s*[★\*]/);return null!=(t=null==r?void 0:r[1])?t:null}(e.body),r=u("notif.body.new_review","");return t&&r?r.replace("{rating}",t):e.body}let t=function(e){var t;if(!e)return null;let r=e.match(/[«""](.+?)[»""]/);return null!=(t=null==r?void 0:r[1])?t:null}(e.body),r=u("notif.body.".concat(e.type),"");return t&&r?r.replace("{title}",t):e.body})()}),(0,n.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3),r=Math.floor(t/60),n=Math.floor(r/60),s=Math.floor(n/24);if("ru"===x){if(t<60)return"только что";if(r<60)return"".concat(r," мин. назад");if(n<24)return"".concat(n," ч. назад");if(1===s)return"вчера";if(s<7)return"".concat(s," дн. назад")}else if("en"===x){if(t<60)return"just now";if(r<60)return"".concat(r,"m ago");if(n<24)return"".concat(n,"h ago");if(1===s)return"yesterday";if(s<7)return"".concat(s,"d ago")}else{if(t<60)return"μόλις τώρα";if(r<60)return"".concat(r," λ. πριν");if(n<24)return"".concat(n," ω. πριν");if(1===s)return"χθες";if(s<7)return"".concat(s," μ. πριν")}return new Date(e).toLocaleDateString(w,{day:"numeric",month:"short",year:s>365?"numeric":void 0})}(e.createdAt)})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-2 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{onClick:t=>k(t,e.id),className:"p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition",title:"Удалить",children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,n.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,n.jsx)("div",{className:"flex items-center gap-1.5",children:!e.isRead&&(0,n.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full"})})]})]},e.id)})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=3854)),_N_E=e.O()}]); (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8407],{2028:(e,t,r)=>{Promise.resolve().then(r.bind(r,3196))},3196:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var n=r(4568),s=r(7620),o=r(7541),c=r(9664),a=r.n(c),l=r(9906),i=r(2982);function d(){var e;let t=(0,o.useSearchParams)(),{t:r}=(0,l.Y)(),c=t.get("status"),d=t.get("ref"),[u,m]=(0,s.useState)("cancelled"===c?"cancelled":d?"loading":"pending");(0,s.useEffect)(()=>{if("cancelled"===c)return void m("cancelled");if(!d)return;let e=0,t=async()=>{e++;try{let e=(await i.pK()).find(e=>e.orderRef===d);if(e&&"pending"!==e.status)return void m(e.status)}catch(e){}e<12?setTimeout(t,2e3):m("pending")};setTimeout(t,2e3)},[d,c]);let h={success:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:r("payment.success.title"),desc:r("payment.success.desc"),color:"text-green-700",bg:"bg-green-50",border:"border-green-200"},cancelled:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})}),title:r("payment.cancelled.title"),desc:r("payment.cancelled.desc"),color:"text-yellow-700",bg:"bg-yellow-50",border:"border-yellow-200"},failed:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),title:r("payment.cancelled.title"),desc:r("payment.cancelled.desc"),color:"text-red-700",bg:"bg-red-50",border:"border-red-200"},pending:{icon:(0,n.jsx)("svg",{className:"w-16 h-16 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:r("payment.pending.title"),desc:r("payment.pending.desc"),color:"text-green-700",bg:"bg-green-50",border:"border-green-200"},loading:{icon:(0,n.jsxs)("svg",{className:"w-16 h-16 text-gray-400 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),title:r("payment.pending.title"),desc:r("payment.pending.desc"),color:"text-gray-700",bg:"bg-gray-50",border:"border-gray-200"}},g=null!=(e=h[u])?e:h.pending;return(0,n.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,n.jsxs)("div",{className:"bg-white rounded-2xl border ".concat(g.border," shadow-sm p-10 max-w-sm w-full text-center"),children:[(0,n.jsx)("div",{className:"flex justify-center mb-5",children:g.icon}),(0,n.jsx)("h1",{className:"text-2xl font-bold mb-2 ".concat(g.color),children:g.title}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mb-8",children:g.desc}),(0,n.jsxs)(a(),{href:"/profile",className:"inline-flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-xl transition-colors text-sm",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),r("payment.back_to_profile")]})]})})}},7541:(e,t,r)=>{"use strict";var n=r(3041);r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[9664,9906,2982,587,18,7358],()=>e(e.s=2028)),_N_E=e.O()}]); )8(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6907],{160:(e,t,r)=>{Promise.resolve().then(r.bind(r,8880))},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>l,Hh:()=>s,Jv:()=>n,wV:()=>i,yK:()=>a});let a=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:l,signUp:s,useSession:i}=a},2035:(e,t,r)=>{"use strict";r.d(t,{d:()=>l});var a=r(4568);let n={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:t,verified:r,size:l="sm",className:c=""}=e;if("free"===t&&!r)return null;let d="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(r&&"free"!==t)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(d," ").concat(n[t].class," ").concat(c),children:["ultimate"===t?(0,a.jsx)(s,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),n[t].label]});if(r)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(d," bg-green-100 text-green-700 border border-green-200 ").concat(c),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let o=n[t];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(d," ").concat(o.class," ").concat(c),children:["pro"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),o.label]})}function s(e){let{className:t=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:t=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},8880:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var a=r(4568),n=r(7620),l=r(9664),s=r.n(l),i=r(7541),c=r(1592),d=r(9906),o=r(2982),x=r(2035);let m=[{key:"maxMessagesPerDay",labelKey:"pricing.feat.messages",format:e=>null===e?"∞":String(e)},{key:"maxOrdersPerDay",labelKey:"pricing.feat.orders",format:e=>null===e?"∞":String(e)},{key:"canContactAll",labelKey:"pricing.feat.contact_all"},{key:"canViewPhone",labelKey:"pricing.feat.view_phone"},{key:"canShowContactInfo",labelKey:"pricing.feat.show_contact"},{key:"hasFavorites",labelKey:"pricing.feat.favorites"},{key:"hasVerifiedBadge",labelKey:"pricing.feat.verified_badge"},{key:"hasGoogleCalendar",labelKey:"pricing.feat.google_calendar"},{key:"hasPersonalSite",labelKey:"pricing.feat.personal_site"},{key:"hasAutoResponse",labelKey:"pricing.feat.auto_response"},{key:"hasAutoMatch",labelKey:"pricing.feat.auto_match"},{key:"highlightedReviews",labelKey:"pricing.feat.highlighted_reviews"},{key:"maxCards",labelKey:"pricing.feat.cards",format:e=>null===e?"∞":String(e)},{key:"notifyNewTasks",labelKey:"pricing.feat.notify_tasks"},{key:"canUploadVideo",labelKey:"pricing.feat.video"}];function g(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-green-500 mx-auto",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}function p(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4 text-gray-300 mx-auto",children:(0,a.jsx)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}let h=["free","pro","ultimate"],f={free:"text-gray-700",pro:"text-green-700",ultimate:"text-amber-600"},u={free:"bg-gray-100 text-gray-700 hover:bg-gray-200",pro:"bg-green-600 text-white hover:bg-green-700",ultimate:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600"};function b(){let{data:e}=(0,c.wV)(),{t}=(0,d.Y)(),r=(0,i.useRouter)(),[l,b]=(0,n.useState)([]),[y,j]=(0,n.useState)(null),[N,w]=(0,n.useState)(!0),[v,k]=(0,n.useState)(null),[_,L]=(0,n.useState)(null),[C,K]=(0,n.useState)(!1),[S,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=!1;return w(!0),(0,o.T9)().then(t=>{e||b(t.sort((e,t)=>h.indexOf(e.tier)-h.indexOf(t.tier)))}).catch(()=>{}).finally(()=>{e||w(!1)}),()=>{e=!0}},[]);let B=()=>{e&&(0,o.H)().then(e=>{var t,r;return j(null!=(r=null==(t=e.plan)?void 0:t.id)?r:null)}).catch(()=>{})};async function E(t){if(!e)return void r.push("/sign-in");k(t),L(null),K(!0);try{let e=await (0,o.Cs)(t.id);L(e)}catch(e){k(null)}finally{K(!1)}}async function F(){if(v&&_){P(!0);try{let e=await (0,o.Je)(v.id,_.canPayFromBalance);if(e.url&&e.params){let t=document.createElement("form");t.method="POST",t.action=e.url,Object.entries(e.params).forEach(e=>{let[r,a]=e,n=document.createElement("input");n.type="hidden",n.name=r,n.value=a,t.appendChild(n)}),document.body.appendChild(t),t.submit();return}j(v.id),k(null),L(null)}catch(e){}finally{P(!1)}}}return(0,n.useEffect)(B,[e]),(0,n.useEffect)(()=>{let e=()=>B();return window.addEventListener("canhelp:plan-changed",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:plan-changed",e),document.removeEventListener("visibilitychange",e)}},[e]),(0,a.jsxs)("main",{className:"min-h-screen py-12 px-4",children:[(0,a.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold text-white mb-3",children:t("pricing.title","Тарифы")}),(0,a.jsx)("p",{className:"text-white/70 text-lg",children:t("pricing.subtitle")})]}),N?(0,a.jsx)("div",{className:"text-center text-white/60 py-20",children:t("common.loading","Загрузка...")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:l.map(e=>{let r=e.id===y,n="free"===e.tier;return(0,a.jsxs)("div",{className:"rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(r?"ring-2 ring-green-500 ring-offset-2":""," ").concat("ultimate"===e.tier?"border-amber-300 shadow-lg shadow-amber-100":"border-gray-200"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"md"}),r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full",children:t("pricing.current_plan","Ваш план")}),"pro"===e.tier&&!r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full",children:t("pricing.popular","Популярный")})]}),(0,a.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:e.name}),(0,a.jsx)("p",{className:"text-gray-500 text-sm mb-4 min-h-[40px]",children:e.description}),(0,a.jsxs)("div",{className:"text-3xl font-extrabold mb-1 ".concat(f[e.tier]),children:[n?t("pricing.free","Бесплатно"):(0,a.jsxs)(a.Fragment,{children:[e.oldPrice&&(0,a.jsxs)("span",{className:"text-lg font-normal text-gray-400 line-through mr-2",children:["€",e.oldPrice]}),"€",e.price]}),!n&&(0,a.jsxs)("span",{className:"text-base font-normal text-gray-400",children:["/",t("pricing.per_month","мес")]})]}),e.durationDays&&!n&&(0,a.jsxs)("p",{className:"text-xs text-gray-400 mb-5",children:[t("pricing.duration","Срок"),": ",e.durationDays," ",t("pricing.days","дн.")]}),n&&(0,a.jsx)("div",{className:"mb-5"}),(0,a.jsx)("div",{className:"mt-auto",children:r?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl",children:t("pricing.your_plan","Активный план")}):n?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl",children:t("pricing.free_default","По умолчанию")}):(0,a.jsxs)("button",{onClick:()=>E(e),className:"block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(u[e.tier]),children:[t("pricing.choose","Выбрать")," ",e.name]})})]},e.id)})}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsx)("div",{className:"px-6 py-4 border-b border-gray-100",children:(0,a.jsx)("h3",{className:"font-semibold text-gray-900",children:t("pricing.compare","Сравнение функций")})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,a.jsx)("th",{className:"text-left px-6 py-3 text-gray-500 font-medium w-1/2",children:t("pricing.feature","Функция")}),l.map(e=>(0,a.jsx)("th",{className:"text-center px-4 py-3 font-medium text-gray-700",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"sm"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"free"===e.tier?t("pricing.free","Бесплатно"):"€".concat(e.price)})]})},e.id))]})}),(0,a.jsx)("tbody",{children:m.map(e=>{let{key:r,labelKey:n,format:s}=e;return(0,a.jsxs)("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50 transition",children:[(0,a.jsx)("td",{className:"px-6 py-3 text-gray-600",children:t(n,n)}),l.map(e=>{let t,n=e[r];return t=s?(0,a.jsx)("span",{className:"text-gray-700 font-medium",children:s(n)}):"boolean"==typeof n?n?(0,a.jsx)(g,{}):(0,a.jsx)(p,{}):(0,a.jsx)("span",{className:"text-gray-700",children:null===n?"∞":String(null!=n?n:"—")}),(0,a.jsx)("td",{className:"text-center px-4 py-3",children:t},e.id)})]},r)})})]})})]}),(0,a.jsx)("p",{className:"text-center text-white/50 text-sm mt-8",children:t("pricing.faq_note","Оплата списывается с баланса CanHelp. Пополнение доступно в разделе Оплата.")})]})]}),v&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:t("pricing.confirm.title","Подтвердите выбор тарифа")}),C?(0,a.jsx)("div",{className:"py-10 text-center text-gray-400",children:t("common.loading","Загрузка...")}):_?(0,a.jsxs)("div",{className:"space-y-3 text-sm text-gray-700",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.plan","Тариф")}),(0,a.jsx)("span",{className:"font-semibold",children:v.name})]}),"upgrade"===_.type&&Number(_.prorated)>0&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.prorated","Зачёт остатка")}),(0,a.jsxs)("span",{className:"text-green-600 font-medium",children:["−€",_.prorated]})]}),"downgrade"!==_.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.effective_price","К оплате")}),(0,a.jsxs)("span",{className:"font-bold text-gray-900",children:["€",_.effectivePrice]})]}),"downgrade"!==_.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.your_balance","Ваш баланс")}),(0,a.jsxs)("span",{className:_.canPayFromBalance?"text-green-600":"text-red-500",children:["€",_.currentBalance]})]}),"downgrade"===_.type&&(0,a.jsxs)("div",{className:"bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs",children:[t("pricing.confirm.downgrade_info","Переход на новый тариф произойдёт автоматически после окончания текущего периода."),_.scheduledDate&&(0,a.jsxs)(a.Fragment,{children:[" ",new Date(_.scheduledDate).toLocaleDateString("ru-RU")]})]}),"downgrade"!==_.type&&!_.canPayFromBalance&&(0,a.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs",children:[t("pricing.confirm.insufficient","Недостаточно средств на балансе.")," ",(0,a.jsx)(s(),{href:"/payment",className:"underline font-medium",onClick:()=>k(null),children:t("pricing.confirm.top_up","Пополнить")})]}),(0,a.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,a.jsx)("button",{onClick:()=>{k(null),L(null)},className:"flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition",children:t("common.cancel","Отмена")}),("downgrade"===_.type||_.canPayFromBalance)&&(0,a.jsx)("button",{onClick:F,disabled:S,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat("downgrade"===_.type?"bg-orange-500 hover:bg-orange-600":u[v.tier].replace("block w-full","").trim()," disabled:opacity-50"),children:S?t("common.loading","Загрузка..."):"downgrade"===_.type?t("pricing.confirm.schedule_downgrade","Запланировать переход"):t("pricing.confirm.pay","Оплатить")})]})]}):null]})})]})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=160)),_N_E=e.O()}]); 74(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7826],{1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>n,Jv:()=>s,wV:()=>c,yK:()=>l});let l=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:n,useSession:c}=l},2861:(e,t,r)=>{Promise.resolve().then(r.bind(r,9807))},9807:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>h});var l=r(4568),s=r(7620),a=r(7541),n=r(1592),c=r(9906),i=r(2982);let d={available:"busy",busy:null},o={ru:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],en:["Mo","Tu","We","Th","Fr","Sa","Su"],el:["Δε","Τρ","Τε","Πε","Πα","Σά","Κυ"]},x={ru:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],en:["January","February","March","April","May","June","July","August","September","October","November","December"],el:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]};function u(e,t,r){return"".concat(e,"-").concat(String(t+1).padStart(2,"0"),"-").concat(String(r).padStart(2,"0"))}function h(){var e;let{data:t,isPending:r}=(0,n.wV)(),o=(0,a.useRouter)(),x=(0,a.useSearchParams)(),{locale:u,t:h}=(0,c.Y)(),g=new Date,[b,f]=(0,s.useState)(g.getFullYear()),[y,p]=(0,s.useState)(g.getMonth()),[v,j]=(0,s.useState)({}),[w,N]=(0,s.useState)(null),[C,S]=(0,s.useState)(null),[D,k]=(0,s.useState)(!1),[E,M]=(0,s.useState)("available"),[_,F]=(0,s.useState)(null),[K,z]=(0,s.useState)(!1),[O,T]=(0,s.useState)(null),B=new Date().toISOString().slice(0,10);(0,s.useEffect)(()=>{var e,l;r||t||o.push("/login"),!r&&t&&(null==(e=t.user)?void 0:e.role)!=="specialist"&&(null==(l=t.user)?void 0:l.role)!=="admin"&&o.push("/profile")},[t,r]);let L=(0,s.useCallback)(()=>{(0,i.Em)("/google/calendar/status").then(F).catch(()=>F({connected:!1}))},[]);(0,s.useEffect)(()=>{if(!t)return;L();let e=x.get("gcal");"connected"===e?(T(h("schedule.gcalConnected")),setTimeout(()=>T(null),5e3),o.replace("/schedule")):"error"===e&&(T(h("schedule.gcalError")),setTimeout(()=>T(null),5e3),o.replace("/schedule"))},[t]);let A=(0,s.useCallback)((e,t)=>{let r="".concat(e,"-").concat(String(t+1).padStart(2,"0"));(0,i.iN)(r).then(e=>{j(t=>{let r={...t};return e.forEach(e=>{r[e.date]=e.status}),r})}).catch(()=>{})},[]);async function H(e){var t;if(e{let l={...e},s=new Date(t),a=new Date(r);for(;s<=a;){let e=s.toISOString().slice(0,10);e>=B&&(l[e]=E),s.setDate(s.getDate()+1)}return l})}catch(e){}return void N(null)}let r=null!=(t=v[e])?t:null,l=null===r?"available":d[r];N(e),j(t=>({...t,[e]:l}));try{await (0,i.OM)(e,l)}catch(t){j(t=>({...t,[e]:r}))}N(null)}if((0,s.useEffect)(()=>{if(!t)return;A(b,y);let e=new Date(b,y+1,1);A(e.getFullYear(),e.getMonth())},[t,b,y,A]),r)return(0,l.jsx)("div",{className:"text-center py-20 text-gray-500",children:h("common.loading")});let I=null==t||null==(e=t.user)?void 0:e.role;if(!t||"specialist"!==I&&"admin"!==I)return null;async function J(){window.location.href="".concat("https://api.canhelp.gr","/api/google/calendar/connect")}async function P(){if(confirm(h("schedule.gcalDisconnectConfirm"))){z(!0);try{await (0,i.Em)("/google/calendar/disconnect",{method:"DELETE"}),F({connected:!1})}catch(e){}z(!1)}}async function W(){z(!0);try{var e;let t=await (0,i.Em)("/google/calendar/import",{method:"POST"});T(h("schedule.gcalImportDone").replace("{n}",String(null!=(e=t.imported)?e:0))),setTimeout(()=>T(null),5e3),A(b,y)}catch(e){}z(!1)}return(0,l.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-10",children:[O&&(0,l.jsx)("div",{className:"fixed top-4 right-4 z-50 bg-white border border-gray-200 shadow-lg rounded-xl px-4 py-3 text-sm text-gray-800 max-w-xs",children:O}),(0,l.jsxs)("div",{className:"mb-8",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-white",children:h("schedule.title")}),(0,l.jsx)("p",{className:"text-sm text-white/70 mt-1",children:h("schedule.subtitle")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4 mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-emerald-100 border-2 border-emerald-400 flex items-center justify-center text-xs",children:"✓"}),h("schedule.available")]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-red-100 border-2 border-red-400 flex items-center justify-center text-xs",children:"✗"}),h("schedule.busy")]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/80",children:[(0,l.jsx)("span",{className:"w-6 h-6 rounded-lg bg-white/20 border border-white/30"}),h("schedule.unset")]}),(0,l.jsx)("div",{className:"text-xs text-white/50 self-center",children:h("schedule.click_hint")})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-6 p-3 bg-white rounded-xl border border-gray-200",children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,l.jsx)("div",{onClick:()=>{k(e=>!e),S(null)},className:"w-10 h-6 rounded-full transition-colors relative cursor-pointer ".concat(D?"bg-green-500":"bg-gray-200"),children:(0,l.jsx)("span",{className:"absolute top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(D?"translate-x-5":"translate-x-1")})}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:h("schedule.range_mode")})]}),D&&(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,l.jsx)("button",{onClick:()=>M("available"),className:"px-3 py-1 rounded-lg text-sm font-medium border transition ".concat("available"===E?"bg-emerald-100 border-emerald-400 text-emerald-700":"bg-white border-gray-200 text-gray-500"),children:h("schedule.available")}),(0,l.jsx)("button",{onClick:()=>M("busy"),className:"px-3 py-1 rounded-lg text-sm font-medium border transition ".concat("busy"===E?"bg-red-100 border-red-400 text-red-700":"bg-white border-gray-200 text-gray-500"),children:h("schedule.busy")}),C&&(0,l.jsx)("span",{className:"text-xs text-green-600",children:h("schedule.range_from").replace("{date}",C)})]})]}),(0,l.jsx)(m,{year:b,month:y,avail:v,saving:w,rangeStart:C,today:B,onToggle:H,onPrev:function(){0===y?(f(e=>e-1),p(11)):p(e=>e-1)},onNext:function(){11===y?(f(e=>e+1),p(0)):p(e=>e+1)}}),(0,l.jsxs)("div",{className:"mt-6 bg-white rounded-2xl border border-gray-200 p-5 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,l.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 48 48",fill:"none",children:[(0,l.jsx)("rect",{width:"48",height:"48",rx:"8",fill:"#fff"}),(0,l.jsx)("path",{d:"M34 14H14a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V16a2 2 0 0 0-2-2z",fill:"#4285F4"}),(0,l.jsx)("path",{d:"M28 20h-8v2h8v-2zm0 4h-8v2h8v-2zm-2 4h-6v2h6v-2z",fill:"#fff"}),(0,l.jsx)("circle",{cx:"18",cy:"18",r:"2",fill:"#DB4437"}),(0,l.jsx)("circle",{cx:"30",cy:"18",r:"2",fill:"#DB4437"}),(0,l.jsx)("rect",{x:"17",y:"12",width:"2",height:"6",rx:"1",fill:"#DB4437"}),(0,l.jsx)("rect",{x:"29",y:"12",width:"2",height:"6",rx:"1",fill:"#DB4437"})]}),(0,l.jsx)("h3",{className:"font-semibold text-gray-900 text-sm",children:h("schedule.googleCalendar")})]}),null===_?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:h("common.loading")}):_.connected?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,l.jsx)("circle",{cx:"8",cy:"8",r:"8",fill:"#22c55e"}),(0,l.jsx)("path",{d:"M5 8l2 2 4-4",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,l.jsxs)("span",{className:"text-sm text-gray-700",children:[h("schedule.connectedAs")," ",(0,l.jsx)("span",{className:"font-medium",children:_.email})]})]}),(0,l.jsx)("p",{className:"text-xs text-gray-400",children:h("schedule.gcalAutoSyncNote")}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)("button",{onClick:W,disabled:K,className:"px-3 py-1.5 rounded-lg border border-green-200 bg-green-50 text-green-700 text-xs font-medium hover:bg-green-100 disabled:opacity-50 transition",children:K?h("common.loading"):h("schedule.importFromGoogle")}),(0,l.jsx)("button",{onClick:P,disabled:K,className:"px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-xs font-medium hover:bg-gray-50 disabled:opacity-50 transition",children:h("schedule.disconnectGoogle")})]})]}):(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:h("schedule.gcalConnectDesc")}),(0,l.jsxs)("button",{onClick:J,className:"flex items-center gap-2 px-4 py-2 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 transition text-sm font-medium text-gray-700",children:[(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 48 48",fill:"none",children:[(0,l.jsx)("path",{d:"M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z",fill:"#FFC107"}),(0,l.jsx)("path",{d:"M6.3 14.7l7 5.1C15 16.1 19.1 13 24 13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 16.3 2 9.7 7.4 6.3 14.7z",fill:"#FF3D00"}),(0,l.jsx)("path",{d:"M24 46c5.5 0 10.5-1.9 14.4-5.1l-6.7-5.5C29.5 37 26.9 38 24 38c-6.1 0-11.2-4-13-9.5l-7 5.4C7.6 41.9 15.2 46 24 46z",fill:"#4CAF50"}),(0,l.jsx)("path",{d:"M44.5 20H24v8.5h11.8c-.9 2.8-2.8 5.1-5.3 6.6l6.7 5.5C41.5 37.3 45 31.1 45 24c0-1.3-.2-2.7-.5-4z",fill:"#1976D2"})]}),h("schedule.connectGoogle")]})]})]})]})}function m(e){var t,r;let{year:s,month:a,avail:n,saving:i,rangeStart:d,today:h,onToggle:m,onPrev:g,onNext:b}=e,{locale:f,t:y}=(0,c.Y)(),p=null!=(t=o[f])?t:o.ru,v=null!=(r=x[f])?r:x.ru,j=(new Date(s,a,1).getDay()+6)%7,w=new Date(s,a+1,0).getDate(),N=new Date(s,a,0).getDate(),C=[];for(let e=j-1;e>=0;e--)C.push({day:N-e,cur:!1,dateKey:""});for(let e=1;e<=w;e++)C.push({day:e,cur:!0,dateKey:u(s,a,e)});let S=C.length%7;if(0!==S)for(let e=1;e<=7-S;e++)C.push({day:e,cur:!1,dateKey:""});let D=u(s,a,1).slice(0,7),k=Object.entries(n).filter(e=>{let[t,r]=e;return t.startsWith(D)&&t>=h&&"available"===r}).length,E=Object.entries(n).filter(e=>{let[t,r]=e;return t.startsWith(D)&&t>=h&&"busy"===r}).length;return(0,l.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,l.jsx)("button",{onClick:g,className:"w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition",children:"‹"}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsxs)("h2",{className:"font-semibold text-gray-900",children:[v[a]," ",s]}),(0,l.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:[(0,l.jsxs)("span",{className:"text-emerald-600 font-medium",children:[k," ",y("schedule.free")]})," \xb7 ",(0,l.jsxs)("span",{className:"text-red-500 font-medium",children:[E," ",y("schedule.busy_count")]})]})]}),(0,l.jsx)("button",{onClick:b,className:"w-8 h-8 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500 transition",children:"›"})]}),(0,l.jsx)("div",{className:"grid grid-cols-7 border-b border-gray-100",children:p.map(e=>(0,l.jsx)("div",{className:"py-2 text-center text-xs font-medium text-gray-400",children:e},e))}),(0,l.jsx)("div",{className:"grid grid-cols-7",children:C.map((e,t)=>{var r;if(!e.cur)return(0,l.jsx)("div",{className:"p-1 h-12 flex items-center justify-center text-sm text-gray-200",children:e.day},"empty-".concat(t));let s=null!=(r=n[e.dateKey])?r:null,a=e.dateKeym(e.dateKey),disabled:a||o,title:"available"===s?y("schedule.available"):"busy"===s?y("schedule.busy"):y("schedule.click_to_set"),children:[(0,l.jsx)("span",{children:e.day}),!a&&"available"===s&&(0,l.jsx)("span",{className:"text-[9px] leading-none text-emerald-600",children:y("schedule.available").toLowerCase()}),!a&&"busy"===s&&(0,l.jsx)("span",{className:"text-[9px] leading-none text-red-500",children:y("schedule.busy").toLowerCase()}),o&&(0,l.jsx)("span",{className:"text-[8px] text-gray-400",children:"..."})]},e.dateKey)})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=2861)),_N_E=e.O()}]); r(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6043],{1258:(e,t,s)=>{"use strict";function l(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 r(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 l(s)}s.d(t,{E:()=>l,H:()=>r})},1569:(e,t,s)=>{Promise.resolve().then(s.bind(s,2026))},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>a,Hh:()=>n,Jv:()=>r,wV:()=>i,yK:()=>l});let l=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:a,signUp:n,useSession:i}=l},2026:(e,t,s)=>{"use strict";s.d(t,{default:()=>h});var l=s(4568),r=s(7620),a=s(9664),n=s.n(a),i=s(7541),o=s(1592),c=s(9906),d=s(2982),x=s(4017),u=s(1258),m=s(2035);let g={open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",completed:"bg-gray-100 text-gray-700",cancelled:"bg-red-100 text-red-700",draft:"bg-yellow-100 text-yellow-700"};function h(e){var t,s,a,h;let{taskId:p,initialTask:f,initialCustomer:b,catMap:j={},locMap:v={}}=e,{data:N}=(0,o.wV)(),{t:y,locale:w}=(0,c.Y)(),k=(0,i.useRouter)(),[C,L]=(0,r.useState)(f),[S]=(0,r.useState)(b),[M,_]=(0,r.useState)([]),[D,E]=(0,r.useState)(!1),[B,z]=(0,r.useState)(null),[A,W]=(0,r.useState)(!1),[I,R]=(0,r.useState)(null),[U,V]=(0,r.useState)(!1),[O,F]=(0,r.useState)(null),[H,T]=(0,r.useState)(5),[$,G]=(0,r.useState)(""),[P,q]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(!1),[K,Q]=(0,r.useState)(null),[Y,X]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(!1),[es,el]=(0,r.useState)(!1),[er,ea]=(0,r.useState)(null),[en,ei]=(0,r.useState)(null),[eo,ec]=(0,r.useState)(null),[ed,ex]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(!1),[eg,eh]=(0,r.useState)(!1),[ep,ef]=(0,r.useState)(!1),[eb,ej]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&ea(null),"ArrowLeft"===e.key&&ea(e=>null!==e&&e>0?e-1:e),"ArrowRight"===e.key&&ea(e=>{if(null===e)return e;let t=C.images;return t&&ewindow.removeEventListener("keydown",e)},[C.images]);let ev="ru"===w?"ru-RU":"uk"===w?"uk-UA":"en"===w?"en-US":"el-GR",eN=null==N||null==(t=N.user)?void 0:t.id,ey=eN===C.customerId,ew="/login?redirect=".concat(encodeURIComponent("/tasks/".concat(p)));async function ek(e){let t=await (0,d.$H)(e).catch(()=>null);t&&(_(s=>s.map(s=>s.offer.id===e?{...s,offer:t}:s)),L(e=>({...e,status:"in_progress"})))}async function eC(e){let t=await (0,d.Lb)(e).catch(()=>null);t&&_(s=>s.map(s=>s.offer.id===e?{...s,offer:t}:s))}async function eL(){window.confirm(y("task.complete.confirm"))&&await (0,d.Rt)(p).catch(()=>null)&&L(e=>({...e,status:"completed"}))}async function eS(e){if(e.preventDefault(),!O)return;q(!0);let t=await (0,d.bx)({taskId:p,targetId:O,rating:H,comment:$||void 0}).catch(()=>null);q(!1),t&&(J(!0),F(null))}async function eM(e){el(!0);try{let{room:t}=await (0,d.QN)(e);k.push("/chat?room=".concat(t.id))}catch(e){}el(!1)}async function e_(e){if(e.preventDefault(),eb){ef(!0);try{let e={title:eb.title,description:eb.description,budgetNegotiable:eb.budgetNegotiable,status:eb.status};""!==eb.budget&&eb.budget>0&&(e.budget=Number(eb.budget)),eb.category&&(e.category=eb.category),eb.location&&(e.location=eb.location),eb.district&&(e.district=eb.district),eb.street&&(e.street=eb.street),eb.houseNumber&&(e.houseNumber=eb.houseNumber),eb.timeSlot&&(e.timeSlot=eb.timeSlot),void 0!==eb.confidentialNote&&(e.confidentialNote=eb.confidentialNote),eb.deadline&&(e.deadline=new Date(eb.deadline).toISOString()),eb.expiresAt&&(e.expiresAt=new Date(eb.expiresAt).toISOString());let t=await (0,d.lC)(p,e);L(e=>({...e,...t})),eh(!1)}catch(e){alert((null==e?void 0:e.message)||y("common.error"))}finally{ef(!1)}}}(0,r.useEffect)(()=>{ey&&!D&&(0,d.Sw)(p).then(e=>{_(e),E(!0)}).catch(()=>E(!0))},[ey,p,D]),(0,r.useEffect)(()=>{ey&&((0,d.vh)(p).then(ei).catch(()=>{}),(0,d.H)().then(e=>{var t;return em(!!(null==(t=e.features)?void 0:t.hasAutoMatch))}).catch(()=>{}))},[ey,p]),(0,r.useEffect)(()=>{!eN||ey||A||(0,d.aT)().then(e=>{var t;let s=e.find(e=>{var t;return(null==(t=e.task)?void 0:t.id)===p});z(null!=(t=null==s?void 0:s.offer)?t:null),W(!0)}).catch(()=>W(!0))},[eN,ey,p,A]),(0,r.useEffect)(()=>{!eN||ey||Y||(0,d.F9)(p).then(e=>{var t;Q(null!=(t=e[0])?t:null),X(!0)}).catch(()=>X(!0))},[eN,ey,p,Y]),(0,r.useEffect)(()=>{!eN||ey||U||"completed"!==C.status||(0,d.H6)(p).then(e=>{let t=e.find(e=>e.targetId===eN);R(null!=t?t:null),V(!0)}).catch(()=>V(!0))},[eN,ey,p,C.status,U]);let eD=M.find(e=>"accepted"===e.offer.status);return(0,l.jsxs)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[(0,l.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 mb-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-start gap-4 mb-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-medium px-2 py-1 rounded-full ".concat(g[C.status]),children:y("task.status.".concat(C.status),C.status)}),C.category&&(0,l.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full",children:null!=(a=j[C.category])?a:C.category}),ey&&(0,l.jsx)("span",{className:"text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full",children:y("task.yours")})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[ey&&("draft"===C.status||"open"===C.status)&&(0,l.jsxs)("button",{onClick:function(){var e,t,s,l,r,a,n,i;ej({title:C.title,description:C.description,budget:C.budget?Number(C.budget):"",budgetNegotiable:null!=(e=C.budgetNegotiable)&&e,category:null!=(t=C.category)?t:"",location:null!=(s=C.location)?s:"",district:null!=(l=C.district)?l:"",street:null!=(r=C.street)?r:"",houseNumber:null!=(a=C.houseNumber)?a:"",timeSlot:null!=(n=C.timeSlot)?n:"",confidentialNote:null!=(i=C.confidentialNote)?i:"",deadline:C.deadline?new Date(C.deadline).toISOString().slice(0,10):"",expiresAt:C.expiresAt?new Date(C.expiresAt).toISOString().slice(0,10):"",status:"draft"===C.status?"draft":"open"}),eh(!0)},className:"flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125"})}),y("task.edit")]}),(0,l.jsx)("p",{className:"text-sm text-gray-400",children:new Date(C.createdAt).toLocaleDateString(ev)})]})]}),(0,l.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:(0,x.Oj)(C,w)}),(0,l.jsx)("p",{className:"text-gray-700 whitespace-pre-wrap mb-6",children:(0,x.GZ)(C,w)}),(0,l.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg",children:[C.budget&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.budget")}),(0,l.jsxs)("p",{className:"font-bold text-green-600 text-lg",children:[C.budget,"€"]}),C.budgetNegotiable&&(0,l.jsx)("p",{className:"text-xs text-green-600 mt-0.5",children:y("task.budget_negotiable")})]}),!C.budget&&C.budgetNegotiable&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.budget")}),(0,l.jsx)("p",{className:"font-medium text-green-600",children:y("task.budget_negotiable")})]}),C.location&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.location")}),(0,l.jsxs)("p",{className:"font-medium",children:["\uD83D\uDCCD ",null!=(h=v[C.location])?h:C.location]})]}),C.deadline&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.deadline")}),(0,l.jsx)("p",{className:"font-medium",children:new Date(C.deadline).toLocaleDateString(ev)}),C.timeSlot&&""!==C.timeSlot&&(0,l.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:y("create.field.time_slot.".concat(C.timeSlot),C.timeSlot)})]}),!C.deadline&&C.timeSlot&&""!==C.timeSlot&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.time_slot")}),(0,l.jsx)("p",{className:"font-medium",children:y("create.field.time_slot.".concat(C.timeSlot),C.timeSlot)})]}),C.expiresAt&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.expires_at")}),(0,l.jsx)("p",{className:"font-medium",children:new Date(C.expiresAt).toLocaleDateString(ev)})]}),S&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs text-gray-500",children:y("task.customer")}),(0,l.jsxs)(n(),{href:"/users/".concat(S.id),className:"flex items-center gap-2 mt-1 group",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center",children:S.image?(0,l.jsx)("img",{src:S.image,alt:(0,u.E)(S.name),className:"w-full h-full object-cover"}):(0,l.jsx)("span",{className:"text-green-600 font-semibold text-xs",children:(0,u.E)(S.name).charAt(0).toUpperCase()})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium text-gray-900 group-hover:text-green-600 leading-none",children:(0,u.E)(S.name)}),S.rating&&(0,l.jsxs)("p",{className:"text-xs text-yellow-500 leading-none mt-0.5",children:["★ ",Number(S.rating).toFixed(1)]})]})]})]})]}),C.images&&C.images.length>0&&(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:C.images.map((e,t)=>(0,l.jsx)("button",{onClick:()=>ea(t),className:"block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition",children:(0,l.jsx)("img",{src:e,alt:"",className:"w-full h-full object-cover"})},t))})}),null!==er&&C.images&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/85",onClick:()=>ea(null),children:(0,l.jsxs)("div",{className:"relative max-w-4xl w-full mx-4",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("img",{src:C.images[er],alt:"",className:"w-full max-h-[80vh] object-contain rounded-lg"}),(0,l.jsx)("button",{onClick:()=>ea(null),className:"absolute -top-10 right-0 text-white/80 hover:text-white p-2",children:(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),er>0&&(0,l.jsx)("button",{onClick:()=>ea(er-1),className:"absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2",children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),erea(er+1),className:"absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2",children:(0,l.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}),C.images.length>1&&(0,l.jsxs)("p",{className:"text-white/60 text-sm text-center mt-3",children:[er+1," / ",C.images.length]})]})}),(ey||(null==B?void 0:B.status)==="accepted")&&(C.district||C.street||C.confidentialNote)&&(0,l.jsxs)("div",{className:"mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2",children:[(0,l.jsxs)("p",{className:"text-xs font-medium text-yellow-700 flex items-center gap-1",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),y("task.confidential")]}),(C.district||C.street)&&(0,l.jsxs)("p",{className:"text-sm text-yellow-800",children:["\uD83D\uDCCD ",[C.district,C.street,C.houseNumber].filter(Boolean).join(", ")]}),C.confidentialNote&&(0,l.jsx)("p",{className:"text-sm text-yellow-800",children:C.confidentialNote})]}),(0,l.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[!N&&!ey&&"open"===C.status&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n(),{href:ew,className:"bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700",children:y("task.make_offer","Отправить предложение")}),(0,l.jsxs)(n(),{href:ew,className:"flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),y("chat.write_customer","Написать заказчику")]})]}),ey&&"in_progress"===C.status&&(0,l.jsx)("button",{onClick:eL,className:"bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700",children:y("task.complete")}),ey&&(null==eD||null==(s=eD.specialist)?void 0:s.id)&&(0,l.jsxs)("button",{onClick:()=>eM(eD.specialist.id),disabled:es,className:"flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),y("chat.write_specialist")]}),ey&&"completed"===C.status&&eD&&!Z&&(0,l.jsx)("button",{onClick:()=>{var e,t;return F(null!=(t=null==(e=eD.specialist)?void 0:e.id)?t:null)},className:"bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600",children:y("review.leave")}),Z&&(0,l.jsx)("span",{className:"text-green-600 font-medium py-3",children:y("review.done")})]}),O&&(0,l.jsxs)("form",{onSubmit:eS,className:"mt-6 border-t border-gray-100 pt-6 space-y-4",children:[(0,l.jsx)("h3",{className:"font-semibold text-gray-800",children:y("review.leave")}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:y("review.rating")}),(0,l.jsx)("div",{className:"flex gap-1",children:[1,2,3,4,5].map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>T(e),className:"text-2xl transition ".concat(e<=H?"text-yellow-400":"text-gray-300"),children:"★"},e))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("review.comment")}),(0,l.jsx)("textarea",{value:$,onChange:e=>G(e.target.value),rows:3,maxLength:2e3,placeholder:y("review.comment.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)("button",{type:"submit",disabled:P,className:"bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50",children:P?y("review.submitting"):y("review.submit")}),(0,l.jsx)("button",{type:"button",onClick:()=>F(null),className:"px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50",children:y("common.cancel")})]})]})]}),ey&&(0,l.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-wrap gap-2",children:[(0,l.jsxs)("h2",{className:"text-lg font-bold text-gray-900",children:[y("task.offers")," (",M.length,")"]}),en&&(0,l.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[en.totalViews>0&&(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),en.totalViews]}),en.offerCount>0&&(0,l.jsxs)("span",{className:"font-medium text-green-600",children:["⚡ ",en.offerCount," ",y("task.offers").toLowerCase()]})]}),eu&&"open"===C.status&&(0,l.jsxs)("button",{onClick:async()=>{ex(!0);try{var e;let t=await (0,d.OV)(p);ec(null!=(e=t.matches)?e:[])}catch(e){}finally{ex(!1)}},disabled:ed,className:"flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),ed?y("common.loading"):y("task.auto_match","Авто-матч")]})]}),eo&&eo.length>0&&(0,l.jsxs)("div",{className:"mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100",children:[(0,l.jsx)("p",{className:"text-xs font-medium text-purple-700 mb-2",children:y("task.auto_match_results","Топ специалисты")}),(0,l.jsx)("div",{className:"space-y-2",children:eo.slice(0,5).map(e=>{var t,s,r;return(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden",children:e.image?(0,l.jsx)("img",{src:e.image,alt:"",className:"w-full h-full object-cover"}):null==(s=e.name)||null==(t=s[0])?void 0:t.toUpperCase()}),(0,l.jsx)("span",{className:"text-sm text-gray-800",children:null!=(r=e.firstName)?r:e.name}),e.rating&&(0,l.jsxs)("span",{className:"text-xs text-yellow-500",children:["★",Number(e.rating).toFixed(1)]})]}),(0,l.jsx)("button",{onClick:()=>eM(e.id),className:"text-xs text-green-600 hover:underline",children:y("chat.write_btn")})]},e.id)})})]}),D?0===M.length?(0,l.jsx)("p",{className:"text-gray-500 text-sm",children:y("task.offers.none")}):(0,l.jsx)("div",{className:"space-y-4",children:M.map(e=>{var t,s,r;let a=e.offer,i=e.specialist;return(0,l.jsxs)("div",{className:"border border-gray-100 rounded-xl p-4",children:[(0,l.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden",children:(null==i?void 0:i.image)?(0,l.jsx)("img",{src:i.image,alt:i.name,className:"w-full h-full object-cover"}):null!=(r=null==i||null==(s=i.name)||null==(t=s[0])?void 0:t.toUpperCase())?r:"?"}),(0,l.jsxs)("div",{children:[i&&(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)(n(),{href:"/users/".concat(i.id),className:"font-medium text-gray-900 hover:text-green-600",children:(0,u.E)(i.name)}),i.planTier&&"free"!==i.planTier&&(0,l.jsx)(m.d,{tier:i.planTier}),i.hasVerifiedBadge&&(0,l.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-500",viewBox:"0 0 24 24",fill:"currentColor",children:(0,l.jsx)("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),a.message&&(0,l.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:a.message})]})]}),(0,l.jsxs)("div",{className:"text-right shrink-0",children:[(0,l.jsxs)("p",{className:"text-lg font-bold text-green-600",children:[(0,x.$g)(a.price),"€"]}),(0,l.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat("accepted"===a.status?"bg-green-100 text-green-700":"declined"===a.status?"bg-red-100 text-red-700":"bg-gray-100 text-gray-700"),children:y("offer.status.".concat(a.status),a.status)})]})]}),"pending"===a.status&&"open"===C.status&&(0,l.jsxs)("div",{className:"flex gap-2 mt-3 pt-3 border-t border-gray-50",children:[(0,l.jsx)("button",{onClick:()=>ek(a.id),className:"flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700",children:y("offer.accept")}),(0,l.jsx)("button",{onClick:()=>eC(a.id),className:"flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200",children:y("offer.decline")})]})]},a.id)})}):(0,l.jsx)("p",{className:"text-gray-400 text-sm",children:y("common.loading")})]}),!ey&&N&&K&&Y&&"open"===C.status&&!B&&(0,l.jsx)("div",{className:"rounded-xl border border-green-200 bg-green-50 p-5",children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap gap-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5 text-green-600",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"})})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:y("task.invite.banner_title")}),(0,l.jsx)("p",{className:"text-gray-500 text-sm mt-0.5",children:y("task.invite.banner_hint")})]})]}),(0,l.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,l.jsx)(n(),{href:"/tasks/".concat(p,"/offer"),className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition",children:y("task.invite.accept")}),(0,l.jsx)("button",{onClick:async()=>{K&&(et(!0),await (0,d.yk)(K.id).catch(()=>{}),Q(null),et(!1))},disabled:ee,className:"border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition",children:y("task.invite.decline")})]})]})}),!ey&&N&&A&&(0,l.jsxs)("div",{className:"space-y-4",children:["completed"===C.status&&(null==B?void 0:B.status)==="accepted"&&(0,l.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4",children:[(0,l.jsx)("span",{className:"text-3xl",children:"\uD83C\uDF89"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-bold text-green-800 text-lg",children:"Задание завершено!"}),(0,l.jsx)("p",{className:"text-green-700 text-sm",children:"Заказчик отметил задание как выполненное."})]}),(0,l.jsxs)("button",{onClick:()=>eM(C.customerId),disabled:es,className:"ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),y("chat.write_customer")]})]}),(B||"open"===C.status&&!K||"open"!==C.status)&&(0,l.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,l.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Моё предложение"}),B?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[B.message&&(0,l.jsx)("p",{className:"text-sm text-gray-600",children:B.message}),(0,l.jsx)("p",{className:"text-xs text-gray-400",children:new Date(B.createdAt).toLocaleString(ev)})]}),(0,l.jsxs)("div",{className:"text-right shrink-0",children:[(0,l.jsxs)("p",{className:"text-xl font-bold text-green-600",children:[(0,x.$g)(B.price),"€"]}),(0,l.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium ".concat("accepted"===B.status?"bg-green-100 text-green-700":"declined"===B.status?"bg-red-100 text-red-700":"bg-yellow-100 text-yellow-700"),children:"accepted"===B.status?"✓ Принято":"declined"===B.status?"✗ Отклонено":"⏳ На рассмотрении"})]})]}),"accepted"===B.status&&"in_progress"===C.status&&(0,l.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:(0,l.jsxs)("button",{onClick:()=>eM(C.customerId),disabled:es,className:"flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),y("chat.write_customer")]})})]}):"open"!==C.status||K?null:(0,l.jsxs)("div",{className:"space-y-3",children:[en&&en.offerCount>0&&(0,l.jsxs)("div",{className:"flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),(0,l.jsx)("p",{className:"text-xs text-amber-700",children:y("fomo.already_offered","Уже {n} специалистов откликнулись").replace("{n}",String(en.offerCount))})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-sm text-gray-500",children:y("task.no_offer_yet","Вы ещё не отправили предложение")}),(0,l.jsx)(n(),{href:"/tasks/".concat(p,"/offer"),className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700",children:y("task.make_offer","Отправить предложение")})]})]})]}),"completed"===C.status&&(null==B?void 0:B.status)==="accepted"&&(0,l.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,l.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:"Оценка заказчика"}),U?I?(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[[1,2,3,4,5].map(e=>(0,l.jsx)("span",{className:"text-2xl ".concat(e<=I.rating?"text-yellow-400":"text-gray-200"),children:"★"},e)),(0,l.jsxs)("span",{className:"ml-2 text-lg font-bold text-gray-800",children:[I.rating,"/5"]})]}),I.comment&&(0,l.jsx)("p",{className:"text-gray-700 text-sm leading-relaxed",children:I.comment}),(0,l.jsx)("p",{className:"text-xs text-gray-400",children:new Date(I.createdAt).toLocaleDateString(ev)})]}):(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"Заказчик ещё не оставил оценку."}):(0,l.jsx)("p",{className:"text-sm text-gray-400",children:"Загрузка..."})]})]}),eg&&eb&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4",children:(0,l.jsxs)("div",{className:"bg-white rounded-2xl w-full max-w-2xl shadow-xl",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,l.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:y("task.edit")}),(0,l.jsx)("button",{onClick:()=>eh(!1),className:"text-gray-400 hover:text-gray-600 p-1",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,l.jsxs)("form",{onSubmit:e_,className:"p-6 space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.title")," *"]}),(0,l.jsx)("input",{type:"text",required:!0,minLength:5,maxLength:200,value:eb.title,onChange:e=>ej(t=>({...t,title: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,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.description")," *"]}),(0,l.jsx)("textarea",{required:!0,minLength:20,value:eb.description,onChange:e=>ej(t=>({...t,description:e.target.value})),rows:4,className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.budget")}),(0,l.jsx)("input",{type:"number",min:1,value:eb.budget,onChange:e=>ej(t=>({...t,budget: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,l.jsx)("div",{className:"flex items-end pb-2",children:(0,l.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:eb.budgetNegotiable,onChange:e=>ej(t=>({...t,budgetNegotiable:e.target.checked})),className:"w-4 h-4 rounded text-green-600"}),(0,l.jsx)("span",{className:"text-sm text-gray-700",children:y("create.field.budget_negotiable")})]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.deadline")}),(0,l.jsx)("input",{type:"date",value:eb.deadline,onChange:e=>ej(t=>({...t,deadline: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,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.expires_at")}),(0,l.jsx)("input",{type:"date",value:eb.expiresAt,onChange:e=>ej(t=>({...t,expiresAt: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,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.address.district")}),(0,l.jsx)("input",{type:"text",value:eb.district,onChange:e=>ej(t=>({...t,district: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,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.address.street")}),(0,l.jsx)("input",{type:"text",value:eb.street,onChange:e=>ej(t=>({...t,street: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,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.address.house")}),(0,l.jsx)("input",{type:"text",value:eb.houseNumber,onChange:e=>ej(t=>({...t,houseNumber: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,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.confidential")}),(0,l.jsx)("textarea",{value:eb.confidentialNote,onChange:e=>ej(t=>({...t,confidentialNote:e.target.value})),rows:2,className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("task.status_label","Статус")}),(0,l.jsxs)("select",{value:eb.status,onChange:e=>ej(t=>({...t,status: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,l.jsx)("option",{value:"open",children:y("task.status.open")}),(0,l.jsx)("option",{value:"draft",children:y("task.status.draft")})]})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,l.jsx)("button",{type:"submit",disabled:ep,className:"flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition",children:ep?y("common.saving","..."):y("common.save")}),(0,l.jsx)("button",{type:"button",onClick:()=>eh(!1),className:"px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition",children:y("common.cancel")})]})]})]})})]})}},2035:(e,t,s)=>{"use strict";s.d(t,{d:()=>a});var l=s(4568);let r={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,l.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,l.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,l.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,l.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function a(e){let{tier:t,verified:s,size:a="sm",className:o=""}=e;if("free"===t&&!s)return null;let c="sm"===a?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(s&&"free"!==t)return(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(c," ").concat(r[t].class," ").concat(o),children:["ultimate"===t?(0,l.jsx)(n,{className:"w-3 h-3 fill-gray-900"}):(0,l.jsx)(i,{className:"w-3 h-3"}),r[t].label]});if(s)return(0,l.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(c," bg-green-100 text-green-700 border border-green-200 ").concat(o),children:(0,l.jsx)(i,{className:"w-3 h-3"})});let d=r[t];return(0,l.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(c," ").concat(d.class," ").concat(o),children:["pro"===t&&(0,l.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===t&&(0,l.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),d.label]})}function n(e){let{className:t=""}=e;return(0,l.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:(0,l.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:t=""}=e;return(0,l.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:[(0,l.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,l.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},4017:(e,t,s)=>{"use strict";function l(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function r(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function a(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:()=>r,GZ:()=>a,Oj:()=>l})}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=1569)),_N_E=e.O()}]); q(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1755],{1592:(e,t,l)=>{"use strict";l.d(t,{CI:()=>r,Hh:()=>n,Jv:()=>a,wV:()=>o,yK:()=>s});let s=(0,l(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:r,signUp:n,useSession:o}=s},2773:(e,t,l)=>{"use strict";l.d(t,{SpecialistsFiltersClient:()=>d});var s=l(4568),a=l(7620),r=l(7541),n=l(9906),o=l(2818),i=l(3119);let c=[{code:"el",label:"Ελληνικά"},{code:"en",label:"English"},{code:"ru",label:"Русский"},{code:"uk",label:"Українська"},{code:"de",label:"Deutsch"},{code:"fr",label:"Fran\xe7ais"},{code:"it",label:"Italiano"},{code:"es",label:"Espa\xf1ol"},{code:"ar",label:"العربية"},{code:"zh",label:"中文"}];function d(e){let{catTree:t,locations:l,initialQ:d,initialCategory:u,initialLocation:h,initialLanguages:b=[]}=e,g=(0,r.useRouter)(),{t:x,locale:p}=(0,n.Y)(),[m,f]=(0,a.useState)(null!=u?u:""),[y,k]=(0,a.useState)(null!=h?h:""),[v,j]=(0,a.useState)(b),w=!!(d||u||h||b.length),N=(e,t,l,s)=>{let a=new URLSearchParams;e&&a.set("q",e),t&&a.set("category",t),l&&a.set("location",l),s.length&&a.set("language",s.join(",")),g.push("/specialists".concat(a.toString()?"?"+a.toString():""))},C=e=>{let t=v.includes(e)?v.filter(t=>t!==e):[...v,e];j(t),N(null!=d?d:"",m,y,t)},S=x("create.field.location.any"),L=x("create.field.location.all"),_=x("filter.category.all"),D=x("create.field.category"),E=x("filter.location"),P=x("filter.language"),V=x("tasks.filter.reset");return(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),N(new FormData(e.currentTarget).get("q")||"",m,y,v)},className:"space-y-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)("input",{name:"q",defaultValue:d,placeholder:x("specialists.search"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})}),t.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:D}),(0,s.jsx)(o.W,{categories:t,locale:"en"===p?"en":"ru"===p?"ru":"uk"===p?"uk":"el",value:m,onChange:e=>{f(e),N(null!=d?d:"",e,y,v)},placeholder:_})]}),l.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:E}),(0,s.jsx)(i.V,{locations:l,value:y,onChange:e=>{k(e),N(null!=d?d:"",m,e,v)},anyLabel:S,allLabel:L})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-2",children:P}),(0,s.jsx)("div",{className:"space-y-1",children:c.map(e=>{let t=v.includes(e.code);return(0,s.jsxs)("label",{className:"flex items-center gap-2.5 cursor-pointer group py-0.5",children:[(0,s.jsx)("span",{className:"w-4 h-4 rounded flex items-center justify-center border transition-colors flex-shrink-0 ".concat(t?"bg-green-600 border-green-600":"border-gray-300 group-hover:border-green-400"),onClick:()=>C(e.code),children:t&&(0,s.jsx)("svg",{className:"w-2.5 h-2.5 text-white",viewBox:"0 0 10 8",fill:"none",children:(0,s.jsx)("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,s.jsx)("span",{className:"text-sm select-none transition-colors ".concat(t?"text-green-700 font-medium":"text-gray-700"),onClick:()=>C(e.code),children:e.label})]},e.code)})})]}),(0,s.jsx)("button",{type:"submit",className:"w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:x("specialists.search.btn")}),w&&(0,s.jsx)("button",{type:"button",onClick:()=>{f(""),k(""),j([]),g.push("/specialists")},className:"w-full border border-gray-200 text-gray-500 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 hover:text-gray-700 transition-colors",children:V})]})}},3932:(e,t,l)=>{"use strict";l.d(t,{FavoriteSpecialistButton:()=>o});var s=l(4568),a=l(7620),r=l(1592),n=l(2982);function o(e){let{specialistId:t,initialFavorite:l=!1,favoriteLabel:o,unfavoriteLabel:i}=e,{data:c}=(0,r.wV)(),[d,u]=(0,a.useState)(l),[h,b]=(0,a.useState)(!1);if(!c)return null;async function g(e){e.preventDefault(),e.stopPropagation(),b(!0);try{d?(await (0,n.sD)(t),u(!1)):(await (0,n.V)(t),u(!0))}catch(e){}b(!1)}return(0,s.jsx)("button",{onClick:g,disabled:h,title:d?i:o,className:"absolute top-3 right-3 w-8 h-8 flex items-center justify-center rounded-full text-base transition disabled:opacity-50 ".concat(d?"bg-pink-50 text-pink-500 hover:bg-pink-100":"bg-gray-50 text-gray-300 hover:text-pink-400 hover:bg-pink-50"),children:d?"❤️":"\uD83E\uDD0D"})}},4736:(e,t,l)=>{Promise.resolve().then(l.bind(l,3932)),Promise.resolve().then(l.bind(l,2773)),Promise.resolve().then(l.t.bind(l,9664,23))}},e=>{e.O(0,[1516,9664,9906,2982,1530,587,18,7358],()=>e(e.s=4736)),_N_E=e.O()}]); 9(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6174],{2928:(e,r,t)=>{"use strict";t.d(r,{l:()=>f,$:()=>h});var n=t(4568),a=t(7620),o=(0,a.forwardRef)((e,r)=>{let{as:t="div",...a}=e;return(0,n.jsx)(t,{...a,ref:r})});let i="onloadTurnstileCallback",l=e=>!!document.getElementById(e),s={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",u,d=new Promise((e,r)=>{u={resolve:e,reject:r},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return"unloaded"===c&&(c="loading",window[e]=()=>{u.resolve(),c="ready",delete window[e]}),d},p=(0,a.forwardRef)((e,r)=>{let{scriptOptions:t,options:u={},siteKey:d,onWidgetLoad:p,onSuccess:x,onExpire:f,onError:h,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y,onLoadScript:w,id:j,style:E,as:N="div",injectScript:k=!0,rerenderOnCallbackChange:S=!1,...T}=e,C=u.size,I=(0,a.useCallback)(()=>void 0===C?{}:"execute"===u.execution?s.invisible:"interaction-only"===u.appearance?s.interactionOnly:s[C],[u.execution,C,u.appearance]),[A,P]=(0,a.useState)(I()),L=(0,a.useRef)(null),[R,O]=(0,a.useState)(!1),F=(0,a.useRef)(void 0),_=(0,a.useRef)(!1),B=j||"cf-turnstile",q=(0,a.useRef)({onSuccess:x,onError:h,onExpire:f,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y});(0,a.useEffect)(()=>{S||(q.current={onSuccess:x,onError:h,onExpire:f,onBeforeInteractive:g,onAfterInteractive:v,onUnsupported:b,onTimeout:y})});let D=(null==t?void 0:t.id)||"cf-turnstile-script",H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[r,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let r=()=>{l(e)&&t(!0)},n=new MutationObserver(r);return n.observe(document,{childList:!0,subtree:!0}),r(),()=>{n.disconnect()}},[e]),r}(D),W=(null==t?void 0:t.onLoadCallbackName)||"onloadTurnstileCallback",U=u.appearance||"always",z=(0,a.useMemo)(()=>{var e;return{sitekey:d,action:u.action,cData:u.cData,theme:u.theme||"auto",language:u.language||"auto",tabindex:u.tabIndex,"response-field":u.responseField,"response-field-name":u.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(C),retry:u.retry||"auto","retry-interval":u.retryInterval||8e3,"refresh-expired":u.refreshExpired||"auto","refresh-timeout":u.refreshTimeout||"auto",execution:u.execution||"render",appearance:u.appearance||"always","feedback-enabled":null==(e=u.feedbackEnabled)||e,callback:e=>{var r,t;_.current=!0,S?null==x||x(e):null==(r=(t=q.current).onSuccess)||r.call(t,e)},"error-callback":S?h:function(){for(var e,r,t=arguments.length,n=Array(t),a=0;a"u">typeof window&&!!window.turnstile,[]);return(0,a.useEffect)(function(){k&&!R&&(m(W),(e=>{let{render:r="explicit",onLoadCallbackName:t=i,scriptOptions:{nonce:n="",defer:a=!0,async:o=!0,id:s="",appendTo:c,onError:u,crossOrigin:d=""}={}}=e,m=s||"cf-turnstile-script";if(l(m))return;let p=document.createElement("script");p.id=m,p.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(t,"&render=").concat(r),document.querySelector('script[src="'.concat(p.src,'"]'))||(p.defer=!!a,p.async=!!o,n&&(p.nonce=n),d&&(p.crossOrigin=d),u&&(p.onerror=u,delete window[t]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(p))})({onLoadCallbackName:W,scriptOptions:{...t,id:D}}))},[k,R,t,D,W]),(0,a.useEffect)(function(){"ready"!==c&&m(W).then(()=>O(!0)).catch(console.error)},[W]),(0,a.useEffect)(function(){if(!L.current||!R)return;let e=!1;return(async()=>{e||!L.current||(F.current=window.turnstile.render(L.current,z),F.current&&(null==p||p(F.current)))})(),()=>{e=!0,F.current&&(window.turnstile.remove(F.current),_.current=!1)}},[B,R,z]),(0,a.useImperativeHandle)(r,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&F.current&&M()?e.getResponse(F.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((t,n)=>{let a,o=async()=>{if(_.current&&window.turnstile&&F.current)try{let e=window.turnstile.getResponse(F.current);return a&&clearTimeout(a),e?t(e):n(Error("No response received"))}catch(e){return a&&clearTimeout(a),console.warn("Failed to get response",e),n(Error("Failed to get response"))}a||(a=setTimeout(()=>{a&&clearTimeout(a),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,r)),await o()};o()})},reset(){if(!(null==e?void 0:e.reset)||!F.current||!M())return void console.warn("Turnstile has not been loaded");"execute"===u.execution&&P(s.invisible);try{_.current=!1,e.reset(F.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(F.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!F.current||!M())return void console.warn("Turnstile has not been loaded");P(s.invisible),_.current=!1,e.remove(F.current),F.current=null},render(){if(!(null==e?void 0:e.render)||!L.current||!M()||F.current)return void console.warn("Turnstile has not been loaded or container not found");let r=e.render(L.current,z);return F.current=r,F.current&&(null==p||p(F.current)),"execute"!==u.execution&&P(C?s[C]:{}),r},execute:()=>"execute"!==u.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&L.current&&F.current&&M()?void(e.execute(L.current,z),P(C?s[C]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&F.current&&M()?e.isExpired(F.current):(console.warn("Turnstile has not been loaded"),!1)}},[F,u.execution,C,z,L,M,R,p]),(0,a.useEffect)(()=>{if(R||!H)return;if(window.turnstile)return void O(!0);let e=setInterval(()=>{window.turnstile&&(O(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[R,H]),(0,a.useEffect)(()=>{P(I())},[u.execution,C,U]),(0,a.useEffect)(()=>{H&&"function"==typeof w&&w()},[H]),(0,n.jsx)(o,{ref:L,as:N,id:B,style:{...A,...E},...T})});p.displayName="Turnstile";let x="0x4AAAAAAC_FtTQJ0_6Cp9-9",f=!!x;function h(e){let{onSuccess:r,onError:t,onExpire:a}=e;return x?(0,n.jsx)(p,{siteKey:x,onSuccess:r,onError:t,onExpire:a,options:{theme:"light",language:"auto"}}):null}},5739:(e,r,t)=>{Promise.resolve().then(t.bind(t,9633))},7541:(e,r,t)=>{"use strict";var n=t(3041);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},9633:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>m});var n=t(4568),a=t(7620),o=t(9664),i=t.n(o),l=t(9906),s=t(2928),c=t(2982);let u="info@canhelp.gr",d={el:{title:"Υποστήριξη CanHelp",intro:"Αν χρειάζεστε βοήθεια με την εφαρμογή, στείλτε μας email ή χρησιμοποιήστε τη φόρμα επικοινωνίας μέσα στην εφαρμογή.",points:["Περιγράψτε σύντομα το πρόβλημα και, αν γίνεται, επισυνάψτε στιγμιότυπο οθόνης.","Αν το ζήτημα αφορά σύνδεση, αναφέρετε τη συσκευή και την έκδοση της εφαρμογής.","Απαντάμε συνήθως μέσα σε 1-2 εργάσιμες ημέρες."]},en:{title:"CanHelp Support",intro:"If you need help with the app, email us or use the in-app contact form.",points:["Briefly describe the issue and attach a screenshot if possible.","If it is a login problem, include your device and app version.","We usually reply within 1-2 business days."]},ru:{title:"Поддержка CanHelp",intro:"Если вам нужна помощь с приложением, напишите нам на email или используйте форму связи в приложении.",points:["Кратко опишите проблему и, если возможно, приложите скриншот.","Если проблема со входом, укажите устройство и версию приложения.","Обычно мы отвечаем в течение 1-2 рабочих дней."]},uk:{title:"Підтримка CanHelp",intro:"Якщо вам потрібна допомога з додатком, напишіть нам на email або скористайтеся формою зв’язку в додатку.",points:["Коротко опишіть проблему та, якщо можливо, додайте скріншот.","Якщо проблема зі входом, вкажіть пристрій і версію додатка.","Зазвичай ми відповідаємо протягом 1-2 робочих днів."]}};function m(){var e;let{locale:r,t}=(0,l.Y)(),o=null!=(e=d[r])?e:d.en,[m,p]=(0,a.useState)(""),[x,f]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[v,b]=(0,a.useState)(""),[y,w]=(0,a.useState)(s.l?"":"dev"),[j,E]=(0,a.useState)(!1),[N,k]=(0,a.useState)(!1),[S,T]=(0,a.useState)("");async function C(e){e.preventDefault(),T(""),E(!0);try{await (0,c.O8)({name:m.trim(),email:x.trim(),subject:h.trim(),body:v.trim(),captchaToken:y}),k(!0)}catch(e){((null==e?void 0:e.message)||"").toLowerCase().includes("captcha")?(T("Security check failed. Please try again."),w("")):T("Failed to send message. Please try again.")}finally{E(!1)}}return(0,n.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,n.jsxs)("div",{className:"max-w-3xl mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,n.jsx)("div",{className:"mb-6",children:(0,n.jsxs)(i(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",t("nav.home")]})}),(0,n.jsx)("h1",{className:"text-3xl font-extrabold text-gray-900 mb-3",children:o.title}),(0,n.jsx)("p",{className:"text-gray-600 leading-relaxed",children:o.intro}),(0,n.jsx)("div",{className:"mt-8 space-y-3",children:o.points.map(e=>(0,n.jsxs)("div",{className:"flex gap-3 items-start rounded-xl border border-gray-100 bg-gray-50 px-4 py-3 text-sm text-gray-700",children:[(0,n.jsx)("span",{className:"mt-0.5 h-2 w-2 rounded-full bg-green-500 shrink-0"}),(0,n.jsx)("span",{children:e})]},e))}),(0,n.jsxs)("div",{className:"mt-8 flex flex-col sm:flex-row gap-3 sm:items-center",children:[(0,n.jsx)("a",{href:"mailto:".concat(u),className:"inline-flex items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 transition",children:u}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:t("nav.privacy")})]}),(0,n.jsxs)("form",{onSubmit:C,className:"mt-10 space-y-4 rounded-2xl border border-gray-100 bg-gray-50 p-5 sm:p-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-xl font-semibold text-gray-900 mb-1",children:"Send a message to support"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"We will forward it directly to the admin team."})]}),(0,n.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name"}),(0,n.jsx)("input",{value:m,onChange:e=>p(e.target.value),required:!0,minLength:2,maxLength:100,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"Your name"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,n.jsx)("input",{type:"email",value:x,onChange:e=>f(e.target.value),required:!0,maxLength:200,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"name@example.com"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Subject"}),(0,n.jsx)("input",{value:h,onChange:e=>g(e.target.value),required:!0,minLength:3,maxLength:200,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"What do you need help with?"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message"}),(0,n.jsx)("textarea",{value:v,onChange:e=>b(e.target.value),required:!0,minLength:10,maxLength:5e3,rows:6,className:"w-full rounded-xl border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 resize-none",placeholder:"Describe the problem in detail"})]}),(0,n.jsx)("div",{children:(0,n.jsx)(s.$,{onSuccess:w,onError:()=>w(""),onExpire:()=>w("")})}),S&&(0,n.jsx)("p",{className:"text-sm text-red-600",children:S}),N?(0,n.jsx)("div",{className:"rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-800",children:"Your message has been sent."}):(0,n.jsx)("button",{type:"submit",disabled:j||s.l&&!y,className:"inline-flex w-full items-center justify-center rounded-xl bg-green-600 px-5 py-3 text-sm font-medium text-white hover:bg-green-700 disabled:opacity-50",children:j?"Sending...":"Send message"})]})]})})}}},e=>{e.O(0,[9664,9906,2982,587,18,7358],()=>e(e.s=5739)),_N_E=e.O()}]); g(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9478],{1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>l})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>s,Jv:()=>l,wV:()=>i,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:a,signUp:s,useSession:i}=n},2928:(e,t,r)=>{"use strict";r.d(t,{l:()=>f,$:()=>p});var n=r(4568),l=r(7620),a=(0,l.forwardRef)((e,t)=>{let{as:r="div",...l}=e;return(0,n.jsx)(r,{...l,ref:t})});let s="onloadTurnstileCallback",i=e=>!!document.getElementById(e),o={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}},c="unloaded",d,u=new Promise((e,t)=>{d={resolve:e,reject:t},"ready"===c&&e(void 0)}),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return"unloaded"===c&&(c="loading",window[e]=()=>{d.resolve(),c="ready",delete window[e]}),u},x=(0,l.forwardRef)((e,t)=>{let{scriptOptions:r,options:d={},siteKey:u,onWidgetLoad:x,onSuccess:g,onExpire:f,onError:p,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y,onLoadScript:w,id:j,style:N,as:k="div",injectScript:S=!0,rerenderOnCallbackChange:E=!1,...C}=e,D=d.size,T=(0,l.useCallback)(()=>void 0===D?{}:"execute"===d.execution?o.invisible:"interaction-only"===d.appearance?o.interactionOnly:o[D],[d.execution,D,d.appearance]),[_,I]=(0,l.useState)(T()),A=(0,l.useRef)(null),[L,R]=(0,l.useState)(!1),U=(0,l.useRef)(void 0),O=(0,l.useRef)(!1),F=j||"cf-turnstile",P=(0,l.useRef)({onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y});(0,l.useEffect)(()=>{E||(P.current={onSuccess:g,onError:p,onExpire:f,onBeforeInteractive:h,onAfterInteractive:b,onUnsupported:v,onTimeout:y})});let M=(null==r?void 0:r.id)||"cf-turnstile-script",z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cf-turnstile-script",[t,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let t=()=>{i(e)&&r(!0)},n=new MutationObserver(t);return n.observe(document,{childList:!0,subtree:!0}),t(),()=>{n.disconnect()}},[e]),t}(M),B=(null==r?void 0:r.onLoadCallbackName)||"onloadTurnstileCallback",V=d.appearance||"always",H=(0,l.useMemo)(()=>{var e;return{sitekey:u,action:d.action,cData:d.cData,theme:d.theme||"auto",language:d.language||"auto",tabindex:d.tabIndex,"response-field":d.responseField,"response-field-name":d.responseFieldName,size:function(e){if("invisible"!==e&&"interactionOnly"!==e)return e}(D),retry:d.retry||"auto","retry-interval":d.retryInterval||8e3,"refresh-expired":d.refreshExpired||"auto","refresh-timeout":d.refreshTimeout||"auto",execution:d.execution||"render",appearance:d.appearance||"always","feedback-enabled":null==(e=d.feedbackEnabled)||e,callback:e=>{var t,r;O.current=!0,E?null==g||g(e):null==(t=(r=P.current).onSuccess)||t.call(r,e)},"error-callback":E?p:function(){for(var e,t,r=arguments.length,n=Array(r),l=0;l"u">typeof window&&!!window.turnstile,[]);return(0,l.useEffect)(function(){S&&!L&&(m(B),(e=>{let{render:t="explicit",onLoadCallbackName:r=s,scriptOptions:{nonce:n="",defer:l=!0,async:a=!0,id:o="",appendTo:c,onError:d,crossOrigin:u=""}={}}=e,m=o||"cf-turnstile-script";if(i(m))return;let x=document.createElement("script");x.id=m,x.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(r,"&render=").concat(t),document.querySelector('script[src="'.concat(x.src,'"]'))||(x.defer=!!l,x.async=!!a,n&&(x.nonce=n),u&&(x.crossOrigin=u),d&&(x.onerror=d,delete window[r]),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(x))})({onLoadCallbackName:B,scriptOptions:{...r,id:M}}))},[S,L,r,M,B]),(0,l.useEffect)(function(){"ready"!==c&&m(B).then(()=>R(!0)).catch(console.error)},[B]),(0,l.useEffect)(function(){if(!A.current||!L)return;let e=!1;return(async()=>{e||!A.current||(U.current=window.turnstile.render(A.current,H),U.current&&(null==x||x(U.current)))})(),()=>{e=!0,U.current&&(window.turnstile.remove(U.current),O.current=!1)}},[F,L,H]),(0,l.useImperativeHandle)(t,()=>{let{turnstile:e}=window;return{getResponse:()=>(null==e?void 0:e.getResponse)&&U.current&&W()?e.getResponse(U.current):void console.warn("Turnstile has not been loaded"),async getResponsePromise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((r,n)=>{let l,a=async()=>{if(O.current&&window.turnstile&&U.current)try{let e=window.turnstile.getResponse(U.current);return l&&clearTimeout(l),e?r(e):n(Error("No response received"))}catch(e){return l&&clearTimeout(l),console.warn("Failed to get response",e),n(Error("Failed to get response"))}l||(l=setTimeout(()=>{l&&clearTimeout(l),n(Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,t)),await a()};a()})},reset(){if(!(null==e?void 0:e.reset)||!U.current||!W())return void console.warn("Turnstile has not been loaded");"execute"===d.execution&&I(o.invisible);try{O.current=!1,e.reset(U.current)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(U.current),e)}},remove(){if(!(null==e?void 0:e.remove)||!U.current||!W())return void console.warn("Turnstile has not been loaded");I(o.invisible),O.current=!1,e.remove(U.current),U.current=null},render(){if(!(null==e?void 0:e.render)||!A.current||!W()||U.current)return void console.warn("Turnstile has not been loaded or container not found");let t=e.render(A.current,H);return U.current=t,U.current&&(null==x||x(U.current)),"execute"!==d.execution&&I(D?o[D]:{}),t},execute:()=>"execute"!==d.execution?void console.warn('Execution mode is not set to "execute"'):(null==e?void 0:e.execute)&&A.current&&U.current&&W()?void(e.execute(A.current,H),I(D?o[D]:{})):void console.warn("Turnstile has not been loaded or container not found"),isExpired:()=>(null==e?void 0:e.isExpired)&&U.current&&W()?e.isExpired(U.current):(console.warn("Turnstile has not been loaded"),!1)}},[U,d.execution,D,H,A,W,L,x]),(0,l.useEffect)(()=>{if(L||!z)return;if(window.turnstile)return void R(!0);let e=setInterval(()=>{window.turnstile&&(R(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[L,z]),(0,l.useEffect)(()=>{I(T())},[d.execution,D,V]),(0,l.useEffect)(()=>{z&&"function"==typeof w&&w()},[z]),(0,n.jsx)(a,{ref:A,as:k,id:F,style:{..._,...N},...C})});x.displayName="Turnstile";let g="0x4AAAAAAC_FtTQJ0_6Cp9-9",f=!!g;function p(e){let{onSuccess:t,onError:r,onExpire:l}=e;return g?(0,n.jsx)(x,{siteKey:g,onSuccess:t,onError:r,onExpire:l,options:{theme:"light",language:"auto"}}):null}},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>i,z:()=>o});var n=r(4568),l=r(7620),a=r(2982);let s=(0,l.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function i(e){let{children:t,initialSlug:r=""}=e,[i,o]=(0,l.useState)(r),[c,d]=(0,l.useState)([]),[u,m]=(0,l.useState)(!0);(0,l.useEffect)(()=>{o(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,l.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>m(!1))},[]);let x=(0,l.useCallback)(e=>{o(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),g=(0,l.useCallback)(e=>{if(!i)return"";for(let l of c){var t,r,n;if(l.slug===i)return null!=(t=l.names[e])?t:l.names.el;for(let t of null!=(r=l.children)?r:[])if(t.slug===i)return null!=(n=t.names[e])?n:t.names.el}return i},[i,c]);return(0,n.jsx)(s.Provider,{value:{locationSlug:i,locationTree:c,locationLoading:u,setLocation:x,getLabel:g},children:t})}function o(){return(0,l.useContext)(s)}},5338:(e,t,r)=>{"use strict";function n(e,t){if(!e)return"";let r=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(r<5)return t("user.online");if(r<60)return t("user.seen_minutes").replace("{n}",String(r));let n=Math.floor(r/60);if(n<24)return t("user.seen_hours").replace("{n}",String(n));let l=Math.floor(n/24);return 1===l?t("user.seen_yesterday"):t("user.seen_days").replace("{n}",String(l))}r.d(t,{V:()=>n})},6261:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(4568),l=r(7620),a=r(7541),s=r(9664),i=r.n(s),o=r(1592),c=r(9906),d=r(4029),u=r(2982),m=r(1258),x=r(5338),g=r(3119),f=r(2818),p=r(2928);let h="https://api.canhelp.gr",b=e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)};function v(){var e;let{data:t,isPending:r}=(0,o.wV)(),s=(0,a.useRouter)(),v=null!=(e=(0,a.useSearchParams)().get("category"))?e:"",{t:y,locale:w}=(0,c.Y)(),[j,N]=(0,l.useState)([]),[k,S]=(0,l.useState)([]),[E,C]=(0,l.useState)(!1),[D,T]=(0,l.useState)(""),[_,I]=(0,l.useState)([]),[A,L]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e)}),[R,U]=(0,l.useState)(30),[O,F]=(0,l.useState)(()=>{let e=new Date;return e.setDate(e.getDate()+1),b(e).slice(0,7)}),P=(0,l.useRef)(null),[M,z]=(0,l.useState)({}),[B,V]=(0,l.useState)(new Set),[H,W]=(0,l.useState)(p.l?"":"dev"),{locationSlug:q}=(0,d.z)(),[K,J]=(0,l.useState)(""),[Y,$]=(0,l.useState)(v);(0,l.useEffect)(()=>{q&&J(q)},[q]);let[G,Q]=(0,l.useState)([]),[X,Z]=(0,l.useState)(!1),ee=(0,l.useRef)(null);async function et(e){var t;let r=null==(t=e.target.files)?void 0:t[0];if(r){Z(!0);try{let e=new FormData;e.append("file",r);let t=await fetch("".concat(h,"/api/uploads"),{method:"POST",credentials:"include",body:e});if(!t.ok)throw Error("Upload failed");let{url:n}=await t.json();Q(e=>[...e,"".concat(h).concat(n)])}catch(e){T(y("profile.upload.error"))}finally{Z(!1),ee.current&&(ee.current.value="")}}}async function er(e){e.preventDefault(),T(""),C(!0);let t=new FormData(e.currentTarget),r={title:t.get("title"),description:t.get("description"),category:t.get("category")||void 0,location:t.get("location")||void 0,budget:t.get("budget")?Number(t.get("budget")):void 0,budgetNegotiable:"on"===t.get("budgetNegotiable"),deadline:t.get("deadline")?new Date(t.get("deadline")).toISOString():void 0,expiresAt:(()=>{let e=new Date;return e.setDate(e.getDate()+Number(t.get("expiresAtDays")||30)),e.toISOString()})(),timeSlot:t.get("timeSlot")||void 0,district:t.get("district")||void 0,street:t.get("street")||void 0,houseNumber:t.get("houseNumber")||void 0,confidentialNote:t.get("confidentialNote")||void 0,images:G.length>0?G:void 0,status:"open",locale:w,inviteSpecialistIds:B.size>0?[...B]:void 0};try{let e=await (0,u.UT)({...r,captchaToken:H});s.push("/tasks/".concat(e.id))}catch(e){T(e.message||y("create.error"))}finally{C(!1)}}if((0,l.useEffect)(()=>{r||t||s.push("/login"),(0,u.bW)().then(N).catch(()=>{}),(0,u.Vs)().then(S).catch(()=>{})},[t,r]),(0,l.useEffect)(()=>{if(!Y)return void I([]);(0,u.F7)({limit:"5",category:Y,locale:w}).then(e=>I(e.data)).catch(()=>{})},[Y,w]),(0,l.useEffect)(()=>{if(!A||0===_.length)return;let e=A.slice(0,7);Promise.all(_.map(e=>e.id).map(t=>fetch("".concat(h,"/api/availability/user/").concat(t,"?month=").concat(e),{credentials:"include"}).then(e=>e.ok?e.json():[]).then(e=>{var r;let n=e.find(e=>e.date===A);return{id:t,status:null!=(r=null==n?void 0:n.status)?r:null}}).catch(()=>({id:t,status:null})))).then(e=>{let t={};e.forEach(e=>{let{id:r,status:n}=e;t[r]=n}),z(t)})},[A,_]),r)return(0,n.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let en="en"===w?"en":"ru"===w?"ru":"uk"===w?"uk":"el",el="ru"===w?"ru-RU":"uk"===w?"uk-UA":"en"===w?"en-US":"el-GR",ea=new Date;ea.setHours(0,0,0,0);let[es,ei]=O.split("-").map(Number),eo=new Date(es,ei,0).getDate(),ec=[];for(let e=1;e<=eo;e++){let t=new Date(es,ei-1,e);t>=ea&&ec.push(t)}let ed=Array.from({length:12},(e,t)=>{let r=new Date;return r.setDate(1),r.setMonth(r.getMonth()+t),{value:b(r).slice(0,7),label:r.toLocaleDateString(el,{month:"long",year:"numeric"})}}),eu=y("tasks.new.top_specialists");return(0,n.jsxs)("div",{className:"max-w-5xl mx-auto px-3 sm:px-4 py-6 sm:py-8",children:[(0,n.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-white mb-4 sm:mb-6",children:y("create.title")}),(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-6 lg:gap-8 items-start",children:[(0,n.jsx)("div",{className:"flex-1 min-w-0 w-full",children:(0,n.jsxs)("form",{onSubmit:er,className:"bg-white rounded-xl border border-gray-200 p-4 sm:p-6 space-y-4 sm:space-y-5",children:[D&&(0,n.jsx)("div",{className:"bg-red-50 text-red-700 p-3 rounded-lg text-sm",children:D}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.category")}),(0,n.jsx)(f.W,{categories:j,locale:en,value:Y,onChange:$,placeholder:y("create.field.category.select")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.location")}),(0,n.jsx)(g.V,{locations:k,value:K,onChange:J,anyLabel:y("create.field.location.any"),allLabel:y("create.field.location.all")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.title")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("input",{name:"title",required:!0,minLength:5,maxLength:200,placeholder:y("create.field.title.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[y("create.field.description")," ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)("textarea",{name:"description",required:!0,minLength:20,rows:4,placeholder:y("create.field.description.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.budget")}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"budget",type:"number",min:1,step:1,placeholder:y("create.field.budget.placeholder"),className:"w-full sm:flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,n.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,n.jsx)("input",{type:"checkbox",name:"budgetNegotiable",className:"w-4 h-4 rounded border-gray-300 text-green-600"}),(0,n.jsx)("span",{className:"text-sm text-gray-700",children:y("create.field.budget_negotiable")})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700 shrink-0",children:y("create.field.deadline")}),(0,n.jsx)("select",{value:O,onChange:e=>F(e.target.value),className:"flex-1 border border-gray-300 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:ed.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,n.jsx)("button",{type:"button",title:"Открыть календарь",onClick:()=>{var e,t;try{null==(e=P.current)||e.showPicker()}catch(e){null==(t=P.current)||t.click()}},className:"shrink-0 w-8 h-8 flex items-center justify-center rounded-lg border border-gray-300 text-gray-500 hover:border-green-400 hover:text-green-600 transition",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,n.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,n.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,n.jsx)("input",{ref:P,type:"date",min:b(ea),value:A,onChange:e=>{e.target.value&&(L(e.target.value),F(e.target.value.slice(0,7)))},className:"absolute w-0 h-0 opacity-0 pointer-events-none"})]}),(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 snap-x snap-mandatory",children:ec.map(e=>{let t=b(e),r=A===t,l=e.toLocaleDateString(el,{weekday:"short"}),a=e.getDate();return(0,n.jsxs)("button",{type:"button",onClick:()=>L(t),className:"flex-shrink-0 snap-start flex flex-col items-center justify-center w-14 h-16 rounded-xl border-2 transition select-none ".concat(r?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300 hover:bg-gray-50"),children:[(0,n.jsx)("span",{className:"text-xs font-medium uppercase leading-none mb-0.5",children:l}),(0,n.jsx)("span",{className:"text-xl font-bold leading-none",children:a})]},t)})}),(0,n.jsx)("input",{type:"hidden",name:"deadline",value:A})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.expires_at")}),(0,n.jsx)("div",{className:"flex gap-2",children:[7,14,30,60].map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>U(e),className:"flex-1 py-2 rounded-lg border-2 text-sm font-medium transition select-none ".concat(R===e?"border-green-500 bg-green-50 text-green-700":"border-gray-200 bg-white text-gray-700 hover:border-green-300"),children:[e," ",y("create.field.expires_at.days").replace("{n}","")]},e))}),(0,n.jsx)("input",{type:"hidden",name:"expiresAtDays",value:R})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.time_slot")}),(0,n.jsxs)("select",{name:"timeSlot",className:"w-full border border-gray-300 rounded-lg px-3 py-2",children:[(0,n.jsx)("option",{value:"",children:y("create.field.time_slot.any")}),(0,n.jsx)("option",{value:"morning",children:y("create.field.time_slot.morning")}),(0,n.jsx)("option",{value:"afternoon",children:y("create.field.time_slot.afternoon")}),(0,n.jsx)("option",{value:"evening",children:y("create.field.time_slot.evening")}),(0,n.jsx)("option",{value:"weekend",children:y("create.field.time_slot.weekend")})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.photos")}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mb-2",children:[G.map((e,t)=>(0,n.jsxs)("div",{className:"relative w-20 h-20 rounded-lg overflow-hidden border border-gray-200",children:[(0,n.jsx)("img",{src:e,alt:"",className:"w-full h-full object-cover"}),(0,n.jsx)("button",{type:"button",onClick:()=>Q(e=>e.filter((e,r)=>r!==t)),className:"absolute top-0.5 right-0.5 bg-black/50 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-black/70",children:"\xd7"})]},t)),G.length<5&&(0,n.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=ee.current)?void 0:e.click()},disabled:X,className:"w-20 h-20 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400 hover:border-green-400 hover:text-gray-400 text-xs disabled:opacity-50",children:X?"...":(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-2xl leading-none",children:"+"}),(0,n.jsx)("span",{children:y("create.field.photos.add")})]})})]}),(0,n.jsx)("input",{ref:ee,type:"file",accept:"image/*",className:"hidden",onChange:et})]}),(0,n.jsxs)("div",{className:"space-y-3 p-3 bg-yellow-50 border border-yellow-200 rounded-xl",children:[(0,n.jsxs)("p",{className:"text-xs font-medium text-yellow-700 flex items-center gap-1",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"\uD83D\uDD12 ",y("create.field.confidential.hint")]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:y("create.field.address")}),(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3",children:[(0,n.jsx)("input",{name:"district",placeholder:y("create.field.address.district"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"street",placeholder:y("create.field.address.street"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"}),(0,n.jsx)("input",{name:"houseNumber",placeholder:y("create.field.address.house"),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 bg-white"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:y("create.field.confidential")}),(0,n.jsx)("textarea",{name:"confidentialNote",rows:2,placeholder:y("create.field.confidential.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none bg-white"})]})]}),(0,n.jsx)(p.$,{onSuccess:W,onError:()=>W(""),onExpire:()=>W("")}),(0,n.jsx)("button",{type:"submit",disabled:E||!H,className:"w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:E?y("create.submitting"):y("create.submit")})]})}),(0,n.jsx)("aside",{className:"hidden lg:block lg:w-64 shrink-0",children:(0,n.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5 sticky top-24",children:[(0,n.jsx)("h3",{className:"font-semibold text-gray-900 mb-4 text-sm",children:eu}),Y?0===_.length?(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("specialists.empty")}):(0,n.jsx)("div",{className:"space-y-3",children:_.map(e=>{var t,r,l,a,s,o;let c=(0,m.H)(e.firstName,e.lastName,e.name),d="".concat(null!=(s=null==(t=e.firstName)?void 0:t[0])?s:"").concat(null!=(o=null==(r=e.lastName)?void 0:r[0])?o:"").toUpperCase()||(null==(a=e.name)||null==(l=a[0])?void 0:l.toUpperCase())||"?",u=(0,x.V)(e.lastSeenAt,y),g=M[e.id],f=B.has(e.id);return(0,n.jsxs)("div",{className:"rounded-lg border border-gray-100 hover:bg-gray-50 transition",children:[(0,n.jsxs)(i(),{href:"/users/".concat(e.id),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-2",children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold text-sm overflow-hidden border border-gray-100",children:e.image?(0,n.jsx)("img",{src:e.image,alt:c,className:"w-full h-full object-cover"}):d}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:c}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.rating?(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["★ ",Number(e.rating).toFixed(1)]}):u?(0,n.jsx)("p",{className:"text-xs text-gray-400",children:u}):null,"number"==typeof e.reviewCount&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-gray-400",children:[e.reviewCount," ",y("reviews.count")]}),"number"==typeof e.positivePercent&&e.reviewCount>0&&(0,n.jsxs)("p",{className:"text-xs text-green-600",children:[e.positivePercent,"% \uD83D\uDC4D"]}),"available"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-green-700 bg-green-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 inline-block"}),y("schedule.available")]}),"busy"===g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs font-medium text-red-700 bg-red-100 px-1.5 py-0.5 rounded-full",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 inline-block"}),y("schedule.busy")]})]})]})]}),(0,n.jsx)("div",{className:"px-2 pb-2",children:(0,n.jsx)("button",{type:"button",onClick:()=>V(t=>{let r=new Set(t);return r.has(e.id)?r.delete(e.id):r.add(e.id),r}),className:"w-full text-xs font-medium py-1 rounded-lg transition ".concat(f?"bg-green-600 text-white hover:bg-green-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:f?y("tasks.new.invited"):y("tasks.new.invite")})})]},e.id)})}):(0,n.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:y("tasks.new.select_category")})]})})]})]})}},7029:(e,t,r)=>{Promise.resolve().then(r.bind(r,6261))}},e=>{e.O(0,[1516,9664,9906,2982,1530,587,18,7358],()=>e(e.s=7029)),_N_E=e.O()}]); ,(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2822],{1258:(e,t,s)=>{"use strict";function l(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 l(s)}s.d(t,{E:()=>l,H:()=>n})},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>r,Hh:()=>a,Jv:()=>n,wV:()=>i,yK:()=>l});let l=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:r,signUp:a,useSession:i}=l},3899:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var l=s(4568),n=s(7620),r=s(7541),a=s(9664),i=s.n(a),o=s(1592),c=s(9906),d=s(2982),u=s(1258),m=s(4017);function x(){var e,t,s;let{id:a}=(0,r.useParams)(),x=(0,r.useRouter)(),{data:g,isPending:h}=(0,o.wV)(),{t:p,locale:f}=(0,c.Y)(),[b,y]=(0,n.useState)(null),[j,v]=(0,n.useState)(!0),[N,w]=(0,n.useState)([]),[k,E]=(0,n.useState)(!1),[D,C]=(0,n.useState)(""),_=N.reduce((e,t)=>{var s,l,n,r,a,i,o,c,d;for(let u of(e[t.slug]=null!=(r=null!=(n=null==(s=t.names)?void 0:s[f])?n:null==(l=t.names)?void 0:l.el)?r:t.slug,null!=(a=t.children)?a:[]))e[u.slug]=null!=(d=null!=(c=null==(i=u.names)?void 0:i[f])?c:null==(o=u.names)?void 0:o.el)?d:u.slug;return e},{});async function S(e){e.preventDefault(),C(""),E(!0);let t=new FormData(e.currentTarget);try{await (0,d.ts)({taskId:a,price:Number(t.get("price")),message:t.get("message")||void 0}),x.push("/tasks/".concat(a))}catch(e){C(e.message||p("common.error"))}finally{E(!1)}}if((0,n.useEffect)(()=>{h||g||x.push("/login")},[g,h]),(0,n.useEffect)(()=>{a&&((0,d.gg)(a).then(e=>y(e)).catch(()=>x.push("/tasks/".concat(a))).finally(()=>v(!1)),(0,d.Vs)().then(e=>w(e)).catch(()=>{}))},[a]),h||j)return(0,l.jsx)("div",{className:"text-center py-20 text-white",children:p("common.loading")});let R=null!=(e=null==b?void 0:b.task)?e:b,L=null==b?void 0:b.customer,O=(null==L?void 0:L.name)?(0,u.E)(L.name):null;return(0,l.jsxs)("div",{className:"max-w-xl mx-auto px-4 py-10",children:[(0,l.jsxs)(i(),{href:"/tasks/".concat(a),className:"inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),null!=(t=null==R?void 0:R.title)?t:p("common.back")]}),(0,l.jsx)("h1",{className:"text-2xl font-bold text-white mb-1",children:p("task.offer.btn")}),O&&(0,l.jsxs)("p",{className:"text-sm text-white/60 mb-6",children:[p("common.from")," ",O]}),R&&(0,l.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm",children:[(0,l.jsx)("p",{className:"font-semibold text-gray-900 text-sm line-clamp-2",children:(0,m.Oj)(R,f)}),(0,m.GZ)(R,f)&&(0,l.jsx)("p",{className:"text-gray-500 text-xs mt-1 line-clamp-2",children:(0,m.GZ)(R,f)}),(0,l.jsxs)("div",{className:"flex items-center gap-4 mt-2",children:[R.budget&&(0,l.jsxs)("span",{className:"text-xs text-gray-500",children:["\uD83D\uDCB0 ",p("task.budget"),": ",(0,l.jsxs)("strong",{className:"text-gray-900",children:[(0,m.$g)(R.budget),"€"]})]}),R.budgetNegotiable&&!R.budget&&(0,l.jsxs)("span",{className:"text-xs text-gray-500",children:["\uD83D\uDCAC ",p("task.budget_negotiable")]}),R.location&&(0,l.jsxs)("span",{className:"text-xs text-gray-500",children:["\uD83D\uDCCD ",null!=(s=_[R.location])?s:R.location]})]})]}),(0,l.jsxs)("form",{onSubmit:S,className:"bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5",children:[D&&(0,l.jsx)("div",{className:"bg-red-50 text-red-700 p-3 rounded-lg text-sm",children:D}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:[p("offer.price")," (€) ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none",children:"€"}),(0,l.jsx)("input",{name:"price",type:"number",required:!0,min:1,step:1,placeholder:p("offer.price.placeholder"),className:"w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900"})]}),(null==R?void 0:R.budget)&&(0,l.jsxs)("p",{className:"text-xs text-gray-400 mt-1.5",children:[p("offer.customer_budget"),": ",(0,l.jsxs)("strong",{children:[(0,m.$g)(R.budget),"€"]})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:[p("offer.message"),(0,l.jsxs)("span",{className:"text-gray-400 font-normal ml-1",children:["(",p("offer.optional"),")"]})]}),(0,l.jsx)("textarea",{name:"message",rows:5,maxLength:2e3,placeholder:p("offer.message.placeholder"),className:"w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700"})]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-1",children:[(0,l.jsx)("button",{type:"submit",disabled:k,className:"flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition",children:k?p("offer.submitting"):p("task.offer.btn")}),(0,l.jsx)(i(),{href:"/tasks/".concat(a),className:"px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition",children:p("common.cancel")})]})]})]})}},4017:(e,t,s)=>{"use strict";function l(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 r(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:()=>r,Oj:()=>l})},6763:(e,t,s)=>{Promise.resolve().then(s.bind(s,3899))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=6763)),_N_E=e.O()}]); (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[488],{409:(e,t,s)=>{Promise.resolve().then(s.bind(s,6235))},1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>a,Hh:()=>i,Jv:()=>l,wV:()=>n,yK:()=>r});let r=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:a,signUp:i,useSession:n}=r},2035:(e,t,s)=>{"use strict";s.d(t,{d:()=>a});var r=s(4568);let l={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,r.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,r.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,r.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,r.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function a(e){let{tier:t,verified:s,size:a="sm",className:o=""}=e;if("free"===t&&!s)return null;let c="sm"===a?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(s&&"free"!==t)return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(c," ").concat(l[t].class," ").concat(o),children:["ultimate"===t?(0,r.jsx)(i,{className:"w-3 h-3 fill-gray-900"}):(0,r.jsx)(n,{className:"w-3 h-3"}),l[t].label]});if(s)return(0,r.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(c," bg-green-100 text-green-700 border border-green-200 ").concat(o),children:(0,r.jsx)(n,{className:"w-3 h-3"})});let d=l[t];return(0,r.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(c," ").concat(d.class," ").concat(o),children:["pro"===t&&(0,r.jsx)(i,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===t&&(0,r.jsx)(i,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),d.label]})}function i(e){let{className:t=""}=e;return(0,r.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:(0,r.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function n(e){let{className:t=""}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:[(0,r.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,r.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},6235:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var r=s(4568),l=s(7620),a=s(7541),i=s(9906),n=s(1592),o=s(2982),c=s(2035);function d(){var e,t,s,d,x,m,u,h,p,g,v,b,f,j,y,N;let{slug:k}=(0,a.useParams)(),{t:w,locale:L,setLocale:C}=(0,i.Y)(),{data:M}=(0,n.wV)();(0,a.useRouter)();let[_,z]=(0,l.useState)(null),[B,S]=(0,l.useState)(!0),[A,W]=(0,l.useState)(!1),[E,U]=(0,l.useState)(!1),[V,F]=(0,l.useState)(!1),[P,T]=(0,l.useState)(null),[H,D]=(0,l.useState)(!1),[I,O]=(0,l.useState)({name:"",email:"",message:""}),[R,q]=(0,l.useState)(!1),[Y,J]=(0,l.useState)(!1),[G,K]=(0,l.useState)(!1),[Q,$]=(0,l.useState)(!1),[X,Z]=(0,l.useState)(""),[ee,et]=(0,l.useState)(!1),[es,er]=(0,l.useState)({}),[el,ea]=(0,l.useState)({}),[ei,en]=(0,l.useState)({}),[eo,ec]=(0,l.useState)({}),[ed,ex]=(0,l.useState)(!1),em="ru"===L?"ru-RU":"uk"===L?"uk-UA":"en"===L?"en-US":"el-GR";(0,l.useEffect)(()=>{let e=()=>ex(window.scrollY>100);return window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);let eu={el:{flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"Ελληνικά"},en:{flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"English"},ru:{flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"Русский"},uk:{flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"Українська"},de:{flag:"\uD83C\uDDE9\uD83C\uDDEA",label:"Deutsch"},fr:{flag:"\uD83C\uDDEB\uD83C\uDDF7",label:"Fran\xe7ais"},it:{flag:"\uD83C\uDDEE\uD83C\uDDF9",label:"Italiano"},es:{flag:"\uD83C\uDDEA\uD83C\uDDF8",label:"Espa\xf1ol"},ar:{flag:"\uD83C\uDDF8\uD83C\uDDE6",label:"العربية"},zh:{flag:"\uD83C\uDDE8\uD83C\uDDF3",label:"中文"}},eh=[{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"Ελληνικά"},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"English"},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"Русский"}];async function ep(e){if(e.preventDefault(),X.trim()){U(!0);try{let{room:e}=await (0,o.QN)(_.id);await (0,o._z)(e.id,X.trim()),(0,o.UE)(k),et(!0),Z("")}catch(e){}finally{U(!1)}}}(0,l.useEffect)(()=>{k&&(0,o.S$)(k).then(z).catch(()=>W(!0)).finally(()=>S(!1))},[k]),(0,l.useEffect)(()=>{var e;let t=(null==_||null==(e=_.siteSettings)?void 0:e.showPriceList)!==!1,s=Array.isArray(null==_?void 0:_.cards)?_.cards:[];if(!_||!t||0===s.length)return void ec({});let r=!1;return Promise.all(s.map(async e=>[e.id,await (0,o.Ck)(e.id,L)])).then(e=>{r||ec(Object.fromEntries(e.filter(e=>{let[,t]=e;return t.length>0})))}).catch(()=>{r||ec({})}),()=>{r=!0}},[_,L]),(0,l.useEffect)(()=>{(0,o.bW)().then(e=>{let t={};for(let a of e){var s,r,l;for(let e of(t[a.slug]=null!=(s=a.names[L])?s:a.names.el,null!=(r=a.children)?r:[]))t[e.slug]=null!=(l=e.names[L])?l:e.names.el}er(t)}).catch(()=>{}),(0,o.Vs)().then(e=>{let t={},s={};for(let m of e){var r,l,a,i,n,o,c,d,x;let e=null!=(i=null!=(a=null==(r=m.names)?void 0:r[L])?a:null==(l=m.names)?void 0:l.el)?i:m.slug;for(let r of(t[m.slug]=e,null!=(n=m.children)?n:[]))t[r.slug]=null!=(x=null!=(d=null==(o=r.names)?void 0:o[L])?d:null==(c=r.names)?void 0:c.el)?x:r.slug,s[r.slug]=e}ea(t),en(s)}).catch(()=>{})},[L]);let eg=(0,l.useCallback)(async e=>{if(e.preventDefault(),I.name.trim()&&I.message.trim()){q(!0);try{await (0,o.Em)("/users/site/".concat(k,"/contact"),{method:"POST",body:JSON.stringify(I)}),D(!0),O({name:"",email:"",message:""})}catch(e){}finally{q(!1)}}},[I,k]);if((0,l.useEffect)(()=>{if(null===P)return;let e=e=>{"Escape"===e.key&&T(null),"ArrowRight"===e.key&&T(e=>{var t,s;return null!==e?Math.min(e+1,(null!=(s=null==_||null==(t=_.portfolio)?void 0:t.length)?s:1)-1):null}),"ArrowLeft"===e.key&&T(e=>null!==e?Math.max(e-1,0):null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[P,null==_||null==(e=_.portfolio)?void 0:e.length]),B)return(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--site-bg)"},children:(0,r.jsxs)("div",{className:"relative w-12 h-12",children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border-2 border-green-500/20"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin"})]})});if(A||!_)return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col items-center justify-center gap-6",style:{background:"var(--site-bg)"},children:[(0,r.jsx)("div",{className:"w-20 h-20 rounded-full flex items-center justify-center",style:{background:"var(--site-surface)"},children:(0,r.jsx)("svg",{className:"w-10 h-10 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z"})})}),(0,r.jsx)("p",{className:"text-gray-400 text-lg",children:w("common.not_found","Страница не найдена")}),(0,r.jsx)("a",{href:"/",className:"text-gray-400 hover:text-gray-300 text-sm transition",children:w("nav.home","На главную")})]});let ev="".concat(null!=(b=null==(t=_.firstName)?void 0:t[0])?b:"").concat(null!=(f=null==(s=_.lastName)?void 0:s[0])?f:"").toUpperCase()||(null==(x=_.name)||null==(d=x[0])?void 0:d.toUpperCase())||"?",eb=[_.firstName,_.lastName].filter(Boolean).join(" ")||_.name||"",ef=_.memberSince?new Date(_.memberSince).getFullYear():null,ej=_.completedTasks>0||_.rating||_.reviewCount&&_.reviewCount>0,ey=(null==(m=_.siteSettings)?void 0:m.siteTheme)==="light",eN=(null==(u=_.siteSettings)?void 0:u.showServices)!==!1,ek=(null==(h=_.siteSettings)?void 0:h.showPriceList)!==!1;return(0,r.jsxs)("div",{className:"site-theme min-h-screen selection:bg-green-500/30 ".concat(ey?"site-light":""),style:{background:"var(--site-bg)",color:"var(--site-text)"},children:[null!==P&&(null==(p=_.portfolio)?void 0:p[P])&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4",onClick:()=>T(null),children:[(0,r.jsx)("button",{onClick:()=>T(null),className:"absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),P>0&&(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),T(P-1)},className:"absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),P<(null!=(j=null==(g=_.portfolio)?void 0:g.length)?j:1)-1&&(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),T(P+1)},className:"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}),(0,r.jsx)("img",{src:_.portfolio[P].imageUrl,alt:null!=(y=_.portfolio[P].title)?y:"",className:"max-w-full max-h-[85vh] rounded-2xl object-contain",onClick:e=>e.stopPropagation()}),_.portfolio[P].title&&(0,r.jsx)("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm",children:_.portfolio[P].title})]}),Q&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>$(!1),children:(0,r.jsxs)("div",{className:"relative w-full max-w-sm rounded-2xl shadow-2xl p-6",style:{background:"var(--site-modal-bg)",border:"1px solid var(--site-border)"},onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("button",{type:"button",onClick:()=>$(!1),className:"absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition",style:{background:"var(--site-surface)",color:"var(--site-text-muted)"},children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,r.jsx)("h3",{className:"text-base font-semibold mb-2",style:{color:"var(--site-text)"},children:w("site.auth_required_title","Нужна авторизация")}),(0,r.jsx)("p",{className:"text-sm mb-5",style:{color:"var(--site-text-muted)"},children:w("site.auth_required_desc","Чтобы написать в чат, необходимо войти в аккаунт CanHelp.")}),(0,r.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,r.jsxs)("a",{href:"/login",className:"w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"})}),w("site.auth_login_btn","Войти в аккаунт")]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{$(!1),setTimeout(()=>{var e;null==(e=document.getElementById("contact"))||e.scrollIntoView({behavior:"smooth",block:"start"})},100)},className:"w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition",style:{background:"var(--site-surface)",color:"var(--site-text-secondary)",border:"1px solid var(--site-border)"},children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.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"})}),w("site.auth_contact_form_btn","Написать через форму обратной связи")]})]})]})}),G&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{E||(K(!1),et(!1))},children:(0,r.jsxs)("div",{className:"relative w-full max-w-md rounded-2xl shadow-2xl",style:{background:"var(--site-modal-bg)",border:"1px solid var(--site-border)"},onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("button",{type:"button",onClick:()=>{K(!1),et(!1)},className:"absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition",style:{background:"var(--site-surface)",color:"var(--site-text-muted)"},children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,r.jsxs)("div",{className:"p-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-5 h-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-base font-semibold",style:{color:"var(--site-text)"},children:w("site.write_to_chat","Написать в чат")}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--site-text-muted)"},children:eb})]})]}),ee?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,r.jsx)("p",{className:"text-emerald-400 font-medium mb-1",children:w("site.message_sent","Сообщение отправлено!")}),(0,r.jsx)("p",{className:"text-sm mb-4",style:{color:"var(--site-text-muted)"},children:w("site.message_sent_desc","Специалист получит его в чате")}),(0,r.jsx)("button",{type:"button",onClick:()=>{K(!1),et(!1)},className:"text-sm text-gray-400 hover:text-gray-300 transition",children:w("common.close","Закрыть")})]}):(0,r.jsxs)("form",{onSubmit:ep,children:[(0,r.jsx)("textarea",{autoFocus:!0,rows:4,value:X,onChange:e=>Z(e.target.value),className:"w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4",style:{background:"var(--site-input-bg)",border:"1px solid var(--site-input-border)",color:"var(--site-input-text)"},placeholder:w("site.message_placeholder","Напишите сообщение...")}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>K(!1),className:"text-sm transition px-4 py-2",style:{color:"var(--site-text-muted)"},children:w("common.cancel","Отмена")}),(0,r.jsxs)("button",{type:"submit",disabled:E||!X.trim(),className:"inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50",children:[E?(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin"}):(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})}),w("site.contact_send","Отправить")]})]})]})]})]})}),(0,r.jsx)("nav",{className:"sticky top-0 z-40 backdrop-blur-xl",style:{background:"var(--site-nav-bg)",borderBottom:"1px solid var(--site-border)"},children:(0,r.jsxs)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between",children:[(0,r.jsx)("a",{href:"/",className:"logo-text-mini tracking-tight".concat(ed?" scrolled":""),style:{color:"var(--site-text-secondary)"},children:"CanHelp"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(null==_?void 0:_.rating)&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs mr-1",style:{color:"var(--site-text-secondary)"},children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),(0,r.jsx)("span",{className:"font-medium",children:Number(_.rating).toFixed(1)})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>J(!Y),className:"flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg",style:{color:"var(--site-text-muted)"},children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.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"})}),null!=(N=null==(v=eh.find(e=>e.code===L))?void 0:v.flag)?N:"\uD83C\uDF10"]}),Y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>J(!1)}),(0,r.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]",style:{background:"var(--site-lang-dropdown)",border:"1px solid var(--site-border)"},children:eh.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{C(e.code),J(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(L===e.code?"text-gray-400 bg-green-500/10":""),style:L===e.code?{}:{color:"var(--site-text-secondary)"},children:[(0,r.jsx)("span",{children:e.flag}),(0,r.jsx)("span",{children:e.label})]},e.code))})]})]}),(0,r.jsx)("div",{className:"w-px h-4",style:{background:"var(--site-divider)"}}),(0,r.jsxs)("button",{type:"button",onClick:async()=>{let e=window.location.href;if(navigator.share)try{await navigator.share({title:eb,url:e})}catch(e){}else navigator.clipboard.writeText(e),F(!0),setTimeout(()=>F(!1),2e3)},className:"flex items-center gap-1.5 text-xs transition",style:{color:"var(--site-text-muted)"},children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),V?w("profile.site.copied"):w("site.share","Поделиться")]})]})]})}),(0,r.jsxs)("section",{className:"relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsx)("div",{className:"absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none"}),(0,r.jsx)("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28",children:(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsxs)("div",{className:"relative group mb-6",children:[(0,r.jsx)("div",{className:"absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity"}),(0,r.jsx)("div",{className:"relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold",style:{borderColor:"var(--site-avatar-border)",background:"var(--site-avatar-bg)",color:"var(--site-text)"},children:_.image?(0,r.jsx)("img",{src:_.image,alt:eb,className:"w-full h-full object-cover"}):ev}),Array.isArray(_.activeStatuses)&&_.activeStatuses.includes("canhelp_now")&&(0,r.jsx)("div",{className:"absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center",style:{borderColor:"var(--site-status-border-color)"},children:(0,r.jsx)("span",{className:"w-2 h-2 rounded-full bg-white animate-pulse"})})]}),(0,r.jsx)("h1",{className:"text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1",style:{backgroundImage:"linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))"},children:eb}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-wrap mb-4",children:[_.planTier&&"free"!==_.planTier&&(0,r.jsx)(c.d,{tier:_.planTier,verified:_.hasVerifiedBadge,size:"md"}),Array.isArray(_.activeStatuses)&&_.activeStatuses.includes("canhelp_now")&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),w("status.can_help_now","Готов помочь")]}),ef&&(0,r.jsxs)("span",{className:"text-xs px-3 py-1.5 rounded-full",style:{color:"var(--site-text-muted)",background:"var(--site-surface)"},children:[w("site.member_since","С нами с")," ",ef]})]}),_.bio&&(0,r.jsx)("p",{className:"max-w-xl text-base sm:text-lg leading-relaxed mb-8",style:{color:"var(--site-text-secondary)"},children:_.bio}),(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-wrap justify-center",children:[(0,r.jsxs)("button",{onClick:function(){if(!M)return void $(!0);K(!0)},disabled:E,className:"group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50",children:[(0,r.jsx)("svg",{className:"w-5 h-5 group-hover:scale-110 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),w("site.write_to_chat","Написать в чат")]}),_.phone&&(0,r.jsxs)("a",{href:"tel:".concat(_.phone),className:"group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all",style:{background:"var(--site-phone-bg)",borderColor:"var(--site-phone-border)",color:"var(--site-phone-text)"},children:[(0,r.jsx)("svg",{className:"w-5 h-5 group-hover:scale-110 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),_.phone]})]})]})})]}),ej&&(0,r.jsx)("section",{className:"border-y",style:{borderColor:"var(--site-border)",background:"var(--site-surface)"},children:(0,r.jsx)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6",children:[_.rating&&(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1 mb-1",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:Number(_.rating).toFixed(1)})]}),(0,r.jsx)("p",{className:"text-xs uppercase tracking-wider",style:{color:"var(--site-text-muted)"},children:w("site.rating","Рейтинг")})]}),_.reviewCount>0&&(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold mb-1",children:_.reviewCount}),(0,r.jsx)("p",{className:"text-xs uppercase tracking-wider",style:{color:"var(--site-text-muted)"},children:w("profile.reviews")})]}),_.completedTasks>0&&(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold mb-1",children:_.completedTasks}),(0,r.jsx)("p",{className:"text-xs uppercase tracking-wider",style:{color:"var(--site-text-muted)"},children:w("site.completed_tasks","Выполнено")})]}),Array.isArray(_.languages)&&_.languages.length>0&&(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold mb-1",children:_.languages.length}),(0,r.jsx)("p",{className:"text-xs uppercase tracking-wider",style:{color:"var(--site-text-muted)"},children:w("site.languages","Языков")})]})]})})}),Array.isArray(_.languages)&&_.languages.length>0&&(0,r.jsxs)("section",{className:"max-w-5xl mx-auto px-4 sm:px-6 pt-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("svg",{className:"w-4 h-4 shrink-0",style:{color:"var(--site-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.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"})}),(0,r.jsx)("span",{className:"text-sm",style:{color:"var(--site-text-muted)"},children:w("site.speaks_languages","Говорит на языках")})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:_.languages.map(e=>{let t=eu[e];return(0,r.jsx)("span",{className:"text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5",style:{color:"var(--site-tag-text)",background:"var(--site-tag-bg)",border:"1px solid var(--site-tag-border)"},children:t?(0,r.jsxs)(r.Fragment,{children:[t.flag," ",t.label]}):e},e)})})]}),(0,r.jsxs)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10",children:[eN&&Array.isArray(_.cards)&&_.cards.length>0&&(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),(0,r.jsx)("h2",{className:"text-xl font-bold",children:w("specialist.services","Услуги")})]}),(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:_.cards.map(e=>{let t={};if(Array.isArray(e.locations))for(let s of e.locations){let e=ei[s];if(e)t[e]||(t[e]=[]),t[e].push(el[s]||s);else{let e=el[s]||s;t[e]||(t[e]=[])}}return(0,r.jsxs)("div",{className:"group relative rounded-2xl p-6 transition-all",style:{background:"var(--site-card-bg)",border:"1px solid var(--site-card-border)"},children:[(0,r.jsx)("h3",{className:"font-semibold mb-2",style:{color:"var(--site-text)"},children:e.title}),eN&&(()=>{let t=("el"===L?e.descriptionEl:"en"===L?e.descriptionEn:"ru"===L?e.descriptionRu:e.descriptionUk)||e.descriptionEl||e.descriptionEn||e.descriptionRu||e.descriptionUk||e.description;return t?(0,r.jsx)("p",{className:"text-sm leading-relaxed mb-3",style:{color:"var(--site-text-muted)"},children:t}):null})(),eN&&Array.isArray(e.categories)&&e.categories.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-3",children:e.categories.map(e=>(0,r.jsx)("span",{className:"text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10",children:es[e]||e},e))}),eN&&Object.keys(t).length>0&&(0,r.jsx)("div",{className:"mb-3 space-y-1",children:Object.entries(t).map(e=>{let[t,s]=e;return(0,r.jsxs)("div",{className:"flex items-start gap-1.5 text-xs",style:{color:"var(--site-text-muted)"},children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",style:{color:"var(--site-text-secondary)"},children:t}),s.length>0&&(0,r.jsxs)("span",{style:{color:"var(--site-text-hint)"},children:[" — ",s.join(", ")]})]})]},t)})}),eN&&Array.isArray(e.skills)&&e.skills.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.skills.map(e=>(0,r.jsx)("span",{className:"text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10",children:e},e))}),ek&&Array.isArray(eo[e.id])&&eo[e.id].length>0&&(0,r.jsxs)("div",{className:"".concat(eN?"mt-4 pt-4 border-t":""),style:{borderColor:"var(--site-card-border)"},children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"var(--site-text-muted)"},children:w("site.pricelist","Прайслист")}),(0,r.jsx)("div",{className:"space-y-3",children:eo[e.id].map(e=>(0,r.jsxs)("div",{className:"rounded-xl p-4",style:{background:"var(--site-surface)",border:"1px solid var(--site-card-border)"},children:[(0,r.jsx)("p",{className:"font-semibold mb-3",style:{color:"var(--site-text)"},children:e.title}),(0,r.jsx)("div",{className:"space-y-3",children:e.items.map(e=>(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--site-text-secondary)"},children:e.name}),e.description&&(0,r.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--site-text-muted)"},children:e.description})]}),(e.price||e.unit)&&(0,r.jsxs)("div",{className:"shrink-0 text-sm font-semibold",style:{color:"var(--site-text)"},children:[e.price?"€".concat(e.price):"",e.unit?" ".concat(e.unit):""]})]},e.id))})]},e.id))})]})]},e.id)})})]}),Array.isArray(_.portfolio)&&_.portfolio.length>0&&(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-4 h-4 text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),(0,r.jsx)("h2",{className:"text-xl font-bold",children:w("portfolio.title","Портфолио")}),(0,r.jsxs)("span",{className:"text-xs ml-auto",style:{color:"var(--site-text-hint)"},children:[_.portfolio.length," ",w("site.photos","фото")]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:_.portfolio.map((e,t)=>{var s;return(0,r.jsxs)("button",{onClick:()=>e.imageUrl&&T(t),className:"group relative aspect-square rounded-xl overflow-hidden transition-all",style:{background:"var(--site-surface)",border:"1px solid var(--site-card-border)"},children:[e.imageUrl&&(0,r.jsx)("img",{src:e.imageUrl,alt:null!=(s=e.title)?s:"",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3",children:e.title&&(0,r.jsx)("p",{className:"text-xs font-medium text-white truncate",children:e.title})}),(0,r.jsx)("div",{className:"absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-white/80",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"})})})]},e.id)})})]}),Array.isArray(_.reviews)&&_.reviews.length>0&&(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.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"})})}),(0,r.jsx)("h2",{className:"text-xl font-bold",children:w("profile.reviews")}),(0,r.jsx)("span",{className:"text-xs ml-auto",style:{color:"var(--site-text-hint)"},children:_.reviewCount})]}),(0,r.jsx)("div",{className:"space-y-3",children:_.reviews.slice(0,6).map(e=>{var t,s,l,a;let i=[e.authorFirstName,e.authorLastName].filter(Boolean).join(" ")||e.authorName||null;return(0,r.jsxs)("div",{className:"rounded-2xl p-5",style:{background:"var(--site-card-bg)",border:"1px solid var(--site-card-border)"},children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0",style:{background:"var(--site-surface)",color:"var(--site-text-muted)"},children:e.authorImage?(0,r.jsx)("img",{src:e.authorImage,alt:"",className:"w-full h-full object-cover"}):(null!=(a=null!=(l=null==(t=e.authorFirstName)?void 0:t[0])?l:null==(s=e.authorName)?void 0:s[0])?a:"?").toUpperCase()}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--site-text-secondary)"},children:null!=i?i:w("common.anonymous","Анонимно")}),(0,r.jsx)("span",{className:"shrink-0 text-[11px]",style:{color:"var(--site-text-hint)"},children:new Date(e.createdAt).toLocaleDateString(em)})]}),(0,r.jsx)("div",{className:"flex gap-0.5 mt-0.5",children:Array.from({length:5}).map((t,s)=>(0,r.jsx)("svg",{className:"w-3.5 h-3.5 ".concat(sO(t=>({...t,name:e.target.value})),className:"w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition",style:{background:"var(--site-input-bg)",border:"1px solid var(--site-input-border)",color:"var(--site-input-text)"},placeholder:w("site.contact_name_ph","Ваше имя")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs uppercase tracking-wider mb-1.5 block",style:{color:"var(--site-text-muted)"},children:"Email"}),(0,r.jsx)("input",{type:"email",value:I.email,onChange:e=>O(t=>({...t,email:e.target.value})),className:"w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition",style:{background:"var(--site-input-bg)",border:"1px solid var(--site-input-border)",color:"var(--site-input-text)"},placeholder:w("site.contact_email_ph","your@email.com")})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"text-xs uppercase tracking-wider mb-1.5 block",style:{color:"var(--site-text-muted)"},children:[w("site.contact_message","Сообщение")," *"]}),(0,r.jsx)("textarea",{required:!0,rows:4,value:I.message,onChange:e=>O(t=>({...t,message:e.target.value})),className:"w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none",style:{background:"var(--site-input-bg)",border:"1px solid var(--site-input-border)",color:"var(--site-input-text)"},placeholder:w("site.contact_message_ph","Опишите вашу задачу...")})]}),(0,r.jsxs)("button",{type:"submit",disabled:R,className:"inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50",children:[R?(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin"}):(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})}),w("site.contact_send","Отправить")]})]})]}),(0,r.jsx)("footer",{className:"border-t pt-8 pb-4",style:{borderColor:"var(--site-border)"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs",style:{color:"var(--site-footer-text)"},children:[(0,r.jsx)("a",{href:"/",className:"transition",children:"CanHelp.gr"}),(0,r.jsxs)("p",{children:["\xa9 ",new Date().getFullYear()]})]})})]}),(0,r.jsx)("button",{onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(ed?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"),style:{background:"var(--site-scroll-btn-bg)",border:"1px solid var(--site-scroll-btn-border)",color:"var(--site-scroll-btn-text)"},"aria-label":"Scroll to top",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=409)),_N_E=e.O()}]); (()=>{"use strict";var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}},i=!0;try{e[n].call(a.exports,a,a.exports,r),i=!1}finally{i&&delete t[n]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(n){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[n,o,a];return}for(var l=1/0,i=0;i=a)&&Object.keys(r.O).every(e=>r.O[e](n[d]))?n.splice(d--,1):(u=!1,a{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o||"object"==typeof n&&n&&(4&o&&n.__esModule||16&o&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&o&&n;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,r.d(a,i),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"static/chunks/"+(9031===e?"e89fb3a8":e)+"."+({3542:"bb9abe76cf68d932",6467:"7848e607a6de9648",7797:"7f09b625f84a88e2",9031:"7ade5d06ffa9957d"})[e]+".js",r.miniCssF=e=>"static/css/93ad12acbd6e0cbd.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(n,o,a,i)=>{if(e[n])return void e[n].push(o);if(void 0!==a)for(var l,u,d=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),u&&document.head.appendChild(l)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={8068:0};r.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&({2012:1})[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=a=>{if(o.onerror=o.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),l=a&&a.target&&a.target.href||t,u=Error("Loading CSS chunk "+e+" failed.\n("+l+")");u.code="CSS_CHUNK_LOAD_FAILED",u.type=i,u.request=l,o.parentNode.removeChild(o),n(u)}},o.href=t,!function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:t,onload:r,onerror:n}=e;_N_E_STYLE_LOAD(0===t.indexOf(window.location.origin)?new URL(t).pathname:t).then(()=>null==r?void 0:r.call(e,{type:"load"}),()=>null==n?void 0:n.call(e,{}))}else document.head.appendChild(e)}(o)})(e,a,t,n)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}})(),(()=>{var e={8068:0,9950:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(2012|8068|9950)$/.test(t))e[t]=0;else{var a=new Promise((r,n)=>o=e[t]=[r,n]);n.push(o[2]=a);var i=r.p+r.u(t),l=Error();r.l(i,n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,l,u]=n,d=0;if(i.some(t=>0!==e[t])){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(u)var s=u(r)}for(t&&t(n);d{r.r(t),r.d(t,{default:()=>n});var s=r(4568),l=r(7620),a=r(9906),o=r(2982);function n(e){let{onClose:t}=e,{t:r}=(0,a.Y)(),[n,i]=(0,l.useState)("bug"),[c,d]=(0,l.useState)(""),[u,x]=(0,l.useState)(""),[p,g]=(0,l.useState)(!1),[m,b]=(0,l.useState)(!1),[h,y]=(0,l.useState)(""),f=[{value:"bug",label:r("support.type.bug"),icon:"\uD83D\uDC1B",color:"border-red-300 bg-red-50 text-red-700"},{value:"suggestion",label:r("support.type.suggestion"),icon:"\uD83D\uDCA1",color:"border-green-300 bg-green-50 text-green-700"},{value:"other",label:r("support.type.other"),icon:"\uD83D\uDCAC",color:"border-gray-300 bg-gray-50 text-gray-700"}];async function j(e){e.preventDefault(),y(""),g(!0);try{await (0,o.mq)({type:n,subject:c,body:u}),b(!0)}catch(e){y(r("support.error"))}finally{g(!1)}}return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:e=>e.target===e.currentTarget&&t(),children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})}),(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:r("support.title")})]}),(0,s.jsx)("button",{onClick:t,className:"text-gray-400 hover:text-gray-600",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),m?(0,s.jsxs)("div",{className:"px-6 py-10 text-center",children:[(0,s.jsx)("div",{className:"text-5xl mb-4",children:"✅"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:r("support.sent.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:r("support.sent.body")}),(0,s.jsx)("button",{onClick:t,className:"bg-green-600 text-white px-6 py-2.5 rounded-xl font-medium hover:bg-green-700",children:r("support.sent.close")})]}):(0,s.jsxs)("form",{onSubmit:j,className:"px-6 py-5 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:r("support.type.label")}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",children:f.map(e=>{let{value:t,label:r,icon:l,color:a}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>i(t),className:"flex flex-col items-center gap-1 py-3 px-2 rounded-xl border-2 text-xs font-medium transition ".concat(n===t?a+" border-opacity-100":"border-gray-200 bg-white text-gray-500 hover:border-gray-300"),children:[(0,s.jsx)("span",{className:"text-xl",children:l}),r]},t)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:r("support.subject")}),(0,s.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),required:!0,minLength:3,maxLength:200,placeholder:r("support.subject.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:r("support.body")}),(0,s.jsx)("textarea",{value:u,onChange:e=>x(e.target.value),required:!0,minLength:10,maxLength:5e3,rows:5,placeholder:r("support.body.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),h&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,s.jsxs)("div",{className:"flex gap-3 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"flex-1 border border-gray-300 text-gray-700 py-2.5 rounded-xl font-medium hover:bg-gray-50",children:r("support.cancel")}),(0,s.jsx)("button",{type:"submit",disabled:p,className:"flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50",children:p?"...":r("support.submit")})]})]})]})})}}}]); 1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2982],{2982:(t,e,n)=>{n.d(e,{$7:()=>B,$H:()=>h,$M:()=>C,Bb:()=>tX,Bm:()=>R,Bq:()=>tG,Br:()=>ty,C0:()=>A,CX:()=>tH,Ck:()=>tY,Cs:()=>en,D1:()=>tV,Em:()=>o,F7:()=>u,F9:()=>H,FI:()=>tU,Fu:()=>i,GB:()=>tr,GE:()=>Z,Gp:()=>ed,H:()=>eo,H6:()=>S,He:()=>W,I:()=>tj,Ic:()=>t1,Ip:()=>E,Je:()=>es,K7:()=>V,KD:()=>z,KZ:()=>eO,Lb:()=>y,Lp:()=>tw,ML:()=>eg,Mm:()=>tt,NL:()=>k,Nt:()=>tb,O8:()=>eS,OM:()=>tB,OV:()=>eh,OX:()=>tv,On:()=>b,P0:()=>et,QN:()=>P,QY:()=>tq,RN:()=>ep,RQ:()=>em,Rt:()=>d,S$:()=>ey,S9:()=>Q,Sw:()=>m,T9:()=>ea,Tr:()=>J,U9:()=>t5,UE:()=>eu,UT:()=>c,Uq:()=>$,V:()=>j,V7:()=>tT,VL:()=>N,VM:()=>p,Vs:()=>I,Wi:()=>Y,Xz:()=>tM,YQ:()=>tI,Yj:()=>ts,Z2:()=>t2,Zp:()=>O,_z:()=>v,aT:()=>l,bR:()=>tE,bW:()=>D,bc:()=>er,bi:()=>tp,bx:()=>f,cJ:()=>tf,cS:()=>G,cl:()=>tD,cp:()=>tF,dE:()=>x,eR:()=>tZ,eU:()=>tm,ew:()=>t4,f5:()=>tx,fP:()=>K,fm:()=>t8,fu:()=>tz,g0:()=>t6,g1:()=>tS,gg:()=>s,hD:()=>ee,hl:()=>tQ,hp:()=>X,iN:()=>t_,i_:()=>M,j_:()=>tl,jd:()=>te,jg:()=>tL,k_:()=>tO,lC:()=>r,mq:()=>eT,nT:()=>eP,nf:()=>tc,oD:()=>t0,oh:()=>t7,oq:()=>ta,pD:()=>F,pK:()=>t3,q7:()=>T,qT:()=>tJ,qX:()=>tR,qt:()=>th,rC:()=>tk,rl:()=>t9,sD:()=>q,st:()=>L,td:()=>tC,ts:()=>g,u0:()=>eb,u4:()=>tu,uQ:()=>ti,v9:()=>U,vD:()=>tW,vh:()=>ef,vy:()=>tn,wc:()=>tA,wl:()=>to,yJ:()=>tP,yO:()=>tg,yk:()=>w,z4:()=>ei,z5:()=>td,z6:()=>ec,zB:()=>tK,zR:()=>tN,zZ:()=>_,zc:()=>t$,zk:()=>el});let a="https://api.canhelp.gr";async function o(t,e){let n="".concat(a,"/api").concat(t),o=await fetch(n,{...e,credentials:"include",headers:{"Content-Type":"application/json",...null==e?void 0:e.headers}});if(!o.ok){let t=await o.json().catch(()=>({error:o.statusText}));throw Error("string"==typeof t.error?t.error:"string"==typeof t.message?t.message:o.statusText||"Request failed")}return o.json()}let i=()=>o("/tasks/my"),s=t=>o("/tasks/".concat(t)),c=t=>o("/tasks",{method:"POST",body:JSON.stringify(t)}),r=(t,e)=>o("/tasks/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),d=t=>o("/tasks/".concat(t,"/complete"),{method:"PATCH"}),m=t=>o("/offers?taskId=".concat(t)),l=()=>o("/offers/my"),g=t=>o("/offers",{method:"POST",body:JSON.stringify(t)}),h=t=>o("/offers/".concat(t,"/accept"),{method:"PATCH"}),y=t=>o("/offers/".concat(t,"/decline"),{method:"PATCH"}),p=(t,e)=>o("/users/".concat(t,"/profile").concat(e?"?locale=".concat(encodeURIComponent(e)):"")),u=t=>{let e=t?"?"+new URLSearchParams(t):"";return o("/users/specialists".concat(e))},f=t=>o("/reviews",{method:"POST",body:JSON.stringify(t)}),S=t=>o("/reviews/task/".concat(t)),T=()=>o("/reviews/my"),O=()=>o("/chat/rooms"),P=t=>o("/chat/direct/".concat(t)),b=t=>o("/chat/can-message/".concat(t)),N=t=>o("/chat/rooms/".concat(t,"/messages")),v=(t,e)=>o("/chat/messages",{method:"POST",body:JSON.stringify({roomId:t,body:e})}),J=()=>o("/notifications"),C=()=>o("/notifications/count"),E=t=>o("/notifications/".concat(t,"/read"),{method:"PATCH"}),k=()=>o("/notifications/read-all",{method:"PATCH"}),H=t=>o("/notifications?type=task_invite&referenceId=".concat(t)),w=t=>o("/notifications/".concat(t),{method:"DELETE"}),L=()=>o("/users/me/referral"),A=t=>o("/users/me/referral/apply",{method:"POST",body:JSON.stringify({refCode:t})}),U=t=>o("/reviews/user/".concat(t)),R=t=>o("/reviews/user/".concat(t,"/rating")),D=()=>o("/categories"),I=()=>o("/locations"),F=()=>o("/favorites/specialists"),j=t=>o("/favorites/specialists/".concat(t),{method:"POST"}),q=t=>o("/favorites/specialists/".concat(t),{method:"DELETE"}),z=()=>o("/admin/categories"),_=t=>o("/admin/categories",{method:"POST",body:JSON.stringify(t)}),B=(t,e)=>o("/admin/categories/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),V=t=>o("/admin/categories/".concat(t),{method:"DELETE"}),M=t=>o("/admin/skills?categorySlug=".concat(encodeURIComponent(t))),Q=t=>o("/admin/skills",{method:"POST",body:JSON.stringify(t)}),K=(t,e)=>o("/admin/skills/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),X=t=>o("/admin/skills/".concat(t),{method:"DELETE"}),Z=t=>o("/admin/skills/dedup".concat(t?"?categorySlug=".concat(encodeURIComponent(t)):"")),$=(t,e)=>o("/admin/skills/dedup/merge",{method:"POST",body:JSON.stringify({keepId:t,deleteIds:e})}),x=()=>o("/admin/stats"),G=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=new URLSearchParams({page:String(t),limit:"20"});return e&&a.set("q",e),n&&a.set("role",n),o("/admin/users?".concat(a))},Y=t=>o("/admin/users/".concat(t,"/deactivate"),{method:"PATCH"}),W=t=>o("/admin/users/".concat(t,"/activate"),{method:"PATCH"}),tt=(t,e)=>o("/admin/users/".concat(t,"/role"),{method:"PATCH",body:JSON.stringify({role:e})}),te=t=>o("/admin/users/".concat(t)),tn=t=>o("/admin/users/".concat(t,"/specialist-cards")),ta=(t,e)=>o("/admin/specialist-cards/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),to=(t,e)=>o("/admin/users/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),ti=t=>o("/admin/users/".concat(t,"/verify-email"),{method:"PATCH"}),ts=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=new URLSearchParams({page:String(t),limit:"20"});return e&&a.set("q",e),n&&a.set("status",n),o("/admin/tasks?".concat(a))},tc=t=>o("/admin/tasks/".concat(t,"/cancel"),{method:"PATCH"}),tr=t=>o("/admin/tasks/".concat(t),{method:"DELETE"}),td=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return o("/admin/reports?page=".concat(t,"&limit=20"))},tm=(t,e)=>o("/admin/reports/".concat(t,"/status"),{method:"PATCH",body:JSON.stringify({status:e})}),tl=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return o("/admin/ai-logs?page=".concat(t,"&limit=50"))},tg=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.event&&e.set("event",t.event),t.userId&&e.set("userId",t.userId),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/activity-logs?".concat(e))},th=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.event&&e.set("event",t.event),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/mail-logs?".concat(e))},ty=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.type&&e.set("type",t.type),t.dateFrom&&e.set("dateFrom",t.dateFrom),t.dateTo&&e.set("dateTo",t.dateTo),e.set("limit","50"),o("/admin/notification-logs?".concat(e))},tp=()=>o("/admin/notification-stats"),tu=()=>o("/admin/mail-stats"),tf=()=>o("/admin/referrals"),tS=(t,e)=>o("/admin/push/user/".concat(t),{method:"POST",body:JSON.stringify(e)}),tT=t=>o("/admin/push/broadcast",{method:"POST",body:JSON.stringify(t)}),tO=()=>o("/admin/locations"),tP=t=>o("/admin/locations",{method:"POST",body:JSON.stringify(t)}),tb=(t,e)=>o("/admin/locations/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tN=t=>o("/admin/locations/".concat(t),{method:"DELETE"}),tv=()=>o("/admin/plans"),tJ=t=>o("/admin/plans",{method:"POST",body:JSON.stringify(t)}),tC=(t,e)=>o("/admin/plans/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tE=t=>o("/admin/plans/".concat(t),{method:"DELETE"}),tk=()=>o("/admin/settings"),tH=t=>o("/admin/settings",{method:"PUT",body:JSON.stringify(t)}),tw=()=>o("/admin/settings/templates"),tL=(t,e)=>o("/admin/settings/templates/".concat(t),{method:"PUT",body:JSON.stringify(e)}),tA=t=>o("/admin/settings/templates/translate",{method:"POST",body:JSON.stringify(t)}),tU=()=>o("/admin/settings/test-email",{method:"POST"}),tR=(t,e)=>fetch("".concat(a,"/api/admin/settings/test-telegram"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:t,chatId:e})}).then(t=>t.json()),tD=t=>fetch("".concat(a,"/api/admin/settings/verify-telegram-token"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:t})}).then(t=>t.json()),tI=()=>o("/admin/translations/stats"),tF=function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;return o("/admin/translations/auto-translate",{method:"POST",body:JSON.stringify({table:t,missingLang:e,fromLang:n,batchSize:a})})},tj=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;return o("/admin/translations/auto-translate-tasks",{method:"POST",body:JSON.stringify({batchSize:t})})},tq=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return o("/admin/translations/tasks-preview?lang=".concat(t,"&limit=").concat(e))},tz=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"el";return o("/admin/translations/auto-translate-templates",{method:"POST",body:JSON.stringify({missingLang:t,fromLang:e})})},t_=t=>o("/availability/my".concat(t?"?month=".concat(t):"")),tB=(t,e,n)=>o("/availability/set",{method:"POST",body:JSON.stringify({date:t,status:e,note:n})}),tV=(t,e,n)=>o("/availability/set-range",{method:"POST",body:JSON.stringify({from:t,to:e,status:n})}),tM=(t,e)=>o("/availability/user/".concat(t).concat(e?"?month=".concat(e):"")),tQ=(t,e)=>o("/portfolio/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tK=t=>o("/portfolio/".concat(t),{method:"DELETE"}),tX=()=>o("/specialist-cards/my"),tZ=t=>o("/specialist-cards",{method:"POST",body:JSON.stringify(t)}),t$=(t,e)=>o("/specialist-cards/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),tx=t=>o("/specialist-cards/".concat(t),{method:"DELETE"}),tG=(t,e)=>o("/specialist-cards/user/".concat(t).concat(e?"?locale=".concat(encodeURIComponent(e)):"")),tY=(t,e)=>o("/price-list/".concat(t).concat(e?"?locale=".concat(encodeURIComponent(e)):"")),tW=(t,e)=>o("/price-list/".concat(t,"/groups"),{method:"POST",body:JSON.stringify(e)}),t0=(t,e)=>o("/price-list/groups/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),t1=t=>o("/price-list/groups/".concat(t),{method:"DELETE"}),t2=(t,e)=>o("/price-list/groups/".concat(t,"/items"),{method:"POST",body:JSON.stringify(e)}),t5=t=>o("/price-list/items/".concat(t),{method:"DELETE"}),t9=t=>{let e=(null==t?void 0:t.length)?"?"+t.map(t=>"category=".concat(encodeURIComponent(t))).join("&"):"";return o("/skill-suggestions".concat(e))},t7=t=>o("/payments/topup/init",{method:"POST",body:JSON.stringify({amount:t})}),t3=()=>o("/payments/history"),t8=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return o("/payments/balance-history?limit=".concat(t))},t4=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return o("/users/me/plan-history?limit=".concat(t))},t6=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.page&&e.set("page",String(t.page)),t.userId&&e.set("userId",t.userId),t.kind&&e.set("kind",t.kind),e.set("limit","50"),o("/admin/balance-history?".concat(e))},et=(t,e)=>o("/admin/users/".concat(t,"/balance/topup"),{method:"POST",body:JSON.stringify(e)}),ee=(t,e)=>o("/admin/users/".concat(t,"/balance/withdraw"),{method:"POST",body:JSON.stringify(e)}),en=t=>o("/payments/plan/preview",{method:"POST",body:JSON.stringify({planId:t})}),ea=t=>o("/plans".concat(t?"?role=".concat(t):"")),eo=()=>o("/dashboard/me"),ei=()=>o("/plans/daily-usage"),es=function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return o("/payments/plan/purchase",{method:"POST",body:JSON.stringify({planId:t,payFromBalance:e})})},ec=()=>o("/statuses/me"),er=(t,e)=>o("/statuses/toggle",{method:"POST",body:JSON.stringify({statusType:t,active:e})}),ed=()=>o("/auto-response"),em=t=>o("/auto-response",{method:"PUT",body:JSON.stringify(t)}),el=()=>o("/fomo/specialist"),eg=()=>o("/fomo/customer"),eh=t=>o("/auto-match/".concat(t),{method:"POST"}),ey=t=>o("/users/site/".concat(t)),ep=()=>o("/users/me/site-stats"),eu=t=>o("/users/site/".concat(t,"/track-message"),{method:"POST"}).catch(()=>{}),ef=t=>o("/tasks/".concat(t,"/stats")),eS=t=>o("/support/public",{method:"POST",body:JSON.stringify(t)}),eT=t=>o("/support",{method:"POST",body:JSON.stringify(t)}),eO=t=>o("/support".concat(t?"?"+new URLSearchParams(t):"")),eP=(t,e)=>o("/support/".concat(t,"/reply"),{method:"PATCH",body:JSON.stringify(e)}),eb=(t,e)=>o("/support/".concat(t,"/status"),{method:"PATCH",body:JSON.stringify({status:e})})}}]); bb9abe76cf68d9327848e607a6de96487f09b625f84a88e27ade5d06ffa9957d93ad12acbd6e0cbd(()=>{"use strict";var e={},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}},i=!0;try{e[n].call(a.exports,a,a.exports,r),i=!1}finally{i&&delete t[n]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(n){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[n,o,a];return}for(var l=1/0,i=0;i=a)&&Object.keys(r.O).every(e=>r.O[e](n[d]))?n.splice(d--,1):(u=!1,a{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,o){if(1&o&&(n=this(n)),8&o||"object"==typeof n&&n&&(4&o&&n.__esModule||16&o&&"function"==typeof n.then))return n;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&o&&n;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,r.d(a,i),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"static/chunks/"+(9031===e?"e89fb3a8":e)+"."+({3542:"ec15a3607f89153b",6467:"a600a1d7b0465863",7797:"f44d1d20dafa108a",9031:"970022b1c726abe3"})[e]+".js",r.miniCssF=e=>"static/css/fb8df02a468380ac.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(n,o,a,i)=>{if(e[n])return void e[n].push(o);if(void 0!==a)for(var l,u,d=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),u&&document.head.appendChild(l)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={8068:0};r.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&({2012:1})[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var o=r.miniCssF(e),a=r.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n{var o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=a=>{if(o.onerror=o.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),l=a&&a.target&&a.target.href||t,u=Error("Loading CSS chunk "+e+" failed.\n("+l+")");u.code="CSS_CHUNK_LOAD_FAILED",u.type=i,u.request=l,o.parentNode.removeChild(o),n(u)}},o.href=t,!function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:t,onload:r,onerror:n}=e;_N_E_STYLE_LOAD(0===t.indexOf(window.location.origin)?new URL(t).pathname:t).then(()=>null==r?void 0:r.call(e,{type:"load"}),()=>null==n?void 0:n.call(e,{}))}else document.head.appendChild(e)}(o)})(e,a,t,n)}))(t).then(()=>{e[t]=0},r=>{throw delete e[t],r}))}})(),(()=>{var e={8068:0,9950:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else if(/^(2012|8068|9950)$/.test(t))e[t]=0;else{var a=new Promise((r,n)=>o=e[t]=[r,n]);n.push(o[2]=a);var i=r.p+r.u(t),l=Error();r.l(i,n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,l,u]=n,d=0;if(i.some(t=>0!==e[t])){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(u)var s=u(r)}for(t&&t(n);d{"use strict";function s(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,a){if(null==e?void 0:e.trim()){let a=null==t?void 0:t.trim();return a?"".concat(e.trim()," ").concat(a[0].toUpperCase(),"."):e.trim()}return s(a)}a.d(t,{E:()=>s,H:()=>l})},1592:(e,t,a)=>{"use strict";a.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>i,yK:()=>s});let s=(0,a(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:i}=s},4017:(e,t,a)=>{"use strict";function s(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function l(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function n(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}a.d(t,{$g:()=>l,GZ:()=>n,Oj:()=>s})},5940:(e,t,a)=>{"use strict";a.d(t,{Ez:()=>r,V:()=>n});var s=a(4568),l=a(7620);function n(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function r(e){let{icon:t,alt:a="",className:r,fallback:i="\uD83D\uDCE6"}=e,o=(t||"").trim(),[d,c]=(0,l.useState)(!1);(0,l.useEffect)(()=>{c(!1)},[o]);let m=(0,l.useMemo)(()=>n(o)?o.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(o):o:"",[o]),x="/category-icons/package.svg";return n(o)?d&&o!==x?(0,s.jsx)("img",{src:x,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):d&&o===x?(0,s.jsx)("span",{className:r,children:i}):(0,s.jsx)("img",{src:m,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):(0,s.jsx)("span",{className:r,children:o||i})}},6961:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(4568),l=a(7620),n=a(7541),r=a(9664),i=a.n(r),o=a(1592),d=a(9906),c=a(2982),m=a(1258),x=a(4017),u=a(5940);let g={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(g).flat())),h=[{value:"/category-icons/repairs.svg",label:"Repairs & Construction"},{value:"/category-icons/repairs-alt-wrench.svg",label:"Repairs Alt: Wrench"},{value:"/category-icons/repairs-alt-hard-hat.svg",label:"Repairs Alt: Hard Hat"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/cleaning-alt-broom.svg",label:"Cleaning Alt: Broom"},{value:"/category-icons/cleaning-alt-sparkles.svg",label:"Cleaning Alt: Sparkles"},{value:"/category-icons/moving.svg",label:"Moving & Transport"},{value:"/category-icons/moving-alt-bus.svg",label:"Moving Alt: Bus"},{value:"/category-icons/moving-alt-train.svg",label:"Moving Alt: Train"},{value:"/category-icons/tutoring.svg",label:"Tutoring & Education"},{value:"/category-icons/tutoring-alt-book-open.svg",label:"Tutoring Alt: Book Open"},{value:"/category-icons/tutoring-alt-notebook.svg",label:"Tutoring Alt: Notebook"},{value:"/category-icons/it.svg",label:"IT & Technology"},{value:"/category-icons/it-alt-monitor.svg",label:"IT Alt: Monitor"},{value:"/category-icons/it-alt-settings.svg",label:"IT Alt: Settings"},{value:"/category-icons/design.svg",label:"Design"},{value:"/category-icons/design-alt-brush.svg",label:"Design Alt: Brush"},{value:"/category-icons/design-alt-paintbrush.svg",label:"Design Alt: Paintbrush"},{value:"/category-icons/beauty.svg",label:"Beauty & Health"},{value:"/category-icons/beauty-alt-heart.svg",label:"Beauty Alt: Heart"},{value:"/category-icons/beauty-alt-stethoscope.svg",label:"Beauty Alt: Stethoscope"},{value:"/category-icons/tech-repair.svg",label:"Device Repair"},{value:"/category-icons/tech-repair-alt-smartphone.svg",label:"Device Repair Alt: Smartphone"},{value:"/category-icons/tech-repair-alt-wrench.svg",label:"Device Repair Alt: Wrench"},{value:"/category-icons/events.svg",label:"Events"},{value:"/category-icons/events-alt-calendar.svg",label:"Events Alt: Calendar"},{value:"/category-icons/events-alt-clock.svg",label:"Events Alt: Clock"},{value:"/category-icons/photo-video.svg",label:"Photo & Video"},{value:"/category-icons/photo-video-alt-image.svg",label:"Photo & Video Alt: Image"},{value:"/category-icons/photo-video-alt-video.svg",label:"Photo & Video Alt: Video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/pets-alt-dog.svg",label:"Pets Alt: Dog"},{value:"/category-icons/pets-alt-cat.svg",label:"Pets Alt: Cat"},{value:"/category-icons/auto.svg",label:"Automotive"},{value:"/category-icons/auto-alt-carfront.svg",label:"Automotive Alt: Car Front"},{value:"/category-icons/auto-alt-car.svg",label:"Automotive Alt: Car"},{value:"/category-icons/legal.svg",label:"Legal Services"},{value:"/category-icons/legal-alt-gavel.svg",label:"Legal Alt: Gavel"},{value:"/category-icons/legal-alt-landmark.svg",label:"Legal Alt: Landmark"},{value:"/category-icons/accounting.svg",label:"Accounting"},{value:"/category-icons/accounting-alt-receipt.svg",label:"Accounting Alt: Receipt"},{value:"/category-icons/accounting-alt-wallet.svg",label:"Accounting Alt: Wallet"},{value:"/category-icons/other.svg",label:"Other"},{value:"/category-icons/other-alt-briefcase.svg",label:"Other Alt: Briefcase"},{value:"/category-icons/other-alt-search.svg",label:"Other Alt: Search"}];function b(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 f(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 y(e){let{value:t,onChange:a,onUpload:l,uploading:n,error:r,presets:i}=e;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,s.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-green-50",children:(0,s.jsx)(u.Ez,{icon:t,alt:"category icon",className:"h-9 w-9 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,s.jsx)("input",{value:t,onChange:e=>a(e.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"/category-icons/package.svg"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(n?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),children:[n?"Uploading...":"Upload SVG",(0,s.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:n,onChange:async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&(await l(a),e.target.value="")}})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"or choose from presets"})]}),(0,s.jsx)("p",{className:"text-[11px] text-gray-500",children:"Preset source: /public/category-icons/presets.json"}),r?(0,s.jsx)("p",{className:"text-xs text-red-600",children:r}):null,(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:i.map(e=>{let l=t===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:"flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(l?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"),"aria-label":e.label,title:e.label,children:[(0,s.jsx)(u.Ez,{icon:e.value,alt:e.label,className:"h-8 w-8 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight",children:e.label})]},e.value)})})]})}function v(e){let{catRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=t.filter(e=>!e.parentId),f=c.toLowerCase(),y=e=>{var t;return!c||b(e,a).toLowerCase().includes(f)||(null!=(t=e.slug)?t:"").toLowerCase().includes(f)};return(0,s.jsxs)("div",{className:"relative",ref:p,children:[(0,s.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,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.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,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.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"})}),h.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=b(e,a),o=x===e.id,p=l.filter(e=>!n.includes(e.slug)&&y(e)),h=!n.includes(e.slug)&&y(e),f=l.length>0;return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.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:()=>{f&&!c?g(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[e.icon?(0,s.jsx)(u.Ez,{icon:e.icon,alt:i,className:"h-5 w-5 shrink-0 object-contain text-sm leading-none",fallback:"\uD83D\uDCE6"}):null,(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),f&&!c?(0,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.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,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:b(e,a)})]},e.id))]},e.id)})]})]})}function j(e){let{locRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let p=t.filter(e=>!e.parentId),h=c.toLowerCase(),b=e=>{var t;return!c||f(e,a).toLowerCase().includes(h)||(null!=(t=e.slug)?t:"").toLowerCase().includes(h)};return(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.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,s.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,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.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,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.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"})}),p.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=f(e,a),o=x===e.id,g=l.length>0,p=l.filter(e=>!n.includes(e.slug)&&b(e)),h=!n.includes(e.slug)&&b(e);return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.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:()=>{g&&!c?u(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.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,s.jsx)("span",{className:"flex-1 font-medium",children:i}),g&&!c?(0,s.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,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.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,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f(e,a)})]},e.id))]},e.id)})]})]})}function N(){var e,t,a,r,u,N,_,S,L,M,T,I,R,W,z,P,F,H,V,O,K,q,G,X,Y,J,$,Q,Z,ee,et,ea,es,el,en;let er=(0,n.useRouter)(),{data:ei,isPending:eo}=(0,o.wV)(),{t:ed,locale:ec}=(0,d.Y)(),[em,ex]=(0,l.useState)("stats"),[eu,eg]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eg(window.innerWidth<1024)},[]);let[ep,eh]=(0,l.useState)(null),[eb,ef]=(0,l.useState)([]),[ey,ev]=(0,l.useState)(1),[ej,eN]=(0,l.useState)(0),[ek,ew]=(0,l.useState)(""),[eC,e_]=(0,l.useState)(""),[eS,eL]=(0,l.useState)(""),[eE,eD]=(0,l.useState)([]),[eM,eA]=(0,l.useState)(1),[eB,eT]=(0,l.useState)(0),[eI,eU]=(0,l.useState)(""),[eR,eW]=(0,l.useState)(""),[ez,eP]=(0,l.useState)(""),[eF,eH]=(0,l.useState)([]),[eV,eO]=(0,l.useState)(1),[eK,eq]=(0,l.useState)(0),[eG,eX]=(0,l.useState)([]),[eY,eJ]=(0,l.useState)(1),[e$,eQ]=(0,l.useState)(0),[eZ,e0]=(0,l.useState)(""),[e2,e1]=(0,l.useState)(""),[e4,e5]=(0,l.useState)(""),[e3,e6]=(0,l.useState)(""),[e7,e8]=(0,l.useState)(null),[e9,te]=(0,l.useState)(""),[tt,ta]=(0,l.useState)(!1),[ts,tl]=(0,l.useState)([]),[tn,tr]=(0,l.useState)(1),[ti,to]=(0,l.useState)(0),[td,tc]=(0,l.useState)([]),[tm,tx]=(0,l.useState)(0),[tu,tg]=(0,l.useState)(1),[tp,th]=(0,l.useState)(""),[tb,tf]=(0,l.useState)(""),[ty,tv]=(0,l.useState)(""),[tj,tN]=(0,l.useState)(""),[tk,tw]=(0,l.useState)([]),[tC,t_]=(0,l.useState)([]),[tS,tL]=(0,l.useState)(0),[tE,tD]=(0,l.useState)(1),[tM,tA]=(0,l.useState)(""),[tB,tT]=(0,l.useState)(""),[tI,tU]=(0,l.useState)(""),[tR,tW]=(0,l.useState)([]),[tz,tP]=(0,l.useState)("ai"),[tF,tH]=(0,l.useState)([]),[tV,tO]=(0,l.useState)(1),[tK,tq]=(0,l.useState)(0),[tG,tX]=(0,l.useState)(""),[tY,tJ]=(0,l.useState)([]),[t$,tQ]=(0,l.useState)(""),[tZ,t0]=(0,l.useState)(""),[t2,t1]=(0,l.useState)([]),[t4,t5]=(0,l.useState)([]),[t3,t6]=(0,l.useState)([]),[t7,t8]=(0,l.useState)(0),[t9,ae]=(0,l.useState)(1),[at,aa]=(0,l.useState)(""),[as,al]=(0,l.useState)(""),[an,ar]=(0,l.useState)(!1),[ai,ao]=(0,l.useState)(!1),[ad,ac]=(0,l.useState)(null),[am,ax]=(0,l.useState)(!1),[au,ag]=(0,l.useState)(!1),[ap,ah]=(0,l.useState)("profile"),[ab,af]=(0,l.useState)(null),[ay,av]=(0,l.useState)(""),[aj,aN]=(0,l.useState)([]),[ak,aw]=(0,l.useState)(!1),[aC,a_]=(0,l.useState)({}),[aS,aL]=(0,l.useState)({}),[aE,aD]=(0,l.useState)({}),[aM,aA]=(0,l.useState)({}),[aB,aT]=(0,l.useState)([]),[aI,aU]=(0,l.useState)(null),[aR,aW]=(0,l.useState)(!1),[az,aP]=(0,l.useState)([]),[aF,aH]=(0,l.useState)(null),[aV,aO]=(0,l.useState)(!1),[aK,aq]=(0,l.useState)(new Set),[aG,aX]=(0,l.useState)([]),[aY,aJ]=(0,l.useState)(null),[a$,aQ]=(0,l.useState)(!1),[aZ,a0]=(0,l.useState)(new Set),[a2,a1]=(0,l.useState)(!1),[a4,a5]=(0,l.useState)(null),[a3,a6]=(0,l.useState)(h),[a7,a8]=(0,l.useState)(new Set),[a9,se]=(0,l.useState)({}),[st,sa]=(0,l.useState)(new Set),[ss,sl]=(0,l.useState)(null),[sn,sr]=(0,l.useState)(!1),[si,so]=(0,l.useState)("general"),[sd,sc]=(0,l.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:""}),[sm,sx]=(0,l.useState)(!1),[su,sg]=(0,l.useState)(!1),[sp,sh]=(0,l.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[sb,sf]=(0,l.useState)(!1),[sy,sv]=(0,l.useState)(!1),[sj,sN]=(0,l.useState)(!1),[sk,sw]=(0,l.useState)(null),[sC,s_]=(0,l.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}}

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