/
opt
/
canhelp
/
apps
/
web
/
.next
/
static
/
chunks
/
app
/
tasks
/
[id]
/
/opt/canhelp/apps/web/.next/static/chunks/app/tasks/[id]
mkdir
upload
Name
Size
Mode
Actions
offer/
-
0755
rm
page-e7d5ebc3989f7880.js
36646
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/static/chunks/app/tasks/[id]/page-e7d5ebc3989f7880.js
(36646B)
(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&&e<t.length-1?e+1:e})};return window.addEventListener("keydown",e),()=>window.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"})})}),er<C.images.length-1&&(0,l.jsx)("button",{onClick:()=>ea(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","Send 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","Write to 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","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","Top specialists")}),(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","Status")}),(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()}]);
Save
cmd:
run