Files
appco_dist/.output/public/_nuxt/lfM2IgYh.js
T

2 lines
6.3 KiB
JavaScript
Raw Normal View History

2025-08-19 21:38:30 +03:30
import{d as w,C as u,dy as q,a2 as P,J as L,k as U,r as h,a1 as j,o as N,y as g,z as c,a3 as H,e3 as V,af as F,a4 as y,A as l,B as S,u as O,G as E,d7 as G,e4 as J,e5 as K,S as Q,H as p,F as k,D as X,ak as Y,U as Z,e6 as ee}from"./G_17LgpR.js";import{b as x,c as b,h as R,w as $,m as z,k as te,t as W,l as ae}from"./Dw8L1sWs.js";import{s as se}from"./DhlmvxCN.js";import{B as A}from"./DUAMdf4s.js";import{U as re}from"./wt3vyHO9.js";import{B as ne}from"./CkcKLo8L.js";import{_ as D}from"./DlAUqK2U.js";import"./DWEdiVkG.js";import"./DIbg4LFy.js";import"./DYXDK3m5.js";import"./ycclw7qJ.js";import"./ToDZsT2k.js";import"./C7wQ3vfD.js";import"./0dsigLwk.js";import"./CQrMt7-Q.js";import"./D6qJbdzf.js";import"./BFCKsLLk.js";const[oe,ie]=b("skeleton-title"),le={round:Boolean,titleWidth:x};var ue=w({name:oe,props:le,setup(e){return()=>u("h3",{class:ie([{round:e.round}]),style:{width:R(e.titleWidth)}},null)}});const ce=$(ue);var de=ce;const[ve,me]=b("skeleton-avatar"),fe={avatarSize:x,avatarShape:z("round")};var he=w({name:ve,props:fe,setup(e){return()=>u("div",{class:me([e.avatarShape]),style:te(e.avatarSize)},null)}});const _e=$(he);var pe=_e;const T="100%",ge={round:Boolean,rowWidth:{type:x,default:T}},[we,ye]=b("skeleton-paragraph");var ke=w({name:we,props:ge,setup(e){return()=>u("div",{class:ye([{round:e.round}]),style:{width:e.rowWidth}},null)}});const xe=$(ke);var Se=xe;const[be,I]=b("skeleton"),Ce="60%",$e={row:ae(0),round:Boolean,title:Boolean,titleWidth:x,avatar:Boolean,avatarSize:x,avatarShape:z("round"),loading:W,animate:W,rowWidth:{type:[Number,String,Array],default:T}};var Te=w({name:be,inheritAttrs:!1,props:$e,setup(e,{slots:i,attrs:s}){const m=()=>{if(e.avatar)return u(pe,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},d=()=>{if(e.title)return u(de,{round:e.round,titleWidth:e.titleWidth},null)},f=n=>{const{rowWidth:t}=e;return t===T&&n===+e.row-1?Ce:Array.isArray(t)?t[n]:t},r=()=>Array(+e.row).fill("").map((n,t)=>u(Se,{key:t,round:e.round,rowWidth:R(f(t))},null)),_=()=>i.template?i.template():u(P,null,[m(),u("div",{class:I("content")},[d(),r()])]);return()=>{var n;return e.loading?u("div",q({class:I({animate:e.animate,round:e.round})},s),[_()]):(n=i.default)==null?void 0:n.call(i)}}});const Be="data:image/svg+xml,%3csvg%20width='22'%20height='20'%20viewBox='0%200%2022%2020'%20fill='white'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.0031%201H1.00311L8.50311%208.5M21.0031%201L10.5031%2018.5L8.50311%208.5M21.0031%201L8.50311%208.5'%20stroke='%23733af9'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e",We={class:"message-bubble"},Ae={class:"time"},Ie=w({__name:"Conversation",props:{chatId:{}},setup(e,{expose:i}){const s=e,m=L(),d=U(()=>m.user),f=h([]),r=h(null),_=v=>new Date(v).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});async function n(){if(!s.chatId)return;const v=await V(s.chatId,1,1e3);f.value=Array.isArray(v)?v:v.data||[]}function t(){r.value&&F(()=>{const v=r.value;v.scrollTo({top:v.scrollHeight,behavior:"smooth"})})}return j(f,()=>{t()}),i({request:n,scrollToBottom:t}),N(async()=>{await n()}),(v,o)=>(c(),g("div",{class:"chat-container",ref_key:"chatContainer",ref:r},[(c(!0),g(P,null,H(f.value,a=>(c(),g("div",{key:a.id,class:y(["message",{sent:a.sender_id===d.value.id,received:a.sender_id!==d.value.id}])},[l("div",We,[l("p",null,S(a.text),1),l("span",Ae,S(_(a.created_at)),1)])],2))),128))],512))}}),Pe=D(Ie,[["__scopeId","data-v-3b999e95"]]),Le={class:"flex justify-between items-center w-full p4"},Ue={class:"flex items-center gap-5"},Ne={key:0,class:"flex gap-24px items-center"},Re={class:"font-semibold flex items-center"},ze={class:"flex font-200 text-xs items-center"},De={dir:"ltr",class:"h-98vh pb-10 overflow-hidden"},Me=["alt"],qe=w({__name:"index",setup(e){const i=O(),s=E(),m=L(),d=h(""),f=h(null),r=h(void 0);U(()=>s.sellerConfig?.store?.main&&m.user.id!==s.sellerConfig?.store?.id);const _=h(!1),n=h(!1),t=h(void 0);N(async()=>{try{if(_.value=!0,i.currentRoute.value.query?.id?.length){const o=await G(i.currentRoute.value.query?.id);m.user.id===o?.user1_id?r.value=o?.us