Files
tehran_taj/apps/user-app-v2/dist/assets/SingleProduct-DZ0GfNfe.js
T

2 lines
14 KiB
JavaScript
Raw Normal View History

2026-09-18 19:58:29 +03:30
import{d as me,ac as Re,a as be,f as l,c as o,b as t,n as qe,F as G,r as H,t as i,e as c,z as Oe,i as $,ad as _e,g as m,h as n,_ as he,m as ke,E as De,B as Fe,u as w,j as X,q as z,l as d,I as _,C as R,ae as Me,X as pe,T as Ve,v as Be,s as Le}from"./index-BT7xV2no.js";import{a as Xe}from"./Spinner.vue_vue_type_style_index_0_lang-8OYvKGCr.js";import{_ as Ae}from"./NotifyVant.vue_vue_type_script_setup_true_lang-Djtd_P1R.js";import{_ as Ue}from"./DialogVant.vue_vue_type_style_index_0_lang-Cjj-7TcQ.js";import{a as Ee,u as Ne}from"./cartStore-osKaVnJ_.js";import{a as je}from"./client-WIBW0tF5.js";import{l as Ge}from"./dialogEmpty1-Caw7F5KL.js";const He=["src","alt"],Qe={key:0,class:"gs__counter"},fe=.18,We=6,Je=me({__name:"GallerySlider",props:_e({slides:{},alt:{},fit:{default:"cover"},showCounter:{type:Boolean,default:!1}},{index:{default:0},indexModifiers:{}}),emits:_e(["tap"],["update:index"]),setup(v,{emit:x}){const h=v,f=Re(v,"index"),P=x,O=n(()=>h.fit==="contain"?"gs__img--contain":"gs__img--cover"),S=m(null),r=m(!1),C=m(0);let b=null,q=0,g=0;function D(a){var k;if(h.slides.length<2||b!==null)return;const y=S.value;y&&(b=a.pointerId,q=a.clientX,g=y.getBoundingClientRect().width||1,C.value=0,r.value=!0,(k=y.setPointerCapture)==null||k.call(y,a.pointerId))}function A(a){!r.value||a.pointerId!==b||(C.value=a.clientX-q)}function U(){if(!r.value)return;const a=C.value,y=a/g;r.value=!1,b=null,C.value=0,y<=-fe&&f.value<h.slides.length-1?f.value++:y>=fe&&f.value>0&&f.value--,Math.abs(a)<=We&&P("tap")}function Q(a){a.pointerId===b&&U()}function p(a){a.pointerId===b&&(r.value=!1,b=null,C.value=0)}function W(){}function J(a){f.value=a}const E=n(()=>{const a=-f.value*100,y=g?C.value/g*100:0;return{transform:`translate3d(${a+y}%, 0, 0)`,transition:r.value?"none":void 0}});return be(()=>{if(b!==null&&S.value)try{S.value.releasePointerCapture(b)}catch{}}),(a,y)=>(l(),o("div",{ref_key:"root",ref:S,class:$(["gs",{"is-dragging":r.value}]),onPointerdown:D,onPointermove:A,onPointerup:Q,onPointercancel:p,onClick:W},[t("div",{class:"gs__track",style:qe(E.value)},[(l(!0),o(G,null,H(v.slides,k=>(l(),o("div",{key:k,class:"gs__cell"},[t("img",{src:k,alt:v.alt,class:$(["gs__img",O.value]),draggable:"false"},null,10,He)]))),128))],4),v.showCounter&&v.slides.length>1?(l(),o("div",Qe,i(f.value+1)+"/"+i(v.slides.length),1)):c("",!0),Oe(a.$slots,"dots",{index:f.value,go:J},void 0,!0)],34))}}),ge=he(Je,[["__scopeId","data-v-c30d71a6"]]);function Ke(v){const x=m(!1),h=m(!1),f=m(!1),P=m(null);return{loading:x,flag:h,notFound:f,productRef:P,load:async()=>{x.value=!0;try{const r=(await je.listProducts()).find(C=>C.id===v)??null;P.value=r,f.value=!r,h.value=!0}catch(S){console.log(S)}finally{x.value=!1}}}}const Ye=ke("favorites",{state:()=>({ids:[]}),actions:{toggle(v){const x=this.ids.indexOf(v);x===-1?this.ids.push(v):this.ids.splice(x,1)},isFavorite(v){return this.ids.includes(v)}}}),ye={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},Ze=ke("filters",{state:()=>({query:{...ye}}),actions:{reset(){this.query={...ye}}}});function et(){return localStorage.getItem("appToken")}const tt={class:"pd__controls"},st={class:"pd__headerTitle"},lt={class:"pd__controlsEnd"},at={key:0,class:"pd__roundBadge"},ot={class:"pd__gallery"},nt={key:0,class:"pd__rail"},it=["aria-label","onClick"],ut={key:1,class:"pd__stage pd__stage--empty"},rt={key:2,class:"pd__expand","aria-hidden":"true"},dt={class:"pd__scroll"},ct={class:"pd__sheet"},vt={class:"pd__eyebrow"},_t={class:"pd__eyebrowText"},pt={class:"pd__head"},ft={class:"pd__headMain"},gt={class:"pd__title"},yt={key:0,class:"pd__code"},mt={class:"pd__figures"},bt={class:"pd__figure"},ht={class:"pd__figureValue"},kt={key:0,class:"pd__figure pd__figure--accent"},xt={class:"pd__figureValue"},Ct={key:0,class:"pd__chips no-scrollbar"},wt=["onClick"],Pt={key:1,class:"pd__block"},St={class:"pd__block"},Tt={class:"pd__specs"},It={class:"pd__spec"},zt={key:0,class:"pd__spec"},$t={key:1,class:"pd__spec"},Rt={key:2,class:"pd__spec"},qt={key:3,class:"pd__spec"},Ot={class:"pd__b