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

2 lines
8.7 KiB
JavaScript
Raw Normal View History

2026-02-01 17:38:39 +03:30
import{U as Se}from"./CTRz734b.js";import{d as ne,u as we,r as t,G as re,cY as ke,k as be,H as ue,o as ce,af as de,bb as Ce,$ as se,ae,ai as Ie,y as l,z as f,a0 as U,A as u,C as k,T as ve,D as A,a1 as V,bS as M,a5 as ie,J as o,S as w,B as $,F as X,cZ as De,c$ as Ee,d0 as Le}from"./D9_UoUeZ.js";import{B as Y}from"./iCGCN3gx.js";import{d as Te}from"./D0op4eIM.js";import{_ as He,C as $e,i as oe}from"./B764G_GY.js";import{S as Re,a as Pe}from"./DO-Hb-Mu.js";/* empty css */import{u as ze}from"./C2mfABpg.js";import{e as le}from"./Cr9IxpvL.js";import{r as Be}from"./MxBJO4oE.js";import{s as Me}from"./DeEXrm2I.js";import{_ as Ue}from"./DlAUqK2U.js";const Ae={class:"flex full_story z-400 justify-center"},Xe={key:0,class:"absolute w-full top-0 right-0 left-0 z-1000"},Ye={class:"flex items-center gap-2"},qe={class:"relative"},je={class:"w-2.5rem h-2.5rem rounded-full",alt:""},Ne={key:0,src:He,alt:"",class:"w-15px absolute right-0 bottom-0 bg-white rounded-full"},Oe={class:"text-gray-200 text-shadow text-xs"},We={class:"w-full"},Ve={key:0,class:"absolute w-full bottom-0 right-0 left-0 z-1000 flex items-center gap8 px5 functions_area"},Fe={class:"flex flex-col items-center gap-2 text-white functions-area basic-icon-old"},Ge={class:"text-xs text-red-6"},Je={class:"flex flex-col items-center gap-2 text-white functions-area basic-icon-old"},Ze={class:"text-xs"},Ke=ne({__name:"HighlightStories",props:{id:{},specifyId:{type:Boolean,default:!1},stories:{},highlightId:{},cover:{},title:{}},emits:["update:id","refresh"],setup(q,{emit:R}){const E=we();t();const h=t(null),i=t(0),n=t(0),b=t(0);t("");const c=re(),v=q,g=R,m=t([]),s=t(null),{direction:j,isSwiping:P}=ke(s);t(!1),t(!1),t(!1);const z=be(()=>{if(v.stories?.length)return v.stories[i.value]});let L;const N=ze();ue();const _=t(!1),y=t(!1);t(!1);let C,T=!1,B=0,a=!1;function S(e){c.isSeller?E.push({name:"add-story"}):E.push({name:"user_detail-id",params:{id:z.value?.id}})}function I(e){F=e.touches[0].clientY,B=e.touches[0].clientX,a=!1,T=!1,C=setTimeout(()=>{T=!0,a||fe(e)},300)}function p(e){a||setTimeout(()=>{a=!0,clearTimeout(C)},50)}function H(e){clearTimeout(C);const r=s.value?.querySelector(".account-detail-area"),d=s.value?.querySelector(".functions_area");r&&r.contains(e.target)||d&&d.contains(e.target)||(e.preventDefault(),!T&&!a?Q(e):me(e))}function fe(e){const r=s.value?.querySelector(".account-detail-area"),d=s.value?.querySelector(".functions_area");r&&r.contains(e.target)||d&&d.contains(e.target)||(e.preventDefault(),e.stopPropagation(),_.value=!0,O())}function me(e){e.preventDefault(),e.stopPropagation(),_.value&&Z(),_.value=!1}let F=0;function G(e){(e.touches[0]?.clientY??0)-F>0&&e.preventDefault()}ce(()=>{i.value=v.stories?.findIndex(e=>e?.media?.id===v.id),h.value.activeIndex=i.value,i.value===0&&J(),s.value?.addEventListener("touchstart",I),s.value?.addEventListener("touchend",H),s.value?.addEventListener("touchmove",p),s.value?.addEventListener("touchcancel",H),s.value?.addEventListener("touchmove",G,{passive:!1})}),de(()=>{s.value?.removeEventListener("touchstart",I),s.value?.removeEventListener("touchend",H),s.value?.addEventListener("touchmove",p),s.value?.removeEventListener("touchcancel",H),s.value?.removeEventListener("touchmove",G)}),Ce(()=>{P.value&&j.value==="down"&&g("update:id",void 0)}),se(i,async e=>{await J()});async function J(){b.value=v.stories?.length,m.value=[],await ae(),h.value&&(h.value.activeIndex=i.value);for(let e=0;e<b.value;e++)m.value.push(0);O(),Z()}const he=e=>{h.value=e,y.value=!0},pe=e=>{if(!y.value)return;const r=e?.activeIndex;n.value!==r&&(n.value=r)};function Z(){L=Me(()=>{n.value<m.value.length&&(m.value[n.value]+=10,m.value[n.value]>100&&K())},1e3)}function O(){clearInterval(L),L=void 0}function K(){b.value>n.value+1?n.value++:(O(),n.value=0,_e())}function ge(){n.value!==0?n.value--:ye()}function _e(){v.specifyId?g("update:id",void 0):N.users.length>i.value+1?i.value++:g("update:id",void 0)}function Q(e){if(e.target.closest(".basic-icon-old"))return;const d=s.value?.querySelector(".account-detail-area"),x=s.value?.querySelecto