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

2 lines
6.4 KiB
JavaScript
Raw Normal View History

2025-08-27 20:20:03 +03:30
import{d as g,C as u,du as V,a1 as L,J as U,k as N,r as h,a0 as j,o as R,y,z as c,a2 as F,d$ as O,ad as E,a3 as k,A as l,B as S,u as J,H as G,d3 as K,e0 as Q,e1 as X,F as w,D as I,I as p,S as Y,U as Z,e2 as ee}from"./BAjARngS.js";import{b as x,c as b,h as z,w as $,m as D,k as te,t as W,l as ae}from"./QwKuTeKk.js";import{s as se}from"./uUV3bd9I.js";import{_ as re}from"./bZLhHpjY.js";import{B as A}from"./sroyubh1.js";import{U as ne}from"./7dlk9GfV.js";import{B as oe}from"./3l5V6q_Q.js";import{_ as M}from"./DlAUqK2U.js";import"./DWEdiVkG.js";import"./Ca60TAIM.js";import"./BvUK-b93.js";import"./dWia4Hno.js";import"./DyeV-5jh.js";import"./D8uJfFT-.js";import"./CokIlSLI.js";import"./DX3u28oT.js";import"./D6qJbdzf.js";import"./DSADCaFZ.js";const[le,ie]=b("skeleton-title"),ue={round:Boolean,titleWidth:x};var ce=g({name:le,props:ue,setup(e){return()=>u("h3",{class:ie([{round:e.round}]),style:{width:z(e.titleWidth)}},null)}});const de=$(ce);var ve=de;const[me,fe]=b("skeleton-avatar"),he={avatarSize:x,avatarShape:D("round")};var _e=g({name:me,props:he,setup(e){return()=>u("div",{class:fe([e.avatarShape]),style:te(e.avatarSize)},null)}});const pe=$(_e);var ge=pe;const T="100%",we={round:Boolean,rowWidth:{type:x,default:T}},[ye,ke]=b("skeleton-paragraph");var xe=g({name:ye,props:we,setup(e){return()=>u("div",{class:ke([{round:e.round}]),style:{width:e.rowWidth}},null)}});const Se=$(xe);var be=Se;const[Ce,P]=b("skeleton"),$e="60%",Te={row:ae(0),round:Boolean,title:Boolean,titleWidth:x,avatar:Boolean,avatarSize:x,avatarShape:D("round"),loading:W,animate:W,rowWidth:{type:[Number,String,Array],default:T}};var Be=g({name:Ce,inheritAttrs:!1,props:Te,setup(e,{slots:i,attrs:a}){const m=()=>{if(e.avatar)return u(ge,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},d=()=>{if(e.title)return u(ve,{round:e.round,titleWidth:e.titleWidth},null)},f=n=>{const{rowWidth:t}=e;return t===T&&n===+e.row-1?$e:Array.isArray(t)?t[n]:t},r=()=>Array(+e.row).fill("").map((n,t)=>u(be,{key:t,round:e.round,rowWidth:z(f(t))},null)),_=()=>i.template?i.template():u(L,null,[m(),u("div",{class:P("content")},[d(),r()])]);return()=>{var n;return e.loading?u("div",V({class:P({animate:e.animate,round:e.round})},a),[_()]):(n=i.default)==null?void 0:n.call(i)}}});const Ie="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"},Pe=g({__name:"Conversation",props:{chatId:{}},setup(e,{expose:i}){const a=e,m=U(),d=N(()=>m.user),f=h([]),r=h(null),_=v=>new Date(v).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});async function n(){if(!a.chatId)return;const v=await O(a.chatId,1,1e3);f.value=Array.isArray(v)?v:v.data||[]}function t(){r.value&&E(()=>{const v=r.value;v.scrollTo({top:v.scrollHeight,behavior:"smooth"})})}return j(f,()=>{t()}),i({request:n,scrollToBottom:t}),R(async()=>{await n()}),(v,o)=>(c(),y("div",{class:"chat-container",ref_key:"chatContainer",ref:r},[(c(!0),y(L,null,F(f.value,s=>(c(),y("div",{key:s.id,class:k(["message",{sent:s.sender_id===d.value.id,received:s.sender_id!==d.value.id}])},[l("div",We,[l("p",null,S(s.text),1),l("span",Ae,S(_(s.created_at)),1)])],2))),128))],512))}}),Le=M(Pe,[["__scopeId","data-v-3b999e95"]]),Ue={class:"flex justify-between items-center w-full p4"},Ne={class:"flex items-center gap-5"},Re={key:0,class:"flex gap-24px items-center"},ze={class:"font-semibold flex items-center"},De={class:"flex font-200 text-xs items-center"},Me={dir:"ltr",class:"h-98vh pb-10 overflow-hidden"},qe=["alt"],He=g({__name:"index",setup(e){const i=J(),a=G(),m=U(),d=h(""),f=h(null),r=h(void 0);N(()=>a.sellerConfig?.store?.main&&m.user.id!==a.sellerConfig?.store?.id);const _=h(!1),n=h(!1),t=h(void 0);R(async()=>{try{if(_.value=!0,i.currentRoute.value.query?.id?.length){const o=await K(i.currentRoute.value.query?.id);m.user.id===o?.