PageSourceSearch

https://salonify.mx/_next/static/chunks/app/dashboard/resenas/page-696653014b32fb71.js

js salonify.mx collected 2026-10-02 00:24:49 UTC 12,637 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8447],{4873:(e,s,t)=>{"use strict";var l=t(12115).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;s.c=function(e){return l.H.useMemoCache(e)}},6251:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let l=t(52707).A.create({baseURL:"https://salonify.mx/api",headers:{"Content-Type":"application/json"}});l.interceptors.request.use(e=>{{let s=localStorage.getItem("salonify_token");s&&(e.headers.Authorization=`Bearer ${s}`)}return e.data instanceof FormData&&e.headers.delete("Content-Type"),e}),l.interceptors.response.use(e=>e,e=>{if(e.response?.status===401){let s=e.config?.url||"";s.includes("/auth/login")||s.includes("/auth/register")||(localStorage.removeItem("salonify_token"),localStorage.removeItem("salonify_user"),window.location.href="/login")}return Promise.reject(e)});let a=l},19749:(e,s,t)=>{"use strict";e.exports=t(4873)},34325:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>d});var l=t(95155),a=t(12115),r=t(6251),n=t(42997),i=t(74940);let o=[{value:"inappropriate",label:"Contenido inapropiado"},{value:"aggression",label:"Agresiones o lenguaje ofensivo"},{value:"not_my_venue",label:"No corresponde a mi sal\xf3n"},{value:"false_info",label:"Informaci\xf3n falsa"},{value:"other",label:"Otro motivo"}];function c({review:e,onClose:s,onReported:t}){let[n,i]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[x,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),h=async()=>{if(!n)return void u("Selecciona un motivo");m(!0),u("");try{await r.A.post(`/reviews/${e.id}/report`,{reason:n,description:c.trim()||void 0}),t(e.id),s()}catch(e){u(e?.response?.data?.message||"Error al enviar el reporte")}finally{m(!1)}};return(0,l.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,l.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md p-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsx)("h3",{className:"text-base font-bold text-gray-900",children:"Reportar rese\xf1a"}),(0,l.jsx)("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 text-gray-400",children:"✕"})]}),(0,l.jsxs)("div",{className:"bg-gray-50 rounded-xl p-3 mb-4",children:[(0,l.jsx)("div",{className:"flex gap-0.5 mb-1",children:[1,2,3,4,5].map(s=>(0,l.jsx)("span",{style:{color:s<=e.rating?"#F5B700":"#D1D5DB"},children:"★"},s))}),e.comment&&(0,l.jsx)("p",{className:"text-sm text-gray-600 line-clamp-2",children:e.comment}),(0,l.jsxs)("p",{className:"text-xs text-gray-400 mt-1",children:["— ",e.client?.name]})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Motivo del reporte"}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:o.map(e=>(0,l.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"reason",value:e.value,checked:n===e.value,onChange:()=>i(e.value),className:"accent-purple-600"}),(0,l.jsx)("span",{className:"text-sm text-gray-700",children:e.label})]},e.value))})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:["Descripci\xf3n ",(0,l.jsx)("span",{className:"font-normal text-gray-400",children:"(opcional)"})]}),(0,l.jsx)("textarea",{value:c,onChange:e=>d(e.target.value),rows:3,maxLength:500,placeholder:"Explica brevemente el motivo del reporte...",className:"w-full border border-gray-200 rounded-xl px-3 py-2 text-sm focus:outline-none focus:border-purple-400 resize-none"})]}),p&&(0,l.jsx)("p",{className:"text-sm text-red-500 mb-3",children:p}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{onClick:s,className:"flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-semibold text-gray-600 hover:bg-gray-50",children:"Cancelar"}),(0,l.jsx)("button",{onClick:h,disabled:x||!n,className:"flex-1 py-2.5 rounded-xl text-sm font-bold text-white disabled:opacity-50",style:{background:"#FF4D6D"},children:x?"Enviando...":"Enviar reporte"})]})]})})}function d(){let{venue:e}=(0,a.useContext)(n.u),[s,t]=(0,a.useState)([]),[o,d]=(0,a.useState)(!1),[x,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(""),[h,y]=(0,a.useState)(!1),[f,b]=(0,a.useState)(""),[g,j]=(0,a.useState)(null),[v,N]=(0,a.useState)(new Set);(0,a.useEffect)(()=>{e?.id&&(d(!0),r.A.get(`/reviews/owner/venue/${e.id}`).then(({data:e})=>t(e)).catch(()=>t([])).finally(()=>d(!1)))},[e?.id]);let w=()=>{m(null),u(""),b("")},E=async e=>{y(!0),b("");try{let{data:s}=await r.A.patch(`/reviews/${e}/reply`,{reply:p});t(t=>t.map(t=>
1t.id===e?{...t,ownerReply:s.ownerReply,ownerReplyAt:s.ownerReplyAt}:t)),m(null),u("")}catch(e){b(e.response?.data?.message||"Error al guardar la respuesta")}finally{y(!1)}},C=s.length?(s.reduce((e,s)=>e+s.rating,0)/s.length).toFixed(1):null;return(0,l.jsxs)("div",{className:"p-6 max-w-5xl",children:[(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h1",{className:"text-2xl font-black text-gray-900",children:"⭐ Rese\xf1as"}),e?.name&&(0,l.jsx)("p",{className:"text-sm mt-0.5",style:{color:"#6B6B6B"},children:e.name})]}),s.length>0&&(0,l.jsxs)("div",{className:"bg-white rounded-2xl p-5 mb-6 flex items-center gap-6",style:{border:"1px solid #E8E8E8"},children:[(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"text-4xl font-black text-gray-900",children:C}),(0,l.jsx)("div",{className:"flex justify-center gap-0.5 mt-1",children:[1,2,3,4,5].map(e=>(0,l.jsx)("span",{className:"text-lg",style:{color:e<=Math.round(Number(C))?"#F5B700":"#E5E7EB"},children:"★"},e))}),(0,l.jsx)("div",{className:"text-xs mt-1",style:{color:"#6B6B6B"},children:"promedio general"})]}),(0,l.jsx)("div",{className:"w-px h-12 bg-gray-100"}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"text-3xl font-black text-gray-900",children:s.length}),(0,l.jsx)("div",{className:"text-xs mt-1",style:{color:"#6B6B6B"},children:"rese\xf1as totales"})]}),(0,l.jsx)("div",{className:"w-px h-12 bg-gray-100"}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"text-3xl font-black",style:{color:"#6A3EF5"},children:s.filter(e=>e.ownerReply).length}),(0,l.jsx)("div",{className:"text-xs mt-1",style:{color:"#6B6B6B"},children:"respondidas"})]})]}),o?(0,l.jsx)(i.A,{className:"py-16"}):0===s.length?(0,l.jsxs)("div",{className:"bg-white rounded-2xl p-10 text-center",style:{border:"1px solid #E8E8E8"},children:[(0,l.jsx)("div",{className:"text-4xl mb-3",children:"⭐"}),(0,l.jsx)("p",{className:"font-semibold text-gray-900 mb-1",children:"A\xfan no tienes rese\xf1as"}),(0,l.jsx)("p",{className:"text-sm",style:{color:"#6B6B6B"},children:"Cuando tus clientes dejen una rese\xf1a, aparecer\xe1 aqu\xed."})]}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:s.map(e=>(0,l.jsxs)("div",{className:"bg-white rounded-2xl p-5",style:{border:"1px solid #E8E8E8"},children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"w-9 h-9 rounded-full flex items-center justify-center text-sm font-bold text-white shrink-0",style:{background:"linear-gradient(135deg, #6A3EF5, #8B5CF6)"},children:e.client?.name?.charAt(0).toUpperCase()||"?"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:e.client?.name||"Cliente"}),(0,l.jsx)("p",{className:"text-xs",style:{color:"#9CA3AF"},children:new Date(e.createdAt).toLocaleDateString("es-MX",{year:"numeric",month:"long",day:"numeric"})})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,l.jsx)("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(s=>(0,l.jsx)("span",{className:"text-base",style:{color:s<=e.rating?"#F5B700":"#E5E7EB"},children:"★"},s))}),v.has(e.id)?(0,l.jsx)("span",{className:"text-xs font-medium px-2 py-1 rounded-lg",style:{background:"#FEF2F2",color:"#EF4444"},children:"Reportada"}):(0,l.jsx)("button",{onClick:()=>j(e),className:"text-xs font-medium px-2 py-1 rounded-lg hover:bg-red-50 transition-colors",style:{color:"#EF4444",border:"1px solid #FEE2E2"},title:"Reportar esta rese\xf1a",children:"⚑ Reportar"})]})]}),e.comment&&(0,l.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed mb-4",children:e.comment}),e.ownerReply&&x!==e.id&&(0,l.jsxs)("div",{className:"rounded-xl p-3 mb-3",style:{background:"#F5F3FF",border:"1px solid #EDE9FE"},children:[(0,l.jsx)("p",{className:"text-xs font-semibold mb-1",style:{color:"#6A3EF5"},children:"Tu respuesta"}),(0,l.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed",children:e.ownerReply}),e.ownerReplyAt&&(0,l.jsx)("p",{className:"text-xs mt-1",style:{color:"#9
1CA3AF"},children:new Date(e.ownerReplyAt).toLocaleDateString("es-MX",{year:"numeric",month:"short",day:"numeric"})})]}),x===e.id?(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)("textarea",{autoFocus:!0,value:p,onChange:e=>u(e.target.value),placeholder:"Escribe tu respuesta...",rows:3,className:"w-full border border-gray-300 rounded-xl px-4 py-2.5 text-sm focus:outline-none resize-none",style:{borderColor:"#6A3EF5"}}),f&&(0,l.jsx)("p",{className:"text-xs text-red-600 mt-1",children:f}),(0,l.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,l.jsx)("button",{onClick:w,className:"flex-1 py-2 rounded-xl border border-gray-200 text-sm font-semibold text-gray-600 hover:bg-gray-50 transition-colors",children:"Cancelar"}),(0,l.jsx)("button",{onClick:()=>E(e.id),disabled:h||!p.trim(),className:"flex-1 py-2 rounded-xl text-white text-sm font-bold disabled:opacity-50 transition-opacity",style:{background:"#6A3EF5"},children:h?"Guardando...":"Publicar respuesta"})]})]}):(0,l.jsx)("button",{onClick:()=>{m(e.id),u(e.ownerReply||""),b("")},className:"text-sm font-semibold transition-colors hover:underline",style:{color:"#6A3EF5"},children:e.ownerReply?"✏️ Editar respuesta":"\uD83D\uDCAC Responder"})]},e.id))}),g&&(0,l.jsx)(c,{review:g,onClose:()=>j(null),onReported:e=>N(s=>new Set([...s,e]))})]})}},42997:(e,s,t)=>{"use strict";t.d(s,{M:()=>r,u:()=>a});var l=t(12115);let a=(0,l.createContext)({venue:null,venues:[],selectVenue:()=>{},refetchVenues:async()=>{},patchVenue:()=>{}}),r=()=>(0,l.useContext)(a)},71169:(e,s,t)=>{Promise.resolve().then(t.bind(t,34325))},74940:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});var l=t(95155),a=t(19749);function r(e){let s,t,r,n,i=(0,a.c)(5),{className:o}=e,c=`flex flex-col items-center justify-center ${void 0===o?"py-20":o}`;return i[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,l.jsx)("style",{children:"\n        @keyframes pl-bounce {\n          0%, 100% { transform: translateY(0) scale(1); }\n          40%       { transform: translateY(-14px) scale(1.07); }\n          60%       { transform: translateY(-11px) scale(1.03); }\n        }\n        @keyframes pl-shadow {\n          0%, 100% { transform: scaleX(1); opacity: 0.25; }\n          40%       { transform: scaleX(0.45); opacity: 0.08; }\n          60%       { transform: scaleX(0.6); opacity: 0.14; }\n        }\n        .pl-pin  { animation: pl-bounce 1s cubic-bezier(.4,0,.2,1) infinite; }\n        .pl-shad { animation: pl-shadow 1s cubic-bezier(.4,0,.2,1) infinite; }\n      "}),i[0]=s):s=i[0],i[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)("div",{className:"pl-pin",children:(0,l.jsxs)("svg",{width:"32",height:"42",viewBox:"0 0 32 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("defs",{children:(0,l.jsxs)("linearGradient",{id:"pl-grad",x1:"0",y1:"0",x2:"1",y2:"0",children:[(0,l.jsx)("stop",{offset:"0%",stopColor:"#4a9fd7"}),(0,l.jsx)("stop",{offset:"100%",stopColor:"#c97cb5"})]})}),(0,l.jsx)("path",{d:"M16 1C8.27 1 2 7.27 2 15C2 26 16 41 16 41C16 41 30 26 30 15C30 7.27 23.73 1 16 1Z",fill:"url(#pl-grad)"}),(0,l.jsx)("circle",{cx:"16",cy:"15",r:"6",fill:"white",fillOpacity:"0.18"}),(0,l.jsx)("circle",{cx:"16",cy:"15",r:"4.5",fill:"white"}),(0,l.jsx)("text",{x:"16",y:"18.5",textAnchor:"middle",fontFamily:"'DM Sans', sans-serif",fontWeight:"800",fontSize:"6.5",fill:"#4a9fd7",children:"S"})]})}),i[1]=t):t=i[1],i[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)("div",{className:"pl-shad",style:{width:16,height:4,borderRadius:"50%",background:"linear-gradient(to right, #4a9fd7, #c97cb5)",marginTop:2}}),i[2]=r):r=i[2],i[3]!==c?(n=(0,l.jsxs)("div",{className:c,children:[s,t,r]}),i[3]=c,i[4]=n):n=i[4],n}}},e=>{e.O(0,[2707,8441,4398,7358],()=>e(e.s=71169)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.