1import{d as w,w as $,o,c as n,a,F as P,s as F,u as s,y as g,z as b,n as j,t as p,r as h,q as E,i as k,_ as R,m as z,k as D,B as L,a3 as M,b as J,f as X,a0 as Y,S as Z,a1 as ee,a2 as te,Q as se}from"./ILbnWIaO.js";import{a as q,P as H}from"./DKok93G5.js";import{_ as ae}from"./DyipBhxE.js";import{_ as oe,P as ne}from"./DEo8Zkc0.js";import{C as le}from"./D8Mn-ouH.js";import{_ as U}from"./C3WtH4US.js";import{F as ie}from"./D9JYVg-Y.js";import{a as re}from"./DERTxN86.js";import{c as ce,S as de}from"./CYfF7Pnu.js";import{a as ue}from"./CUhb4r_u.js";const me={class:"flex flex-col space-y-2"},pe=["onClick"],fe={class:"flex items-center"},xe={class:"min-h-[20px] min-w-[20px] rounded-full border-[1px] border-solid border-[#E4E4E4] bg-[transparent] p-[2px]"},_e={key:0,class:"ml-[10px] flex flex-col text-14"},ve={class:"mb-[1px] text-[#6e6e6e]"},ye={key:1,class:"ml-[10px] text-14"},ge={key:0,class:"text-14 text-[#6e6e6e]"},be={key:1,class:"text-14 text-[#6e6e6e]"},he=["onClick"],ke={class:"flex items-center"},$e={class:"min-h-[20px] min-w-[20px] rounded-full border-[1px] border-solid border-[#E4E4E4] bg-[transparent] p-[2px]"},we={key:0,class:"ml-[10px] flex flex-col text-14"},Be={class:"mb-[1px] text-[#6e6e6e]"},Pe={key:1,class:"ml-[10px] text-14"},Se={key:0,class:"text-14 text-[#6e6e6e]"},Ce={key:1,class:"text-14 text-[#6e6e6e]"},I=w({__name:"ProductModificationItem",props:{items:{},modification1:{},type:{}},emits:["update"],setup(m,{emit:y}){const d=m,_=y,u=h(null),f=e=>{u.value=e,_("update",e)},l=e=>{u.value=e,_("update",e)},r=b(()=>d.items);return $(()=>d.items,()=>{d.type==="1"&&f(r.value?.[0]),d.type==="2"&&r.value?.length&&d.modification1&&l(d.items?.[0])},{immediate:!0}),(e,v)=>(o(),n("div",null,[a("ul",me,[m.type==="1"?(o(!0),n(P,{key:0},F(s(r),(t,i)=>(o(),n("li",{key:`item-modify1-${i}`,onClick:B=>f(t),class:"flex cursor-pointer items-center justify-between rounded-[4px] bg-[#F6F6F6] pb-[14px] pl-[10px] pr-4 pt-[10px]"},[a("div",fe,[a("div",xe,[a("div",{class:j(["h-full min-h-[18px] w-full min-w-[18px] rounded-full",{"bg-[#1B1B1B]":s(u)===t||t.name&&s(u)?.name===t.name}])},null,2)]),t.name?(o(),n("div",_e,[a("span",ve,"ÐÑÑикÑл: "+p(t.data?.[0]?.vendor),1),a("span",null,p(t.name),1)])):(o(),n("div",ye,p(t),1))]),t.data?.[0]?.discount_price?(o(),n("div",ge,p(t.data?.[0]?.discount_price?.toLocaleString())+" â½",1)):g("",!0),t.data?.[0]?.price&&!t.data?.[0]?.discount_price?(o(),n("div",be,p(t.data?.[0]?.price?.toLocaleString())+" â½",1)):g("",!0)],8,pe))),128)):g("",!0),m.type==="2"?(o(!0),n(P,{key:1},F(m.items,(t,i)=>(o(),n("li",{key:`item-modify1-${i}`,onClick:B=>l(t),class:"flex cursor-pointer items-center justify-between rounded-[4px] bg-[#F6F6F6] pb-[14px] pl-[10px] pr-4 pt-[10px]"},[a("div",ke,[a("div",$e,[a("div",{class:j(["h-full min-h-[18px] w-full min-w-[18px] rounded-full",{"bg-[#1B1B1B]":s(u)===t}])},null,2)]),t.id?(o(),n("div",we,[a("span",Be,"ÐÑÑикÑл: "+p(t.vendor),1),a("span",null,p(t.modification_2||t.name),1)])):(o(),n("div",Pe,p(t),1))]),t.discount_price?(o(),n("div",Se,p(t.discount_price?.toLocaleString())+" â½",1)):(o(),n("div",Ce,p(t.price?.toLocaleString())+" â½",1))],8,he))),128)):g("",!0)])]))}}),Fe={key:0,class:"mt-8 flex flex-col space-y-8"},Ee={key:1,class:"mt-8 flex flex-col space-y-8"},Ve=w({__name:"ProductModifications",props:{data:{},automation:{}},emits:["update"],setup(m,{emit:y}){const d=m,_=y,u=h(null),f=h(null),l=b(()=>(d.data?.find(i=>i.automation===d.automation)?.data||d.data[0]?.data||[]).map(i=>i.modification_1&&!i?.data?.[0]?.data?{name:i.modification_1,data:i?.data}:i.modification_1?i.modification_1:i?{name:i.name,data:[i]}:null).filter(i=>!!i)),r=b(()=>d.data?.find(t=>t.automation===d.automation)?.data?.find(t=>t.modification_1===u.value)?.data?.reduce((t,i)=>[...t,...i?.data||[]],[])),e=(v,t)=>{_("update",{value:t,num:v}),v===1&&(u.value=t),v===2&&(f.value=t)};return $(()=>d.automation,()=>{l.value?.length?e(1,l.value):e(1,null),r.value?.length?e(2,r.value):e(2,null)},{immediate:!0}),(v,t)=>(o(),n(P,null,[s(l)?.length?(o(),n("div",Fe,[a("div",null,[t[2]||(t[2]=a("div",{class:"mb-[22px] font-semibold"},"ÐодиÑикаÑÐ¸Ñ 1",-1)),(o(),E(I,{key:m.automation+"modify-1",type:"1",items:s(l),onUpdate:t[0]||(t[0]=i=>e(1,i))},null,8,["items"]))])])):g("",!0),s(r)?.length?(o(),n("div",Ee,[a("div",null,[t[3]||(t[3]=a("div",{class:"mb-[22px] font-semibold"},"ÐодиÑикаÑÐ¸Ñ 2",-1)),(o(),E(I,{key:m.automation+"modify-2",items:s(r),type:"2",modification1:s(u),onUpdate:t[1]||(t[1]=i=>e(2,i))},null,8,["items","modification1"]))])])):g("",!0)],64))}}),Ae={key:0},Ne={class:"flex justify-between"},je={class:"mt-[22px] grid grid-cols-2 gap-[10px] lg:grid-cols-3"},Le=["onClick"],Me={class:"min-h-[20px] min-w-[20px] rounded-full border-[1px] border-solid border-[#
1E4E4E4] bg-[transparent] p-[2px]"},Ue={class:"ml-[10px] flex flex-col text-14"},Oe={key:0,class:"mt-[1px] text-[#6e6e6e]"},Te={key:1,class:"mt-[1px] text-[#6e6e6e]"},Ie=w({__name:"ProductAutomation",props:{data:{}},emits:["change"],setup(m,{emit:y}){const d=m,_=y,u=h(d.data?.[0]?.name),f=b(()=>d.data?.[0]),l=e=>`+ ${(e.price-f.value?.price).toLocaleString()} â½`,r=e=>{u.value=e,_("change",e)};return $(()=>f.value,()=>{r(f.value?.name)},{immediate:!0}),(e,v)=>{const t=R;return m.data.length?(o(),n("div",Ae,[a("div",Ne,[v[1]||(v[1]=a("span",{class:"font-semibold"},"ÐвÑомаÑика",-1)),k(t,{to:{name:s(z),params:("getPageParams"in e?e.getPageParams:s(q))(s(H).AUTOMATION)},class:"text-14 text-[#F65A0D]"},{default:D(()=>[...v[0]||(v[0]=[L(" ТаблиÑа ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ ",-1)])]),_:1},8,["to"])]),a("div",je,[(o(!0),n(P,null,F(m.data,(i,B)=>(o(),n("div",{onClick:()=>r(i.name),class:"flex cursor-pointer items-start bg-[#F6F6F6] px-[10px] pb-[14px] pt-[10px]"},[a("div",Me,[a("div",{class:j(["h-full min-h-[18px] w-full min-w-[18px] rounded-full",{"bg-[#1B1B1B]":s(u)===i.name}])},null,2)]),a("div",Ue,[a("div",null,p(i.name),1),B===0?(o(),n("div",Oe,p(i.price?.toLocaleString())+" â½",1)):(o(),n("div",Te,p(l(i)),1))])],8,Le))),256))])])):g("",!0)}}}),Re={key:0,class:"mb-[22px] flex items-start border-b-[1px] border-b-[#E4E4E4] pb-4"},ze=["src"],De={class:"ml-2 flex flex-col w-full"},qe={class:"text-14"},He={class:"mt-[6px] text-14 text-[#6e6e6e]"},Ke={class:"mt-3 flex justify-between items-center w-full"},Qe={class:"text-[#6e6e6e]"},We=w({__name:"AccessoryItem",props:{product:{}},emits:["update"],setup(m,{emit:y}){const d=m,_=y,u=h(0),f=b(()=>d.product?.variants_list?.[0]);return $(()=>u.value,l=>{_("update",{accessory:f.value,count:l})}),(l,r)=>s(f)?(o(),n("div",Re,[a("img",{src:m.product.horizontal_image?.url,alt:"",class:"max-h-[60px] max-w-[60px] h-full w-full aspect-square"},null,8,ze),a("div",De,[a("div",qe,p(m.product?.name),1),a("div",He,"ÐÑÑикÑл: "+p(s(f).vendor),1),a("div",Ke,[a("div",Qe,"+ "+p(s(f)?.price)+" â½",1),k(U,{modelValue:s(u),"onUpdate:modelValue":r[0]||(r[0]=e=>M(u)?u.value=e:null),max:s(f).count},null,8,["modelValue","max"])])])])):g("",!0)}}),Ge={key:0},Je={class:"flex flex-col"},Xe=w({__name:"AccessoriesProduct",props:{data:{}},setup(m,{expose:y}){const d=m,_=h([]),u=l=>{const r=_.value?.findIndex(e=>e.accessory.product_id===l.accessory.product_id&&e.accessory.vendor===l.accessory.vendor);r>=0&&(_.value[r]=l)},f=b(()=>_.value?.reduce((l,r)=>l+r.accessory.price*r.count,0));return J(()=>{_.value=d.data?.filter(l=>l.variants_list?.[0])?.map(l=>({accessory:l.variants_list[0],count:0}))}),y({totalPrice:f}),(l,r)=>m.data?.length?(o(),n("div",Ge,[r[0]||(r[0]=a("div",{class:"mb-[22px] font-semibold"},"ÐкÑеÑÑÑаÑÑ",-1)),a("div",Je,[(o(!0),n(P,null,F(m.data,e=>(o(),E(We,{product:e,onUpdate:u,key:`accessory-${e.id}`},null,8,["product"]))),128))])])):g("",!0)}}),Ye={class:"w-full"},Ze={key:0,class:"container mb-[48px] mt-[34px] flex flex-col gap-[60px] md:mb-[126px] md:mt-[100px] md:flex-row lg:mt-[34px]"},et={class:"123 w-full md:w-[55%]"},tt={key:1,class:"aspect-square"},st=["src"],at={key:2,class:"aspect-square"},ot={class:"flex justify-center"},nt={class:"flex flex-col-reverse md:flex-col"},lt={class:"mt-[28px] flex items-center justify-between"},it={class:"grid w-full grid-cols-2 items-center space-x-2 sm:flex sm:space-x-4 md:w-1/2"},rt={key:0,class:"mt-6 flex items-center justify-between md:mt-12"},ct={key:0,class:"flex flex-wrap items-center justify-end gap-[16px]"},dt={key:0,class:"text-[16px] text-[#8F8F8F] line-through md:text-[20px]/[135%]"},ut={class:"text-[20px] font-semibold md:text-[28px]/[126%]"},mt={key:1,class:"flex flex-wrap items-center justify-end gap-[16px]"},pt={class:"text-[28px] font-semibold"},ft={class:"w-full md:w-[45%]"},xt={key:0,class:"mb-2 text-[40px] font-semibold leading-[54px]"},_t={key:1,class:"mb-9 text-14 text-secondary"},vt={class:"text-default"},Ct=w({__name:"ProductBuy",async setup(m){let y,d;const _=X(),u=h(null),f=h(null),l=h(1),r=h(null),{data:e,pending:v,error:t}=([y,d]=Y(async()=>ue(`productBuy-${_.params.slugName}`,async()=>{const c=await Z.instance.getService(le).getProductTypeBuy(_.params.slugName);return r.value=c?.automations?.[0]?.name,c},{watch:[()=>_.params.slugName]})),y=await y,d(),y);$(t,c=>{if(c)throw te({statusCode:404,statusMessage:"Page Not Found",fatal:!0})},{immediate:!0});const i=ee(re);$(()=>v.value,()=>{v.value||i(e.value?.name)},{deep:!0,immediate:!0});const B=b(()=>e.value?.variants||[]),V=b(()=>{const c=[];return e.value&&e.value.blocks?(c.push(e.value.blocks.find(x=>x.block_type.name=="slider")),c[0].blockables):c}),K=c=>{r.value=c},O=h(null),T=h(null),Q=c=>
1{c.num===1&&(O.value=c.value),c.num===2&&(T.value=c.value)},S=b(()=>{const c=e.value?.variants?.find(A=>A.automation===r.value)?.data?.[0];return T.value||O.value?.data?.[0]||c||e.value}),C=b(()=>{const c=f.value?.totalPrice||0;return((S.value?.discount_price||S.value?.price||0)+c)*l.value}),W=b(()=>e.value?.automations?.filter(c=>c.name?.length)?.sort((c,x)=>c.price-x.price)||[]),G=b(()=>new de({meta_title:e?.value?.seo_title,meta_description:e?.value?.seo_description,meta_image:e?.value?.seo_image,meta_slug:e?.value?.seo_slug}));return $(()=>v.value,()=>{v.value||se(ce(G.value))},{immediate:!0}),(c,x)=>{const A=R;return o(),n("div",Ye,[s(e)?(o(),n("div",Ze,[a("div",et,[s(V)&&s(V).length>0?(o(),E(oe,{key:0,alt:s(e)?.name,slides:s(V)},null,8,["alt","slides"])):s(e).horizontal_image?.url?(o(),n("div",tt,[a("img",{src:s(e).horizontal_image?.url,class:"h-full w-full object-contain",alt:""},null,8,st)])):(o(),n("div",at,[...x[3]||(x[3]=[a("img",{src:ae,class:"h-full w-full object-contain",alt:""},null,-1)])])),a("div",ot,[k(U,{modelValue:s(l),"onUpdate:modelValue":x[0]||(x[0]=N=>M(l)?l.value=N:null),class:"md:hidden"},null,8,["modelValue"])]),a("div",nt,[a("div",lt,[a("div",it,[k(A,{to:{name:s(z),params:("getPageParams"in c?c.getPageParams:s(q))(s(H).LOCATIONS)},class:"w-full rounded-[22px] border-[1px] border-solid border-[#1B1B1B] px-6 py-3 text-center text-14 font-semibold"},{default:D(()=>[...x[4]||(x[4]=[L(" ÐайÑи дилеÑа ",-1)])]),_:1},8,["to"]),a("button",{onClick:x[1]||(x[1]=()=>s(u)?.openModal()),class:"w-full rounded-[22px] border-[1px] border-solid border-[#1B1B1B] bg-[#1B1B1B] px-6 py-3 text-14 font-semibold text-white"}," ÐÑпиÑÑ ")]),k(U,{modelValue:s(l),"onUpdate:modelValue":x[2]||(x[2]=N=>M(l)?l.value=N:null),class:"hidden md:flex"},null,8,["modelValue"])]),s(C)?(o(),n("div",rt,[x[5]||(x[5]=a("p",{class:"text-20 font-semibold"},"СÑоимоÑÑÑ:",-1)),a("div",null,[s(e).discount_price?(o(),n("div",ct,[Number(s(C))<Number(s(e).price)?(o(),n("p",dt," Ð¾Ñ "+p(s(e).price?.toLocaleString())+" â½ ",1)):g("",!0),a("p",ut,"Ð¾Ñ "+p(s(C)?.toLocaleString())+" â½",1)])):(o(),n("div",mt,[a("p",pt,"Ð¾Ñ "+p(s(C)?.toLocaleString())+" â½",1)]))])])):g("",!0),k(ne,{class:"mt-8 md:mt-5"})])]),a("div",ft,[s(e).name?(o(),n("h2",xt,p(s(e).name),1)):g("",!0),s(S)?.vend
1or?(o(),n("p",_t,[x[6]||(x[6]=L(" ÐÑÑикÑл: ",-1)),a("span",vt,p(s(S)?.vendor),1)])):g("",!0),k(Ie,{onChange:K,data:s(W)},null,8,["data"]),k(Ve,{data:s(B),automation:s(r),onUpdate:Q,class:"mt-8"},null,8,["data","automation"]),k(Xe,{class:"mt-8",data:s(e).accessories,ref_key:"accessoriesBlock",ref:f},null,8,["data"])])])):g("",!0),k(ie,{type:1,ref_key:"feedback",ref:u},null,512)])}}});export{Ct as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.