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

2 lines
6.9 KiB
JavaScript

import{an as k,ao as v,ap as m,aq as h,ar as H,as as M,d as x,G as b,y as p,H as d,z as f,u as B,J as V,k as S,o as Z,r as $,a5 as A,A as u,C as g,B as C,a4 as w,a7 as T,a2 as L,a3 as q,a8 as U,S as y,F as j}from"./G_17LgpR.js";import{B as z}from"./DUAMdf4s.js";import{S as O}from"./DqP7KSxU.js";import{U as E}from"./wt3vyHO9.js";import{g as F}from"./C3gkR5pj.js";import{u as G}from"./C4Ug3Wxc.js";import{b as P}from"./Cj6r251q.js";import{b as J}from"./sF8d7sFa.js";import{i as N}from"./WndnksDi.js";import"./DlAUqK2U.js";import"./BgR2E6gQ.js";import"./DWEdiVkG.js";import"./SY11ehhM.js";import"./Bly7rU0x.js";import"./DBmCMGoE.js";function K(s,e){var t=-1,n=k(s)?Array(s.length):[];return J(s,function(a,r,l){n[++t]=e(a,r,l)}),n}function Q(s,e){var t=s.length;for(s.sort(e);t--;)s[t]=s[t].value;return s}function R(s,e){if(s!==e){var t=s!==void 0,n=s===null,a=s===s,r=v(s),l=e!==void 0,_=e===null,i=e===e,o=v(e);if(!_&&!o&&!r&&s>e||r&&l&&i&&!_&&!o||n&&l&&i||!t&&i||!a)return 1;if(!n&&!r&&!o&&s<e||o&&t&&a&&!n&&!r||_&&t&&a||!l&&a||!i)return-1}return 0}function W(s,e,t){for(var n=-1,a=s.criteria,r=e.criteria,l=a.length,_=t.length;++n<l;){var i=R(a[n],r[n]);if(i){if(n>=_)return i;var o=t[n];return i*(o=="desc"?-1:1)}}return s.index-e.index}function X(s,e,t){e.length?e=m(e,function(r){return h(r)?function(l){return H(l,r.length===1?r[0]:r)}:r}):e=[N];var n=-1;e=m(e,M(P));var a=K(s,function(r,l,_){var i=m(e,function(o){return o(r)});return{criteria:i,index:++n,value:r}});return Q(a,function(r,l){return W(r,l,t)})}function Y(s,e,t,n){return s==null?[]:(h(e)||(e=e==null?[]:[e]),t=t,h(t)||(t=t==null?[]:[t]),X(s,e,t))}const D="data:image/svg+xml,%3csvg%20width='24'%20height='22'%20viewBox='0%200%2024%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2808%200.915938C15.9125%200.344954%2015.2795%200%2014.6001%200H8.90167C8.22264%200%207.58999%200.344534%207.2216%200.914949L6.17045%202.54253C5.98626%202.82773%205.66993%203%205.33041%203H4.5C2.01472%203%200%205.01472%200%207.5V17.5C0%2019.9853%202.01472%2022%204.5%2022H19C21.4853%2022%2023.5%2019.9853%2023.5%2017.5V7.5C23.5%205.01472%2021.4853%203%2019%203H18.17L18.0439%202.99203C17.7532%202.95511%2017.4907%202.79184%2017.3296%202.54203L16.2808%200.915938ZM8.90167%201.5H14.6001C14.7699%201.5%2014.9282%201.58624%2015.0202%201.72898L16.0691%203.35508C16.4698%203.97643%2017.1242%204.38728%2017.8549%204.48008L18.0754%204.49701L19%204.5C20.6569%204.5%2022%205.84315%2022%207.5V17.5C22%2019.1569%2020.6569%2020.5%2019%2020.5H4.5C2.84315%2020.5%201.5%2019.1569%201.5%2017.5V7.5C1.5%205.84315%202.84315%204.5%204.5%204.5H5.33041C6.17921%204.5%206.97002%204.06933%207.43051%203.35631L8.48166%201.72874C8.57375%201.58613%208.73192%201.5%208.90167%201.5ZM11.75%206.5C14.9256%206.5%2017.5%209.07436%2017.5%2012.25C17.5%2015.4256%2014.9256%2018%2011.75%2018C8.57436%2018%206%2015.4256%206%2012.25C6%209.07436%208.57436%206.5%2011.75%206.5ZM7.5%2012.25C7.5%209.90279%209.40279%208%2011.75%208C14.0972%208%2016%209.90279%2016%2012.25C16%2014.5972%2014.0972%2016.5%2011.75%2016.5C9.40279%2016.5%207.5%2014.5972%207.5%2012.25Z'%20fill='white'%20fill-opacity='1'/%3e%3c/svg%3e",I="data:image/svg+xml,%3csvg%20width='24'%20height='22'%20viewBox='0%200%2024%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2808%200.915938C15.9125%200.344954%2015.2795%200%2014.6001%200H8.90167C8.22264%200%207.58999%200.344534%207.2216%200.914949L6.17045%202.54253C5.98626%202.82773%205.66993%203%205.33041%203H4.5C2.01472%203%200%205.01472%200%207.5V17.5C0%2019.9853%202.01472%2022%204.5%2022H19C21.4853%2022%2023.5%2019.9853%2023.5%2017.5V7.5C23.5%205.01472%2021.4853%203%2019%203H18.17L18.0439%202.99203C17.7532%202.95511%2017.4907%202.79184%2017.3296%202.54203L16.2808%200.915938ZM8.90167%201.5H14.6001C14.7699%201.5%2014.9282%201.58624%2015.0202%201.72898L16.0691%203.35508C16.4698%203.97643%2017.1242%204.38728%2017.8549%204.48008L18.0754%204.49701L19%204.5C20.6569%204.5%2022%205.84315%2022%207.5V17.5C22%2019.1569%2020.6569%2020.5%2019%2020.5H4.5C2.84315%2020.5%201.5%2019.1569%201.5%2017.5V7.5C1.5%205.84315%202.84315%204.5%204.5%204.5H5.33041C6.17921%204.5%206.97002%204.06933%207.43051%203.35631L8.48166%201.72874C8.57375%201.58613%208.73192%201.5%208.90167%201.5ZM11.75%206.5C14.9256%206.5%2017.5%209.07436%2017.5%2012.25C17.5%2015.4256%2014.9256%2018%2011.75%2018C8.57436%2018%206%2015.4256%206%2012.25C6%209.07436%208.57436%206.5%2011.75%206.5ZM7.5%2012.25C7.5%209.90279%209.40279%208%2011.75%208C14.0972%208%2016%209.90279%2016%2012.25C16%2014.5972%2014.0972%2016.5%2011.75%2016.5C9.40279%2016.5%207.5%2014.5972%207.5%2012.25Z'%20fill='black'%20fill-opacity='1'/%3e%3c/svg%3e",e2={key:0,src:D,alt:"comment","cursor-pointer":""},s2={key:1,src:I,alt:"comment","cursor-pointer":""},t2=x({__name:"picture",setup(s){const e=b();return(t,n)=>d(e).isNightStore?(f(),p("img",e2)):(f(),p("img",s2))}}),n2={class:"px-4 flex items-center justify-between"},r2={class:"flex gap-5 py-4"},a2={class:"font-semibold"},i2={class:"absolute top-4rem w-full px4"},o2={class:"h-88vh mt-2 w-full"},c2=["onClick"],u2={class:"flex items-center"},l2={class:"text-sm"},d2={class:"flex"},_2={class:"text-xs text-gray"},f2={class:"text-xs ms-1 text-gray-400"},p2={class:"flex items-center gap-4"},C2={key:0,class:"bg-blue-6 w-2 h-2 rounded-full"},g2=x({__name:"index",setup(s){const e=B(),t=b(),n=V(),a=G(),r=S(()=>Y(a.chats,["updated_at"],["desc"]));Z(()=>{a.request()});function l(i){if(n.unReadMessage?.length){const o=n.unReadMessage?.findIndex(c=>c?.chat_id===i);o>-1&&n.unReadMessage?.splice(o,1)}e.push({name:"message-detail_message",query:{id:i}})}const _=$();return A(_,([{isIntersecting:i}])=>{i&&setTimeout(()=>{a.request()},100)}),(i,o)=>(f(),p("div",null,[u("div",{class:w([" fixed w-full top-0 z-2",d(t).isNightStore?"bg-header-color-dark ":"bg-header-color"])},[u("div",n2,[u("div",r2,[g(z,{icon:d(t).isRTL?"vuesax-linear:arrow-right":"vuesax-linear:arrow-left",onClick:o[0]||(o[0]=c=>d(e).back())},null,8,["icon"]),u("div",a2,C(d(n).user?.name),1)]),o[1]||(o[1]=u("div",null,null,-1))])],2),u("div",i2,[g(O),u("div",o2,[(f(!0),p(L,null,q(r.value,c=>(f(),p(L,null,[c.last_message?(f(),p("div",{key:0,class:"py-1.5 flex justify-between",onClick:m2=>l(c.chat_id)},[u("div",u2,[g(E,{width:"60","just-show-profile":"",src:c.user1?.id===d(n).user?.id?c.user2?.avatar:c.user1?.avatar},null,8,["src"]),u("div",{class:w(["py-2.5 ps-3",(d(t).isRTL,"")])},[u("div",l2,C(c.user1?.id===d(n).user?.id?c.user2?.name:c.user1?.name),1),u("div",d2,[u("span",_2,C(c.last_message?.text.slice(0,40))+C(c.last_message?.text.length>40?"...":""),1),u("span",f2,C(d(F)(c.last_message?.created_at)),1)])],2)]),u("div",p2,[d(n).user?.id!==c.last_message?.sender_id&&!c.last_message?.is_read?(f(),p("div",C2)):y("",!0),g(t2)])],8,c2)):y("",!0)],64))),256)),T(u("div",{ref_key:"observer",ref:_,class:"w-full opacity-0 relative"}," load ",512),[[U,!d(a).loading]])])])]))}}),A2=x({__name:"list",setup(s){return(e,t)=>(f(),j(g2))}});export{A2 as default};