1import{m as le,p as ce,O as ue,$ as me,s as A,e as b,V as z,an as J,br as O,y as o,P as pe}from"./D8bZCvQQ.js";const de=()=>{const{$env:I}=le(),Q=ce(),U=ue(),W=me(),{currentOrderType:X,currentAddressType:P,currentAddress:Y,zone:l,takeawayOrganization:L,minOrderPrice:j}=A(U),{cartPrice:$,cart:ee,cartStoped:B,cartMissingFromCatalogIds:Z,promo:i,products:te,enteredPoints:q,pack:E}=A(W),{app_settings:x}=A(Q),h=b(()=>{const s=P?.value===z.Delivery,e=P?.value===z.Takeaway,t=P?.value===z.ToTable,n=s?l.value?.organization:L.value,a=n?.id?n:null,v=a?.timezone?J().tz(a.timezone):J(),d=a?.min_preorder_days||0,c=a?.max_preorder_days||30;return{isReady:!!a,isDelivery:s,isTakeaway:e,isToTable:t,hasZone:!!Object.keys(l.value||{}).length,isOpen:s?l.value?.is_open:L.value?.is_open,maxTime:s&&l.value?.max_time?l.value?.max_time:e&&a?.takeaway_time?a.takeaway_time:"30",minDate:v.add(d,"day").format(),maxDate:v.add(c,"day").format(),todayDisable:!!d,orderType:X.value,organization:a,timeFrom:O(a?.time_from),timeTo:O(a?.time_to),zoneTimeFrom:O(l.value?.time_from),zoneTimeTo:O(l.value?.time_to),timeStampFrom:a?.time_from,timeStampTo:a?.time_to,zoneId:l.value?.zone_id,disableCashPaument:l.value?.disable_cash_payment,disableCourierCardPayment:l.value?.disable_courier_card_payment,disableOnlinePayment:l.value?.disable_online_payment,currentSchedule:s?a?.delivery_schedule:a?.takeaway_schedule,available_payment_types:l.value?.available_payment_types?.length?l.value.available_payment_types:a?.available_payment_types?.length?a.available_payment_types:x.value.available_payment_types,deliveryFeeRates:l.value?.delivery_fee_rates}}),re=b(()=>{const s=G.value.match?0:N.value.ranks.length>0?N.value?.currentTier:l.value.delivery_price||0,e=$.value+s,t=i.value?.discount_sum||0,n=0,a=E.value?.price?E.value.price:0,v=P.value===z.ToTable,d=!!x.value.service_fee?.enabled,c=Number(x.value.service_fee?.amount||0),M=!v&&d&&c>0?c:0;return{pureProducts:$.value,delivery:s,withDelivery:e,promoDiscount:t,pointsDiscount:n,totalDiscount:t+n,serviceFee:M,totalToPay:e-t-n-Number(q.value)+a+M}}),N=b(()=>{if(!Y.value||h.value.isDelivery&&!h.value.hasZone)return{currentTier:null,ranks:[],rangTitle:"УкажиÑе адÑеÑ",rangDescription:""};const s=i.value?.has_promo&&i.value.discount_sum&&!i.value.not_affects_on_minimal_order?i.value.discount_sum:0,e=$.value-s,t=j.value,n=l.value.free_delivery_min_price,a=l.value.delivery_price,{deliveryFeeRates:v}=h.value;let d="",c="";if(P.value===z.Takeaway){const r=t>0,u=e>=t;return d=u?"ÐинималÑÐ½Ð°Ñ ÑÑмма ÑобÑана!":`ÐинималÑнÑй заказ Ð¾Ñ ${o(t)}`,c=u?"СамовÑвоз Ð¶Ð´ÐµÑ Ð²Ð°Ñ!":`ÐÑе ${o(t-e)} и ÑможеÑе ÑделаÑÑ Ð·Ð°ÐºÐ°Ð·`,{currentTier:null,ranks:r?[{progressPercent:u?100:Math.min(Math.round(e/t*100),100),rangTitle:d,rangDescription:c,rankNumber:1}]:[],rangTitle:d,rangDescription:c}}if(!v||v.length===0){const r=[],u=t>0&&n>0&&t===n,T=n>0,D=t>0,m=a;let k=m,y="",p="";if(u){const g=Math.max(t-e,0),_=Math.min(Math.round(e/t*100),100);r.push({rankNumber:1,progressPercent:_,rangTitle:`ÐинималÑнÑй заказ Ð¾Ñ ${o(t)}`,rangDescription:`ÐÑе ${o(g)} и ÑможеÑе ÑделаÑÑ Ð·Ð°ÐºÐ°Ð·`}),k=e>=t?0:m,y=r[0].rangTitle,p=r[0].rangDescription}else if(D&&T){const g=Math.min(Math.round(e/t*100),100),_=Math.max(t-e,0);r.push({rankNumber:1,progressPercent:g,rangTitle:`ÐинималÑнÑй заказ Ð¾Ñ ${o(t)}`,rangDescription:`ÐÑе ${o(_)} и ÑможеÑе ÑделаÑÑ Ð·Ð°ÐºÐ°Ð·`});const S=e>=t?Math.min(Math.round((e-t)/(n-t)*100),100):0,F=e<n?Math.max(n-e,0):0,R=e>=n;r.push({rankNumber:2,progressPercent:S,rangTitle:R?"ÐеÑплаÑÐ½Ð°Ñ Ð´Ð¾ÑÑавка":`ÐоÑÑавка ${o(m)}`,rangDescription:R?"ÐÑиÑÑно, не пÑавда ли?":`Ðо беÑплаÑной не Ñ
ваÑÐ°ÐµÑ ${o(F)}`}),k=R?0:m;const H=e<t?r[0]:r[1];y=H.rangTitle,p=H.rangDescription}else if(!D&&T){const g=Math.min(Math.round(e/n*100),100),_=Math.max(n-e,0),S=e>=n;r.push({rankNumber:1,progressPercent:g,rangTitle:S?"ÐеÑплаÑÐ½Ð°Ñ Ð´Ð¾ÑÑавка":`ÐоÑÑавка ${o(m)}`,rangDescription:S?"ÐÑиÑÑно, не пÑавда ли?":`Ðо беÑплаÑной не Ñ
ваÑÐ°ÐµÑ ${o(_)}`}),k=S?0:m;const F=r[0];y=F.rangTitle,p=F.rangDescription}else if(D&&!T){const g=Math.min(Math.round(e/t*100),100),_=Math.max(t-e,0);r.push({rankNumber:1,progressPercent:g,rangTitle:e<t?`ÐинималÑнÑй заказ Ð¾Ñ ${o(t)}`:`ÐоÑÑавка ${o(m)}`,rangDescription:e<t?`ÐÑе ${o(_)} и ÑможеÑе ÑделаÑÑ Ð·Ð°ÐºÐ°Ð·`:""}),k=m,y=r[0].rangTitle,p=r[0].rangDescription}else r.push({rankNumber:1,progressPercent:100,rangTitle:`ÐоÑÑавка ${o(m)}`,rangDescription:""}),k=m,y=r[0].rangTitle,p="";return{currentTier:k,ranks:r,rangTitle:y,rangDescription:p}}const M=[...v].sort((r,u)=>r.min_order-u.min_order),f=[];if(t>0){const r=M.find(u=>u.min_order===0)?.price??a;f.push({from:0,to:t-1,price:r})}for(let r=0;r<M.length;r++){const u=M[r],T=M[r+1],D=Math.max(u.min_order,t),m=T?T.min_order-1:n?n-1:D;m>=D&&f.push({from:D,to:m,price:u.price})}const w=f[f.length-1];n>0&&w.to<n-1&&f.push({from:w.to+1,to:n-1,price:w.price});const C=f.map((r,u)=>{const T=e>=r.from&&e<=r.to,D=e>r.to,m=r.to-r.from+1,k=D?100:T?Math.round((e-r.from)/m*100):0;T&&Math.max(r.to+1-e,0);let y=`ÐоÑÑавка ${o(r.price)}`,p="";if(e<t)y=`ÐинималÑнÑй заказ Ð¾Ñ ${o(t)}`,p=`ÐÑе ${o(t-e)} и ÑможеÑе ÑделаÑÑ Ð·Ð°ÐºÐ°Ð·`;else if(r.price===0)y="ÐеÑплаÑÐ½Ð°Ñ Ð´Ð¾ÑÑавка",p="ÐÑиÑÑно, не пÑавда ли?";else if(n>0&&e>=n)y="ÐеÑплаÑÐ½Ð°Ñ Ð´Ð¾ÑÑавка",p="ÐÑиÑÑно, не пÑавда ли?";else{const g=f[u+1];if(g)if(g.price===0){const _=n-e;p=`Ðо беÑплаÑной не Ñ
ваÑÐ°ÐµÑ ${o(_)}`}else{const _=g.from-e;p=`ÐÑе ${o(_)} и доÑÑавка ÑÑÐ°Ð½ÐµÑ ${o(g.price)}`}else if(n>0&&e<n){const _=n-e;p=`Ðо беÑплаÑной не Ñ
ваÑÐ°ÐµÑ ${o(_)}`}else p=""}return{rankNumber:u+1,progressPercent:k,rangTitle:y,rangDescription:p}}),K=f.find(r=>e>=r.from&&e<=r.to),ie=K?K.price:a,V=C.find(r=>e>=(r.rankNumber===1?0:f[r.rankNumber-2].from)&&e<=f[r.rankNumber-1].to)||C[0];return d=V.rangTitle,c=V.rangDescription,{currentTier:ie,ranks:C,rangTitle:d,rangDescription:c}}),ne=b(()=>{const s=i.value?.has_promo&&i.value.discount_sum&&!i.value.not_affects_on_minimal_order?i.value.discount_sum:0,e=(j.value||0)-$.value+s;return{remained:e,match:e<=0}}),G=b(()=>{if(h.value.isDelivery&&h.value.hasZone){const s=l.value.free_delivery_min_price,e=i.value?.has_promo&&i.value.discount_sum&&!i.value.not_affects_on_minimal_order?i.value.discount_sum:0,t=s-$.value+e,n=s>0;return{remained:t,show:n,match:n&&t<=0}}return{remained:0,show:!1,match:!0}}),ae=b(()=>{const s=i.value?.has_promo,e=b(()=>`1 ${pe(1,"подаÑок","подаÑка","подаÑков")}`);return{hasPromo:s,isOnePlusOne:i.value?.discount_type===7,onePlusOne:i.value?.one_plus_one||null,discountSum:i.value?.discount_sum,giftCount:i.value?.gifts?.length,gifts:i.value?.gifts||[],verboseGifts:e.value,enteredPoints:q.value||0}}),se=b(()=>{const s=h.value.organization?.stop_list||[],e=h.value.organization?.prohibited_to_sell||[],t=ee.value.map(c=>c.id),n=t.filter(c=>s.includes(c)),a=t.filter(c=>e.includes(c));let v;const d=B.value.length>0||Z.value.length>0||te.value.some(c=>
1c.only_pre_order);return+I.stopListType==1&&(v=d),+I.stopListType==2&&(v=B.value.length>0),a.length>0&&(v=!0),{all:s,hasStops:n.length,stopped:n,hasCheckStops:d,missingFromCatalog:Z.value,prohibitedInCart:a,cartBlocked:v}}),oe=b(()=>{const s=h.value.organization||{},e=h.value.isDelivery?"default_delivery_time_slots":"default_takeaway_time_slots",t=h.value.isDelivery?"delivery_dates_restrictions":"takeaway_dates_restrictions",n=s[t]||[],a=s[e]||[];return{hasSlots:!!s[e]?.length,slots:a,restrictions:n}});return{zoneData:h,priceData:re,minOrderData:ne,freeDeliveryData:G,promoData:ae,stopListData:se,slotsData:oe,priceDeliveryRang:N}};export{de as u};
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.