154 lines
9.9 KiB
JavaScript
154 lines
9.9 KiB
JavaScript
import { defineComponent, computed, ref, unref, mergeProps, useSSRContext } from 'vue';
|
|
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderClass, ssrInterpolate, ssrRenderList, ssrRenderStyle } from 'vue/server-renderer';
|
|
import { B as BasicIconOld } from './BasicIconOld-I4c2ShMu.mjs';
|
|
import { u as useRouter$1, a as useConfigStore, b as useUserStore, n as useIntersectionObserver } from './server.mjs';
|
|
import { _ as _sfc_main$3 } from './SearchButton-hLqVoTUX.mjs';
|
|
import { U as UserProfilePic } from './UserProfilePic-DXA233hi.mjs';
|
|
import { g as getTimeLabel } from './useDateTime-D8RCoGwW.mjs';
|
|
import { orderBy } from 'lodash-es';
|
|
import { u as useChatStore } from './chatStore-CEJ4ipeC.mjs';
|
|
import './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
import '../_/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:url';
|
|
import 'consola';
|
|
import 'ipx';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'pinia';
|
|
import '@supabase/supabase-js';
|
|
import '@babel/runtime/helpers/esm/extends';
|
|
import '@babel/runtime/helpers/esm/objectSpread2';
|
|
import '@ant-design/colors';
|
|
import '@ctrl/tinycolor';
|
|
import 'stylis';
|
|
import 'vue-types';
|
|
import 'axios';
|
|
import '@ant-design/icons-vue';
|
|
import '../routes/renderer.mjs';
|
|
import 'vue-bundle-renderer/runtime';
|
|
import 'unhead/server';
|
|
import 'devalue';
|
|
import 'unhead/utils';
|
|
import 'unhead/plugins';
|
|
import './search_gray-B8huMSPA.mjs';
|
|
import './empty_user-BaUNCdgf.mjs';
|
|
import 'moment';
|
|
import 'moment-timezone';
|
|
import 'moment-jalaali';
|
|
import 'date-fns';
|
|
import 'date-fns/locale';
|
|
|
|
const _imports_0 = "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";
|
|
const _imports_1 = "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";
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
__name: "picture",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (unref(config).isNightStore) {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_0,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
} else {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: _imports_1,
|
|
alt: "comment",
|
|
"cursor-pointer": ""
|
|
}, _attrs))}>`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
_sfc_main$2.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/picture.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const router = useRouter$1();
|
|
const config = useConfigStore();
|
|
const userStore = useUserStore();
|
|
const chatStore = useChatStore();
|
|
const sortedChat = computed(() => orderBy(chatStore.chats, ["updated_at"], ["desc"]));
|
|
const observer = ref();
|
|
useIntersectionObserver(observer, ([{ isIntersecting }]) => {
|
|
if (isIntersecting) {
|
|
setTimeout(() => {
|
|
chatStore.request();
|
|
}, 100);
|
|
}
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
var _a;
|
|
_push(`<div${ssrRenderAttrs(_attrs)}><div class="${ssrRenderClass([" fixed w-full top-0 z-2", !unref(config).isNightStore ? "bg-header-color" : "bg-header-color-dark "])}"><div class="px-4 flex items-center justify-between"><div class="flex gap-5 py-4">`);
|
|
_push(ssrRenderComponent(BasicIconOld, {
|
|
icon: unref(config).isRTL ? "vuesax-linear:arrow-right" : "vuesax-linear:arrow-left",
|
|
onClick: ($event) => unref(router).back()
|
|
}, null, _parent));
|
|
_push(`<div class="font-semibold">${ssrInterpolate((_a = unref(userStore).user) == null ? void 0 : _a.name)}</div></div><div></div></div></div><div class="absolute top-4rem w-full px4">`);
|
|
_push(ssrRenderComponent(_sfc_main$3, null, null, _parent));
|
|
_push(`<div class="h-88vh mt-2 w-full"><!--[-->`);
|
|
ssrRenderList(sortedChat.value, (item) => {
|
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
_push(`<!--[-->`);
|
|
if (item.last_message) {
|
|
_push(`<div class="py-1.5 flex justify-between"><div class="flex items-center">`);
|
|
_push(ssrRenderComponent(UserProfilePic, {
|
|
width: "60",
|
|
"just-show-profile": "",
|
|
src: ((_a2 = item.user1) == null ? void 0 : _a2.id) === ((_b = unref(userStore).user) == null ? void 0 : _b.id) ? (_c = item.user2) == null ? void 0 : _c.avatar : (_d = item.user1) == null ? void 0 : _d.avatar
|
|
}, null, _parent));
|
|
_push(`<div class="${ssrRenderClass([unref(config).isRTL ? "" : "", "py-2.5 ps-3"])}"><div class="text-sm">${ssrInterpolate(((_e = item.user1) == null ? void 0 : _e.id) === ((_f = unref(userStore).user) == null ? void 0 : _f.id) ? (_g = item.user2) == null ? void 0 : _g.name : (_h = item.user1) == null ? void 0 : _h.name)}</div><div class="flex"><span class="text-xs text-gray">${ssrInterpolate((_i = item.last_message) == null ? void 0 : _i.text.slice(0, 40))}${ssrInterpolate(((_j = item.last_message) == null ? void 0 : _j.text.length) > 40 ? "..." : "")}</span><span class="text-xs ms-1 text-gray-400">${ssrInterpolate(unref(getTimeLabel)((_k = item.last_message) == null ? void 0 : _k.created_at))}</span></div></div></div><div class="flex items-center gap-4">`);
|
|
if (((_l = unref(userStore).user) == null ? void 0 : _l.id) !== ((_m = item.last_message) == null ? void 0 : _m.sender_id) && !((_n = item.last_message) == null ? void 0 : _n.is_read)) {
|
|
_push(`<div class="bg-blue-6 w-2 h-2 rounded-full"></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(ssrRenderComponent(_sfc_main$2, null, null, _parent));
|
|
_push(`</div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<!--]-->`);
|
|
});
|
|
_push(`<!--]--><div style="${ssrRenderStyle(!unref(chatStore).loading ? null : { display: "none" })}" class="w-full opacity-0 relative"> load </div></div></div></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
_sfc_main$1.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/direct/list/index.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "list",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(ssrRenderComponent(_sfc_main$1, _attrs, null, _parent));
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/message/list.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|
|
//# sourceMappingURL=list-ntLLreI0.mjs.map
|