Files
tehran_taj/apps/user-app-v2/dist/assets/SingleProduct-Szrby5K6.js
T
s.esmaeiliandClaude Opus 5 53436ec855 chore(release): prepare release/delivery + fix docker env passthrough
DEPLOY-01: docker-compose.yml passed only DATABASE_URL and PORT to the api
service, so JWT_SECRET, JWT_CUSTOMER_SECRET, OTP_MASTER_CODE and every SMS_TREZ_*
variable were silently dropped in Docker. A deployed build would have used the
development JWT fallback and would not have had the delivery master code at all,
so the demo login would have failed with no obvious cause. All are now forwarded,
defaulting to empty (which the code treats as unset); verified with
`docker compose config`.

TEST-01: test-sales-expert-roundtrip.cjs had localhost:3077 hardcoded and could
only connect by accident. Now defaults to the repo's API_PORT. 33/33.

DELIVERY.md documents env vars (names only), run/deploy commands, how migrations
run inside the container, the verification results and the known issues.

release/delivery contains both parity branches with no conflicts (fast-forward).
build 5/5, jest 45/45, admin smoke 43/43, apps smoke 43/43, B2B scan 34/34,
B2B writes 25/25, auth-smoke 32/32, typecheck clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 00:30:09 +03:30

2 lines
14 KiB
JavaScript

