/opt/canhelp/apps/web/.next/cache/webpack/client-production
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/7.pack (1117926B)
wpc webpack/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