import{d as he,ae as De,a as ke,f as l,c as o,b as t,n as Fe,F as G,r as Q,t as u,e as c,A as Me,i as z,af as fe,g as m,h as n,_ as xe,p as Ve,m as Ce,G as Be,C as Ae,u as w,j as L,s as $,l as d,I as _,D as O,ag as Le,Y as ge,T as Ue,x as Xe,v as Ee}from"./index-Cn8AS3KS.js";import{a as Ne}from"./Spinner.vue_vue_type_style_index_0_lang-Bdyx4EbU.js";import{_ as je}from"./NotifyVant.vue_vue_type_script_setup_true_lang-Ivi5BOMl.js";import{_ as Ge}from"./DialogVant.vue_vue_type_style_index_0_lang-DcjC-3u9.js";import{a as Qe,i as He,u as We}from"./cartStore-Cg4qrOAL.js";import{l as Ye}from"./dialogEmpty1-Caw7F5KL.js";const Je=["src","alt"],Ke={key:0,class:"gs__counter"},ye=.18,Ze=6,et=he({__name:"GallerySlider",props:fe({slides:{},alt:{},fit:{default:"cover"},showCounter:{type:Boolean,default:!1}},{index:{default:0},indexModifiers:{}}),emits:fe(["tap"],["update:index"]),setup(v,{emit:x}){const h=v,f=De(v,"index"),P=x,F=n(()=>h.fit==="contain"?"gs__img--contain":"gs__img--cover"),S=m(null),r=m(!1),C=m(0);let b=null,R=0,g=0;function M(a){var k;if(h.slides.length<2||b!==null)return;const y=S.value;y&&(b=a.pointerId,R=a.clientX,g=y.getBoundingClientRect().width||1,C.value=0,r.value=!0,(k=y.setPointerCapture)==null||k.call(y,a.pointerId))}function U(a){!r.value||a.pointerId!==b||(C.value=a.clientX-R)}function X(){if(!r.value)return;const a=C.value,y=a/g;r.value=!1,b=null,C.value=0,y<=-ye&&f.value<h.slides.length-1?f.value++:y>=ye&&f.value>0&&f.value--,Math.abs(a)<=Ze&&P("tap")}function H(a){a.pointerId===b&&X()}function p(a){a.pointerId===b&&(r.value=!1,b=null,C.value=0)}function W(){}function Y(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 ke(()=>{if(b!==null&&S.value)try{S.value.releasePointerCapture(b)}catch{}}),(a,y)=>(l(),o("div",{ref_key:"root",ref:S,class:z(["gs",{"is-dragging":r.value}]),onPointerdown:M,onPointermove:U,onPointerup:H,onPointercancel:p,onClick:W},[t("div",{class:"gs__track",style:Fe(E.value)},[(l(!0),o(G,null,Q(v.slides,k=>(l(),o("div",{key:k,class:"gs__cell"},[t("img",{src:k,alt:v.alt,class:z(["gs__img",F.value]),draggable:"false"},null,10,Je)]))),128))],4),v.showCounter&&v.slides.length>1?(l(),o("div",Ke,u(f.value+1)+"/"+u(v.slides.length),1)):c("",!0),Me(a.$slots,"dots",{index:f.value,go:Y},void 0,!0)],34))}}),me=xe(et,[["__scopeId","data-v-c30d71a6"]]);function tt(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 Ve.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 st=Ce("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)}}}),be={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},lt=Ce("filters",{state:()=>({query:{...be}}),actions:{reset(){this.query={...be}}}});function at(){return localStorage.getItem("appToken")}const nt={class:"pd__controls"},ot={class:"pd__headerTitle"},it={class:"pd__controlsEnd"},ut={key:0,class:"pd__roundBadge"},rt={class:"pd__gallery"},dt={key:0,class:"pd__rail"},ct=["aria-label","onClick"],vt={key:1,class:"pd__stage pd__stage--empty"},_t={key:2,class:"pd__expand","aria-hidden":"true"},pt={class:"pd__scroll"},ft={class:"pd__sheet"},gt={class:"pd__eyebrow"},yt={class:"pd__eyebrowText"},mt={class:"pd__head"},bt={class:"pd__headMain"},ht={class:"pd__title"},kt={key:0,class:"pd__code"},xt={class:"pd__figures"},Ct={class:"pd__figure"},wt={class:"pd__figureValue"},Pt={key:0,class:"pd__figure pd__figure--accent"},St={class:"pd__figureValue"},It={key:0,class:"pd__chips no-scrollbar"},Tt=["disabled","onClick"],$t={key:1,class:"pd__block"},zt={class:"pd__block"},Ot={class:"pd__specs"},Rt={class:"pd__spec"},qt={key:0,class:"pd__spec"},Dt={key:1,class:"pd__spec"},Ft={key:2,class:"pd__spec"},Mt={key:3,class:"pd__spec"},Vt={class:"pd__bar"},Bt={key:0,class:"pd__qty"},At={class:"pd__qtyValue"},Lt=["aria-label"],Ut={class:"pd__pillText"},Xt=["disabled"],Et={key:0,class:"pd__previewCounter"},Nt={key:1,class:"pd__previewThumbs no-scrollbar"},jt=["aria-label","onClick"],Gt=["src","alt"],Qt=["src"],Ht=56,Wt=he({__name:"SingleProduct",props:{id:{}},emits:["closeDrawer"],setup(v,{emit:x}){const h=v,f=x,P=Xe(),F=st(),S=lt(),r=Qe(),C=()=>{f("closeDrawer"),P.currentRoute.value.name==="singleProduct"&&P.back()},b=m(!1),R=m(!1),g=m(0),M=m(!1),U=m(null),X=m(!1);function H(){var A;const s=U.value;if(!s)return;const e=((A=s.querySelector(".pd__gallery"))==null?void 0:A.clientHeight)??0;X.value=s.scrollTop>Math.max(e-Ht,0)}const p=tt(h.id),W=p.loading,Y=p.flag,E={id:h.id,title:"",description:null,variants:[],images:[],category:null,brand:null,collections:[]},a=n(()=>We(p.productRef.value??E)),y=n(()=>a.value.id.value),k=n(()=>a.value.title.value),ne=n(()=>a.value.productCode.value),J=n(()=>a.value.variants.value),V=n({get:()=>a.value.selectedVariant.value,set:s=>a.value.selectedVariant.value=s}),oe=n(()=>a.value.min_gram.value),K=n(()=>a.value.wage.value),Z=n(()=>a.value.qty.value),ie=n(()=>a.value.isPreOrder.value),ee=n(()=>a.value.is_exist.value),te=n(()=>{var s;return((s=p.productRef.value)==null?void 0:s.description)??""}),we=n(()=>te.value.length>120),ue=n(()=>{var s,e;return((e=(s=p.productRef.value)==null?void 0:s.category)==null?void 0:e.id)??""}),B=n(()=>{var s,e;return((e=(s=p.productRef.value)==null?void 0:s.category)==null?void 0:e.title)??""}),re=n(()=>{var s,e;return((e=(s=p.productRef.value)==null?void 0:s.brand)==null?void 0:e.title)??""}),se=n(()=>{var s;return(((s=p.productRef.value)==null?void 0:s.images.length)??0)>0}),I=n(()=>{var s;return((s=p.productRef.value)==null?void 0:s.images.map(e=>e.url))??[]});Be(I,s=>{g.value>s.length-1&&(g.value=0)});const N=m(!1);function Pe(){se.value&&(N.value=!0,document.body.style.overflow="hidden")}function de(){N.value=!1,document.body.style.overflow=""}const ce=n(()=>{const s=K.value;return s==null?"":s%1===0?String(s):s.toFixed(2)}),Se=n(()=>Z.value>0?`${Z.value} عدد موجود`:ie.value?"پیش‌سفارش":"ناموجود"),Ie=n(()=>Z.value>0?"is-in":ie.value?"is-pre":"is-out"),q=n(()=>{var s,e;return{vid:((s=V.value)==null?void 0:s.id)??"",note:null,pid:((e=p.productRef.value)==null?void 0:e.id)??h.id,product:p.productRef.value??E,qty:1}}),ve=n(()=>r.isInCart(q.value)),j=n(()=>r.find_index(q.value)),D=n(()=>j.value>-1?r.items[j.value].qty:0),_e=n(()=>r.maxQty(q.value)),Te=n(()=>_e.value===null||D.value<_e.value),$e=()=>{Te.value&&r.updateFeild(D.value+1,j.value,q.value,"qty")},ze=()=>{if(D.value<=1){r.remove(q.value);return}r.updateFeild(D.value-1,j.value,q.value,"qty")},pe=s=>He(s),Oe=()=>{r.addToCart(q.value)&&(b.value=!0)},Re=s=>{s.stopPropagation(),F.toggle(h.id)},qe=()=>{ue.value&&(S.query.cats=[ue.value],f("closeDrawer"),P.push({name:"search"}))};return Ae(async()=>{await p.load()}),ke(()=>{N.value&&(document.body.style.overflow="")}),(s,e)=>{const A=Ee("router-link");return w(Y)&&w(p).productRef.value?(l(),L(Ne,{key:0,spinning:w(W),tip:"درحال دریافت اطلاعات"},{default:$(()=>[t("article",{class:"pd",ref_key:"scroller",ref:U,onScrollPassive:H},[t("header",{class:z(["pd__header",{"is-solid":X.value}])},[t("div",nt,[t("button",{type:"button",class:"pd__round","aria-label":"بازگشت",onClick:C},[d(_,{icon:"vuesax-linear:arrow-right-1",size:"18"})]),t("h2",ot,u(k.value),1),t("div",it,[t("button",{type:"button",class:z(["pd__round",{"is-on":w(F).isFavorite(y.value)}]),"aria-label":"علاقه‌مندی",onClick:Re},[d(_,{icon:w(F).isFavorite(y.value)?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"18"},null,8,["icon"])],2),d(A,{class:"pd__round",to:{name:"cart"},"aria-label":"سبد خرید"},{default:$(()=>[d(_,{icon:"vuesax-linear:bag-2",size:"18"}),w(r).items.length?(l(),o("span",ut,u(w(r).items.length),1)):c("",!0)]),_:1})])])],2),t("div",rt,[se.value?(l(),L(me,{key:0,index:g.value,"onUpdate:index":e[0]||(e[0]=i=>g.value=i),slides:I.value,alt:k.value,class:"pd__stage",onTap:Pe},{dots:$(({index:i,go:T})=>[I.value.length>1?(l(),o("div",dt,[(l(!0),o(G,null,Q(I.value,(le,ae)=>(l(),o("button",{key:le,type:"button",class:z(["pd__railDot",{"is-on":ae===i}]),"aria-label":`تصویر ${ae+1}`,onClick:ge(Jt=>T(ae),["stop"])},null,10,ct))),128))])):c("",!0)]),_:1},8,["index","slides","alt"])):(l(),o("div",vt,[d(_,{icon:"vuesax-linear:diamonds",size:"27"})])),se.value?(l(),o("span",_t,[d(_,{icon:"vuesax-linear:maximize-4",size:"15"})])):c("",!0)]),t("div",pt,[t("div",ft,[e[18]||(e[18]=t("div",{class:"pd__grip","aria-hidden":"true"},null,-1)),t("div",gt,[t("span",yt,u(B.value||"محصول"),1),t("span",{class:z(["pd__stock",Ie.value])},[e[8]||(e[8]=t("span",{class:"pd__stockDot","aria-hidden":"true"},null,-1)),O(" "+u(Se.value),1)],2)]),t("header",mt,[t("div",bt,[t("h1",ht,u(k.value),1),ne.value?(l(),o("p",kt,u(ne.value),1)):c("",!0)]),t("div",xt,[t("div",Ct,[t("span",wt,u(oe.value),1),e[9]||(e[9]=t("span",{class:"pd__figureLabel"},"گرم",-1))]),K.value!=null?(l(),o("div",Pt,[t("span",St,u(ce.value)+"٪",1),e[10]||(e[10]=t("span",{class:"pd__figureLabel"},"اجرت",-1))])):c("",!0)])]),J.value&&J.value.length>1?(l(),o("section",It,[(l(!0),o(G,null,Q(J.value,i=>{var T;return l(),o("button",{key:i.id,type:"button",class:z(["pd__chip",{"is-on":((T=V.value)==null?void 0:T.id)===i.id,"is-out":!pe(i)}]),disabled:!pe(i),onClick:le=>V.value=i},u(i.title),11,Tt)}),128))])):c("",!0),te.value?(l(),o("section",$t,[e[11]||(e[11]=t("h2",{class:"pd__blockTitle"},"توضیحات",-1)),t("p",{class:z(["pd__body",{"is-clamped":!M.value}])},u(te.value),3),we.value?(l(),o("button",{key:0,type:"button",class:"pd__more",onClick:e[1]||(e[1]=i=>M.value=!M.value)},u(M.value?"بستن":"ادامه مطلب"),1)):c("",!0)])):c("",!0),t("section",zt,[e[17]||(e[17]=t("h2",{class:"pd__blockTitle"},"مشخصات",-1)),t("dl",Ot,[t("div",Rt,[t("dt",null,[d(_,{icon:"vuesax-linear:weight",size:"15"}),e[12]||(e[12]=O(" وزن",-1))]),t("dd",null,u(oe.value)+" گرم",1)]),K.value!=null?(l(),o("div",qt,[t("dt",null,[d(_,{icon:"vuesax-linear:percentage-square",size:"15"}),e[13]||(e[13]=O(" اجرت",-1))]),t("dd",null,u(ce.value)+"٪",1)])):c("",!0),V.value?(l(),o("div",Dt,[t("dt",null,[d(_,{icon:"vuesax-linear:diamonds",size:"15"}),e[14]||(e[14]=O(" تنوع",-1))]),t("dd",null,u(V.value.title),1)])):c("",!0),B.value?(l(),o("div",Ft,[t("dt",null,[d(_,{icon:"vuesax-linear:category",size:"15"}),e[15]||(e[15]=O(" دسته‌بندی",-1))]),t("dd",null,u(B.value),1)])):c("",!0),re.value?(l(),o("div",Mt,[t("dt",null,[d(_,{icon:"vuesax-linear:shop",size:"15"}),e[16]||(e[16]=O(" برند",-1))]),t("dd",null,u(re.value),1)])):c("",!0)])])])]),t("div",Vt,[ve.value?(l(),o("div",Bt,[t("button",{type:"button",class:"pd__qtyBtn","aria-label":"افزایش",onClick:$e},[d(_,{icon:"vuesax-linear:add",size:"15"})]),t("span",At,u(D.value),1),t("button",{type:"button",class:"pd__qtyBtn","aria-label":D.value===1?"حذف":"کاهش",onClick:ze},[d(_,{icon:D.value===1?"vuesax-linear:trash":"vuesax-linear:minus",size:"15"},null,8,["icon"])],8,Lt)])):B.value?(l(),o("button",{key:1,type:"button",class:"pd__pill",onClick:qe},[d(_,{icon:"vuesax-linear:category",size:"17"}),t("span",Ut,u(B.value),1)])):c("",!0),ve.value?(l(),L(A,{key:3,class:"pd__cta",to:{name:"cart"}},{default:$(()=>[d(_,{icon:"vuesax-linear:bag-2",size:"17"}),e[19]||(e[19]=O(" مشاهده سبد خرید ",-1))]),_:1})):(l(),o("button",{key:2,type:"button",class:"pd__cta",disabled:!ee.value,onClick:e[2]||(e[2]=i=>w(at)()?Oe():R.value=!0)},[ee.value?(l(),L(_,{key:0,icon:"vuesax-linear:bag-2",size:"17"})):c("",!0),O(" "+u(ee.value?"افزودن به سفارش":"ناموجود"),1)],8,Xt))])],544),(l(),L(Le,{to:"body"},[d(Ue,{name:"pd-preview"},{default:$(()=>[N.value?(l(),o("div",{key:0,class:"pd__preview",onClick:ge(de,["self"])},[t("button",{type:"button",class:"pd__previewClose","aria-label":"بستن",onClick:de},[d(_,{icon:"vuesax-linear:add",size:"20"})]),I.value.length>1?(l(),o("div",Et,u(g.value+1)+" / "+u(I.value.length),1)):c("",!0),d(me,{index:g.value,"onUpdate:index":e[3]||(e[3]=i=>g.value=i),slides:I.value,alt:k.value,class:"pd__previewStage",fit:"contain"},null,8,["index","slides","alt"]),I.value.length>1?(l(),o("div",Nt,[(l(!0),o(G,null,Q(I.value,(i,T)=>(l(),o("button",{key:i,type:"button",class:z(["pd__previewThumb",{"is-on":T===g.value}]),"aria-label":`تصویر ${T+1}`,onClick:le=>g.value=T},[t("img",{src:i,alt:`${k.value} ${T+1}`,draggable:"false"},null,8,Gt)],10,jt))),128))])):c("",!0)])):c("",!0)]),_:1})])),d(je,{timeOut:3e3,modelValue:b.value,"onUpdate:modelValue":e[4]||(e[4]=i=>b.value=i),color:"background-color: #14161A"},{default:$(()=>[...e[20]||(e[20]=[t("div",{class:"font-bold text-right mb-2"},"ثبت سفارش",-1),t("div",null,"محصول با موفقیت به سبد خرید افزوده شد",-1)])]),_:1},8,["modelValue"]),d(Ge,{timeOut:-1,show:R.value,"onUpdate:show":e[7]||(e[7]=i=>R.value=i),closeOnClickOverlay:!0},{img:$(()=>[t("img",{src:w(Ye),alt:"",class:"opacity-80"},null,8,Qt)]),title:$(()=>[...e[21]||(e[21]=[t("div",{class:"p-8 text-justify"}," برای دسترسی به تمامی امکانات نرم افزار منتزر، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",-1)])]),button:$(()=>[t("div",{class:"text-center font-bold",onClick:e[5]||(e[5]=i=>w(P).push({name:"login"}))},"ورود/ثبت نام"),t("div",{class:"text-center",onClick:e[6]||(e[6]=i=>R.value=!1)},"بیخیال")]),_:1},8,["show"])]),_:1},8,["spinning"])):c("",!0)}}}),Yt=xe(Wt,[["__scopeId","data-v-3f316a84"]]),as=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"}));export{Yt as S,st as a,as as b,lt as u};