1import{aY as Oe,bU as ge,c9 as De,bF as p,aL as s,bu as b,b1 as v,b2 as n,di as V,dj as j,dk as Q,dl as U,aK as w,aM as c,bl as q,b3 as d,bh as a,c5 as Re,bn as G,a$ as f,be as P,bE as L,cb as Y,bB as ye,b_ as ee,bA as Le,bI as R,bH as M,bC as ze,c2 as be,b7 as N,bq as te,bc as g,bp as K,bL as z,bf as A,cu as X,bV as ve,bd as he,b5 as oe,bP as we,cp as qe,bz as Ce,b6 as Z,bW as ue,bg as Ge,b4 as Me,bG as He,aP as Ne,aR as Fe,b0 as C,aU as ae,b9 as $,bT as _e,dm as We,bR as Ve}from"./Bgs6eNSj.js";import{t as S,$ as ie}from"./ZuS3-68E.js";import{v as Ie,P as D,u as T,a as Pe}from"./BJBs_h8m.js";import{$ as W}from"./BcCU186_.js";import{f as fe,r as me,e as ke}from"./DSHeSuKR.js";import{$ as je}from"./C_TWLZHi.js";import{v as Qe,R as Ue}from"./saIk-JY7.js";import{v as Se}from"./BlRRc0pT.js";import{N as Ye}from"./CnwP0d6z.js";import{P as Xe}from"./harGuTh7.js";import{a as Ke,S as Ze}from"./CbdWOph4.js";import{A as se,$ as Je}from"./D3xTsx6v.js";import{u as $e}from"./BS3a-M1C.js";import{h as et,M as tt}from"./SCDZwhQL.js";import{w as Te}from"./CkqMZvFM.js";import{L as Ae}from"./B_Dir3Rk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new e.Error().stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="23225f33-6424-49ee-917e-7334f61a2dd2",e._sentryDebugIdIdentifier="sentry-dbid-23225f33-6424-49ee-917e-7334f61a2dd2")}catch{}})();const ot=Oe({name:"StarIcon",components:{IconWrapper:$e},props:{size:{type:String,default:ge.L},fill:{type:String,default:"var(--mono-900)"}}}),it=["fill"];function st(e,i,t,m,r,o){const u=p("IconWrapper");return s(),b(u,{size:e.size},{default:v(()=>[n("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.28818 1.90963C7.586 1.14123 8.67324 1.14122 8.97106 1.90963L10.3714 5.52281L14.2405 5.73812C15.0633 5.78391 15.3993 6.81793 14.7606 7.33863L11.757 9.787L12.7478 13.5332C12.9585 14.3299 12.0789 14.969 11.3863 14.5224L8.12962 12.4224L4.87292 14.5224C4.18033 14.969 3.30072 14.33 3.51144 13.5332L4.50228 9.787L1.49869 7.33863C0.859927 6.81794 1.19589 5.78391 2.01873 5.73812L5.8878 5.52281L7.28818 1.90963ZM8.12962 4.35052L7.26374 6.58461C7.1357 6.91496 6.8262 7.13983 6.47244 7.15952L4.08013 7.29265L5.9373 8.80652C6.21193 9.03038 6.33014 9.39423 6.23955 9.73675L5.6269 12.0531L7.64057 10.7546C7.93834 10.5626 8.32091 10.5626 8.61867 10.7546L10.6323 12.0531L10.0197 9.73675C9.9291 9.39422 10.0473 9.03038 10.3219 8.80652L12.1791 7.29265L9.7868 7.15952C9.43304 7.13983 9.12354 6.91496 8.9955 6.58461L8.12962 4.35052Z",fill:e.fill},null,8,it)]),_:1},8,["size"])}const rt=De(ot,[["render",st]]),nt=(e,i)=>{const t=[...e];switch(i){case V.RATING:return j(t,U.RATING,Q.DESC);case V.CHEAP_FIRST:return j(t,U.PRICE,Q.ASC);case V.EXPENSIVE_FIRST:return j(t,U.PRICE,Q.DESC);case V.SORT_ORDER:return j(t,U.SORT_ORDER,Q.DESC);case V.AVG_SCORE:return j(t.filter(r=>r.scores_count&&r.scores_count>10),U.AVG_SCORE,Q.DESC).concat(t.filter(r=>!r.scores_count||r.scores_count<=10))}},ct=(e,i,t)=>{if(!e?.id)return 0;const m=i?.find(r=>r.id===e.id);if(t?.length&&m?.available_modifiers?.length){const r=new Map;m.available_modifiers.forEach(o=>{r.set(`${o.id}-${o.group_id}`,o)});for(const o of t){const u=r.get(`${o.id}-${o.group_id}`);if(u?.price_before_discount)return u.price_before_discount}}return e.price_before_discount||m?.price_before_discount||0},dt=1500,at={name:"ProductActions",components:{PinIcon:je,GTooltip:fe,PlusIcon:W,MinusIcon:Ie},emits:["close"],setup(){const{convert:e}=te();return{convert:e}},props:{product:{type:Object},isCombo:{type:Boolean},isRecommendations:{type:Boolean},modifiers:{type:Array},arrCommentIds:{type:Array},gift:{type:Object},sel_modifiers:{type:Object},newPrice:{type:Number},modifiersValidationState:{type:Object}},data(){return{TooltipPosition:ke,Sizes:N,currentProductModifier:null,isLoading:!1}},computed:{TooltipTrigger(){return me},...M(T,["isValidEverything","isValidChoiceModifiers","getCartContext"]),...M(R,["products","getIsAgeVerified","getAdultProductsIds"]),...M(ee,["getExactlySameProductInCart","getVariantIdx"]),...M(be,["deliveryAddress","getDeliverySelfDepartment"]),...M(ze,["isClientInitialized"]),disableButton(){return(!this.isValidEverything||!this.isValidChoiceModifiers)&&this.isCombo},cartContext(){return this.getCartContext},hasCustomFooter(){return this.cartContext.mode!==D.CATALOG},footerLabel(){switch(this.cartContext.mode){case D.ORDER:return this.$t("goToProductCard");case D.EDIT:return this.$t("save");case D.ADD:return this.$t("toCart");default:return this.$t("toCart")}},footerShowPrice(){return this.cartContext.mode!==D.ORDER},footerDisabled(){return this.cartContext.mode===D.ORDER?!1:this.disableButton},isShowTooltip(){return!this.addressSelected&&!this.isRecommendations&&this.isClientInitialized},showAdultWarning(){return!this.getIsAgeVerified&&this.getAdultProductsIds.includes(this.product.id)},discount(){return ct(this.product,this.products,this.modifiers)},productInCart(){return this.getExactlySameProductInCart({id:this.product.id,sel_modifiers:this.sel_modifiers||this.modifiers,kitchen_comments:this.arrCommentIds})}
1,productCount(){return this.gift?this.gift.selected_count:this.productInCart?.quantity?this.productInCart.quantity:null},availableProduct(){return this.productInCart?this.currentProductModifier||this.productInCart:this.currentProductModifier||this.product},displayPrice(){return this.modifiers&&this.modifiers.length>0?this.newPrice:this.productInCart?this.productInCart.price:this.product?this.product.price:""},isMobile(){return this.$device.isMobile},addressSelected(){return this.deliveryAddress&&!!Object.keys(this.deliveryAddress).length||!!this.getDeliverySelfDepartment}},methods:{...Y(R,{openAdultConfirmationAction:"openAdultConfirmation",addProductAction:"addProduct",removeProductAction:"removeProduct"}),...Y(Le,{openModalAction:"openModal"}),...Y(ee,{updateProductAction:"updateProduct"}),...Y(T,["setCartContext"]),...Y(ye,["addDisplayError"]),onFooterClick(){if(this.cartContext.mode===D.ORDER){this.goToFullCard();return}this.save()},goToFullCard(){this.setCartContext({mode:D.CATALOG,idx:null,quantity:0})},buildModifiersPayload(){return(this.modifiers||[]).map(e=>({id:e.id,quantity:e.quantity??1,group_id:e.group_id}))},async save(){if(!this.addressSelected){this.addressSelectedHandler();return}const e=async()=>{if(this.isLoading=!0,!this.modifiersValidationState?.isValid){this.displayModifiersErrors(this.modifiersValidationState),this.isLoading=!1;return}const i=this.buildModifiersPayload(),t={...this.product,modifiers:i};if(this.cartContext.mode===D.EDIT)await this.updateProductAction({product:t,idx:this.cartContext.idx??-1,quantity:this.cartContext.quantity||1,kitchen_comments:this.arrCommentIds});else{const m={id:t.id,sel_modifiers:i,kitchen_comments:this.arrCommentIds},r=this.getExactlySameProductInCart(m);await this.updateProductAction({product:t,idx:this.getVariantIdx(m),quantity:(r?.quantity??0)+1,kitchen_comments:this.arrCommentIds})}this.isLoading=!1,this.currentProductModifier=null,this.$emit("close")};if(this.showAdultWarning){await this.openAdultConfirmationAction(e);return}await e()},async addProduct(){if(!this.addressSelected){this.addressSelectedHandler();return}const e=async()=>{if(this.addressSelected){if(this.isLoading=!0,this.setModifier(),!this.modifiersValidationState?.isValid){this.displayModifiersErrors(this.modifiersValidationState);return}await this.addProductAction({product:this.availableProduct,arrCommentIds:this.arrCommentIds,isRecommendation:!1}),this.isLoading=!1,this.isCombo&&this.$emit("close"),this.currentProductModifier=null}else this.addressSelectedHandler();this.isLoading=!1};if(this.showAdultWarning){await this.openAdultConfirmationAction(e);return}await e()},addressSelectedHandler(){this.$emit("close"),this.openModalAction({modalName:"AddressSelecting",componentProps:{isCustomLayout:!0}})},async removeProduct(){this.setModifier(),await this.removeProductAction(this.availableProduct),this.currentProductModifier=null,this.isLoading=!1},setModifier(){if(this.productInCart?.sel_modifiers){this.currentProductModifier={...this.productInCart},this.currentProductModifier.modifiers=this.currentProductModifier?.sel_modifiers.map(e=>({id:e.id,quantity:e.quantity??1,group_id:e.group_id}));return}this.product&&this.modifiers&&(this.currentProductModifier={...this.product},this.currentProductModifier.modifiers=this.modifiers.map(e=>({id:e.id,quantity:e.quantity??1,group_id:e.group_id})))},displayModifiersErrors(e){const i=Object.entries(e.errors),t=new Map([[L.REQUIRED_MODIFIER,{}],[L.MODIFIER_QUANTITY,{}]]);for(const[m,r]of i){const o=this.product.modifier_groups?.find(_=>_.id==m),{key:u,value:l}=this.collectSingleModifierError(m,r,o),h=t.get(u);h&&t.set(u,{...h,...l})}t.forEach((m,r)=>{Object.keys(m).length>0&&this.addDisplayError(r,m,dt)})},collectSingleModifierError(e,i,t){switch(i.type){case"required":return{key:L.REQUIRED_MODIFIER,value:{[e]:this.$t("selectNMore",{n:(t.min_count??t.min_modifiers_count)||1})}};case"min_count":return{key:L.MODIFIER_QUANTITY,value:{[e]:this.$t("selectNMore",{n:i.min-i.total})}};case"max_count":return{key:L.MODIFIER_QUANTITY,value:{[e]:this.$t("maxAmountIsN",{n:i.max})}};default:return{key:L.REQUIRED_MODIFIER,value:{[e]:this.$t("noValues")}}}}}},lt={class:"info-tooltip"},ut={class:"product-action"},ht=["disabled"],ft={class:"product-price"},mt={key:0},pt={class:"product-price"},_t={key:1},gt={key:2,class:"product-discount"},yt={key:3};function bt(e,i,t,m,r,o){const u=p("PinIcon"),l=p("MinusIcon"),h=p("PlusIcon"),_=p("GTooltip");return s(),b(_,{position:r.TooltipPosition.TOP,trigger:o.isShowTooltip?o.TooltipTrigger.SHOW_ALWAYS:o.TooltipTrigger.HIDE,class:"product-action__tooltip"},{content:v(()=>[n("div",lt,[n("button",{class:"info-tooltip-button",onClick:i[0]||(i[0]=(...y)=>o.addressSelectedHandler&&o.addressSelectedHandler(...y))},[f(u,{size:r.Sizes.M,fill:"var(--mono-100)"},null,8,["size"]),q(" "+d(e.$t("chooseAddress")),1)]),n("span",null,d(e.$t("toAddToCart")),1)])]),default:v(()=>[n("div",ut,[o.hasCustomFooter?(s(),c("button",{key:0,class:"card-counter-buttons","data-testid":"productPopupCustomAction",disabled:o.footerDisabled,onClick:i[1]||(i[1]=(...y)=>o.onFooterClick&&o.onFooterClick(...y))},[n("span",ft,[q(d(o.footerLabel)+" ",1),o.footerShowPrice&&o.displayPrice?(s(),c("span",mt,"Â "+d(m.convert(o.displayPrice)),1)):a("",!0)])],8,ht)):(s(),b(Re(o.productC
1ount?"div":"button"),{key:1,class:"card-counter-buttons","data-testid":"productPopupAddToCart",disabled:o.disableButton,onClick:o.addProduct},{default:v(()=>[o.productCount?(s(),c("button",{key:0,"data-testid":"productPopupDecrementProduct",class:"counter-button",onClick:i[2]||(i[2]=G((...y)=>o.removeProduct&&o.removeProduct(...y),["stop"]))},[f(l,{size:r.Sizes.M,fill:"var(--exeption-100)"},null,8,["size"])])):a("",!0),n("span",pt,[t.isRecommendations?a("",!0):(s(),c(P,{key:0},[q(d(e.$t("toCart"))+"Â ",1)],64)),o.displayPrice?(s(),c("span",_t,d(m.convert(o.displayPrice)),1)):a("",!0),o.discount&&!t.isRecommendations?(s(),c("span",gt,d(m.convert(o.discount))+"Â ",1)):a("",!0),o.productCount&&!t.isRecommendations?(s(),c("span",yt," Â x "+d(e.$t("nPiecesShort",{n:o.productCount})),1)):a("",!0)]),o.productCount?(s(),c("button",{key:1,"data-testid":"productPopupIncrementProduct",class:"counter-button",onClick:i[3]||(i[3]=G((...y)=>o.addProduct&&o.addProduct(...y),["stop"]))},[f(h,{size:r.Sizes.M,fill:"var(--exeption-100)"},null,8,["size"])])):a("",!0)]),_:1},8,["disabled","onClick"]))])]),_:1},8,["position","trigger"])}const vt=w(at,[["render",bt],["__scopeId","data-v-18147183"]]),wt=(e,i)=>{let t,m;return function(...r){m?(t&&clearTimeout(t),t=setTimeout(()=>{Date.now()-(m||0)>=i&&(e.apply(this,r),m=Date.now())},i-(Date.now()-(m||0)))):(e.apply(this,r),m=Date.now())}},Ct={name:"ProductScore",components:{StarIcon:rt},props:{product:{required:!0},showFullInfo:{type:Boolean,default:!0},showInfoAlways:{type:Boolean,default:!1}},data(){return{scoreBlock:!1,isHaveMouse:!1}},computed:{averageScoreValue(){return Math.round(this.product.avg_score*10)/10},averageScore(){const e=this.averageScoreValue;return(e^0)===e&&e!==10?`${e},0`:e.toString().replace(/\./g,",")},ratingValueSchema(){return String(this.averageScoreValue)},showScore(){return this.product.scores_count>10},averageScoreColor(){if(this.product.avg_score<8&&this.product.avg_score>=7)return"yellow";if(this.product.avg_score<7)return"red"},scorePercentBest(){return 100-this.scorePercentGood-this.scorePercentBad},scorePercentGood(){return Math.floor(this.product.scores[1]/(this.product.scores_count/100))},scorePercentBad(){return Math.floor(this.product.scores[0]/(this.product.scores_count/100))}},methods:{showScoreBlock(){this.isHaveMouse&&(this.scoreBlock=!0)},hideScoreBlock(){this.isHaveMouse&&(this.scoreBlock=!1)},toggleScoreBlock(){this.$screen.width<1280||(this.scoreBlock=!this.scoreBlock)},checkScreenSize(){this.isHaveMouse=!window.matchMedia("(max-width: 1024px)").matches}},mounted(){this.isHaveMouse=!window.matchMedia("(max-width: 1024px)").matches,window.addEventListener("resize",wt(this.checkScreenSize,300))}},Mt={key:0,class:"product-score-wrap"},It={class:"score-block"},Pt={class:"score-block__title"},kt={class:"score-block__votes"},St={class:"score-block__votes-percentage"},Tt={class:"score-block__votes-percentage-block"},At={class:"score-block__votes-percentage-block"},Et={class:"score-block__votes-percentage-block"},Bt={class:"score-block-line"},xt={key:2,class:"product-score-always-info"},Ot={class:"product-score-always-info__top"},Dt={class:"product-score-always-info__top-text"},Rt={class:"score-block__title"},Lt={class:"product-score-always-info__top-percentage"},zt={class:"product-score-always-info__top-percentage-block"},qt={class:"product-score-always-info__top-percentage-block"},Gt={class:"product-score-always-info__top-percentage-block"},Ht={class:"score-block__votes"},Nt={class:"score-block-line"};function Ft(e,i,t,m,r,o){const u=p("StarIcon"),l=K;return o.showScore?(s(),c("div",Mt,[t.showInfoAlways?a("",!0):(s(),c("button",{key:0,class:g(["product-score",o.averageScoreColor]),onClick:i[0]||(i[0]=h=>o.toggleScoreBlock()),onMouseover:i[1]||(i[1]=h=>o.showScoreBlock()),onMouseleave:i[2]||(i[2]=h=>o.hideScoreBlock())},[f(u),n("span",null,d(o.averageScore),1)],34)),r.scoreBlock&&t.showFullInfo?(s(),c("div",{key:1,class:"score-block-wrap",onClick:i[3]||(i[3]=h=>o.toggleScoreBlock())},[n("div",It,[n("span",Pt,d(e.$t("xCustomersLiked",{n:t.product.scores_count})),1),n("div",kt,[n("div",St,[n("div",Tt,[f(l,{src:"/img/emoji/grinning-face-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentBest)+"%",1)]),n("div",At,[f(l,{src:"/img/emoji/face-rolling-eyes-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentGood)+"%",1)]),n("div",Et,[f(l,{src:"/img/emoji/confused-face-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentBad)+"%",1)])])]),n("div",Bt,[n("div",{class:"score-block-line_green",style:z({width:o.scorePercentBest+"%"})},null,4),n("div",{class:"score-block-line_yellow",style:z({width:o.scorePercentGood+"%"})},null,4),n("div",{class:"score-block-line_red",style:z({width:o.scorePercentBad+"%"})},null,4)])])])):a("",!0),t.showInfoAlways?(s(),c("div",xt,[n("div",Ot,[n("div",Dt,[f(u),n("span",null,d(o.averageScore),1),n("span",Rt,d(e.$t("xCustomersLiked",{n:t.product.scores_count})),1)]),n("div",Lt,[n("div",zt,[f(l,{src:"/img/emoji/grinning-face-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentBest)+"%",1)]),n("div",qt,[f(l,{src:"/img/emoji/face-rolling-eyes-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentGood)+"%",1)]),n("div",Gt,[f(l,{src:"/img/emoji/confused-face-emoji.webp",width:"24",height:"24",loading:"lazy",fetchpriority:"low"}),n("span",null,d(o.scorePercentBad)+"%",1)])])]),n("div",Ht,[n("div",Nt,[n("div",{class:"score-block-line_green",style:z({width:o.scorePercentBest+"%"})},null,4),n("div",{class:"score-block-line_yellow",style:z({width:o.scorePercentGood+"%"})},null,4),n("div",{class:"score-block-line_red",style:z({width:o.scorePercentBad+"%"})},null,4)])])])):a("",!0)])):a("",!0)}const Wt=w(Ct,[["render",Ft],["__scopeId","data-v-bf458ee3"]]),Vt={name:"ProductTagsIcon",props:{product:{type:Object,required:!0},positionPopover:{type:String,default:S.LEFT,validator(e){return[S.LEFT,S.RIGHT].includes(e)}},max:{type:Number,default:1}},data(){return{Side:S,hoverTag:null}},computed:{...M(R,["getCategories"]),tagsWithIcons(){let e;return this.product?.categories_ids?e=this.getCategories.filter(i=>this.product.categories_ids.includes(i.id)):e=this.getCategories.filter(i=>i.id===this.product.category_id),et(e,this.product).slice(0,this.max)}},methods:{setHoverTag(e){this.hoverTag=e},productTagIndex(e){return this.positionPopover===S.RIGHT?this.tagsWithIcons.length+5-e:e+5}}},jt={class:"product-tags-icon"},Qt=["onMouseover"];function Ut(e,i,t,m,r,o){const u=K;
1return s(),c("div",jt,[(s(!0),c(P,null,A(o.tagsWithIcons,(l,h)=>(s(),c("div",{key:l.id,class:"product-tag",style:z({zIndex:o.productTagIndex(h)}),onMouseover:G(_=>o.setHoverTag(l),["self"]),onMouseleave:i[0]||(i[0]=_=>o.setHoverTag(null))},[f(X,{name:"fade"},{default:v(()=>[r.hoverTag&&r.hoverTag.id===l.id?(s(),c("div",{key:0,class:g(["product-tag__info",{right:t.positionPopover===r.Side.RIGHT,top:o.tagsWithIcons.length>1}])},d(r.hoverTag.title),3)):a("",!0)]),_:2},1024),f(u,{src:l.icon,alt:l.title},null,8,["src","alt"])],44,Qt))),128))])}const Yt=w(Vt,[["render",Ut],["__scopeId","data-v-e590d4a3"]]),Xt={name:"ComboModifier",components:{InfoIcon:Je,PlusIcon:W,ProductTagsIcon:Yt,ProductScore:Wt,AppPicture:se},directives:{clickOutside:Se.directive},props:{modifier:{type:Object,required:!0},platform:{type:String,require:!0},selectedModifiers:{type:Object,required:!0},index:{type:Number,default:0}},data(){return{Side:S,Platform:Pe,showWeightContent:!1,positionBottom:!0}},computed:{...M(R,["getCategories"]),isChosen(){return this.selectedModifiers?.findIndex(e=>e?.id===this.modifier.id&&e?.group_id===this.modifier.group_id)>=0},hasAnyWeightInfo(){return!(!this.modifier.info.calories_100&&!this.modifier.info.carbohydrates_100&&!this.modifier.info.fats_100&&!this.modifier.info.proteins_100)}},methods:{chooseModifier(){const e=T();e.setRemoveComboModifier(null),e.setChosenComboModifier(this.modifier)},removeModifier(){const e=T();e.setChosenComboModifier(null),e.setRemoveComboModifier(this.modifier)},toggleWeightContent(){this.hasAnyWeightInfo&&(this.showWeightContent=!this.showWeightContent)},closeWeightContent(){this.showWeightContent=!1},categories(e){return this.getCategories.find(i=>i.id===e)},checkDistanceTop(){if(this.$refs.comboModifierWeight){const e=this.$refs.comboModifierWeight,i=document.getElementsByClassName("js-product-popup__combo-modifiers")[0],t=e.getBoundingClientRect().top-i.getBoundingClientRect().top;this.positionBottom=t<228}}},watch:{showWeightContent(e){const i=document.getElementsByClassName("js-product-popup__combo-modifiers")[0];e?(this.checkDistanceTop(),i.addEventListener("scroll",this.checkDistanceTop)):i.removeEventListener("scroll",this.checkDistanceTop)}}},Kt={class:"combo-modifier__img"},Zt={key:0,class:"combo-modifier__quantity"},Jt={class:"combo-modifier__weight-button"},$t={class:"combo-modifier__weight-content-wrapper"},eo={key:0,class:"combo-modifier__weight-content-title"},to={key:1,class:"combo-modifier__weight-content-block"},oo={class:"combo-modifier__weight-content-title"},io={class:"combo-modifier__weight-content-subtitle"},so={key:2,class:"combo-modifier__weight-content-block"},ro={class:"combo-modifier__weight-content-title"},no={class:"combo-modifier__weight-content-subtitle"},co={key:3,class:"combo-modifier__weight-content-block"},ao={class:"combo-modifier__weight-content-title"},lo={class:"combo-modifier__weight-content-subtitle"},uo={class:"combo-modifier__img-icon"},ho={class:"combo-modifier__score"},fo={class:"combo-modifier__content"},mo={class:"combo-modifier__title"},po={class:"combo-modifier__subtitle"},_o=["data-testid"],go=["data-testid"];function yo(e,i,t,m,r,o){const u=p("AppPicture"),l=p("InfoIcon"),h=p("PlusIcon"),_=p("ProductTagsIcon"),y=p("ProductScore"),k=ve("click-outside");return s(),c("div",{class:g(["combo-modifier-wrapper",{mobile:t.platform===r.Platform.MOBILE}])},[n("div",{class:g(["combo-modifier",{mobile:t.platform===r.Platform.MOBILE}])},[n("div",Kt,[t.modifier.photo?(s(),b(u,{key:0,src:t.modifier.photo,alt:"",width:"275",height:"275"},null,8,["src"])):a("",!0),f(X,{name:"fade"},{default:v(()=>[o.isChosen?(s(),c("div",Zt,"1")):a("",!0)]),_:1}),t.modifier.info?he((s(),c("div",{key:1,ref:"comboModifierWeight",class:g(["combo-modifier__weight",{"combo-modifier__weight_disabled":!o.hasAnyWeightInfo,"combo-modifier__weight_opened":r.showWeightContent}]),onClick:i[0]||(i[0]=(...E)=>o.toggleWeightContent&&o.toggleWeightContent(...E))},[n("div",Jt,[o.hasAnyWeightInfo?(s(),c(P,{key:0},[r.showWeightContent?a("",!0):(s(),b(l,{key:0,class:"combo-modifier__weight-icon"})),r.showWeightContent?(s(),b(h,{key:1,rotate:r.Side.DIAGONALLY,class:"combo-modifier__weight-icon"},null,8,["rotate"])):a("",!0)],64)):a("",!0),q(" "+d(t.modifier.info.weight),1)]),n("div",$t,[r.showWeightContent?(s(),c("div",{key:0,class:g(["combo-modifier__weight-content",{"combo-modifier__weight-content_position-bottom":r.positionBottom}])},[t.modifier.info.calories_100?(s(),c("div",eo,d(t.modifier.info.calories_100)+" "+d(e.$t("kkal")),1)):a("",!0),t.modifier.info.proteins_100?(s(),c("div",to,[n("div",oo,d(t.modifier.info.proteins_100)+" "+d(e.$t("gramShort")),1),n("div",io,d(e.$t("proteine").toLowerCase()),1)])):a("",!0),t.modifier.info.fats_100?(s(),c("div",so,[n("div",ro,d(t.modifier.info.fats_100)+" "+d(e.$t("gramShort")),1),n("div",no,d(e.$t("fat").toLowerCase()),1)])):a("",!0),t.modifier.info.carbohydrates_100?(s(),c("div",co,[n("div",ao,d(t.modifier.info.carbohydrates_100)+" "+d(e.$t("gramShort")),1),n("div",lo,d(e.$t("carbohydrate").toLowerCase()),1)])):a("",!0)],2)):a("",!0)])],2)),[[k,o.closeWeightContent]]):a("",!0),n("div",uo,[f(_,{style:{bottom:"12px",right:"12px"},product:t.modifier},null,8,["product"])]),n("div",ho,[f(y,{product:t.modifier,"show-info-always":!1,"show-full-info":!0}
1,null,8,["product"])])]),n("div",fo,[n("div",mo,d(t.modifier.name),1),n("div",po,d(t.modifier.consist),1),o.isChosen?(s(),c("button",{key:0,class:"combo-modifier__button combo-modifier__button_chosen","data-testid":`removeComboModifier-${t.index}`,onClick:i[1]||(i[1]=(...E)=>o.removeModifier&&o.removeModifier(...E))},d(e.$t("doCancel")),9,_o)):(s(),c("button",{key:1,class:"combo-modifier__button","data-testid":`chooseComboModifier-${t.index}`,onClick:i[2]||(i[2]=(...E)=>o.chooseModifier&&o.chooseModifier(...E))},d(e.$t("choose")),9,go))])],2)],2)}const bo=w(Xt,[["render",yo],["__scopeId","data-v-906e4f90"]]),le=3,vo={name:"ProductImageInfo",components:{StarFillIcon:Te},emits:["enter","leave"],props:{product:{type:Object}},data(){return{Sizes:N,rest:null,productTags:[]}},computed:{...M(R,["getAllTags"]),productScore(){return this.product.avg_score?this.product.avg_score.toFixed(1).toString().replace(".",","):0},ratingValueSchema(){return Number(this.product.avg_score).toFixed(1)},isMobile(){return this.$screen.width<980}},methods:{setRestTags(){if(this.product.tags){const e=this.getAllTags.filter(i=>this.product?.tags.includes(i.id));e.length>le?(this.productTags=e.slice(0,le),this.rest=e.slice(le,e.length)):(this.productTags=e,this.rest=null)}},mouseEnterHandler(e){this.isMobile||this.openTooltip(e)},openTooltip(){this.$emit("enter")}},watch:{product:{handler(){this.setRestTags()},immediate:!0,deep:!0}},mounted(){this.setRestTags()}},wo={class:"product-image-info"},Co={key:0,class:"score-info"},Mo={class:"score-quantity"},Io={class:"score-text"},Po={key:0,itemprop:"aggregateRating",itemscope:"",itemtype:"https://schema.org/AggregateRating",hidden:""},ko=["content"],So=["content"],To={key:0,class:"tag-image-wrapper"},Ao={key:0,class:"rest-tags"};function Eo(e,i,t,m,r,o){const u=p("StarFillIcon"),l=K;return s(),c("div",wo,[t.product.avg_score?(s(),c("div",Co,[f(u,{size:r.Sizes.L,fill:"var(--system-orange)"},null,8,["size"]),n("span",Mo,d(o.productScore),1),n("span",Io,d(e.$t("ratings",t.product.scores_count)),1),t.product.scores_count>0?(s(),c("div",Po,[n("meta",{itemprop:"ratingValue",content:o.ratingValueSchema},null,8,ko),n("meta",{itemprop:"ratingCount",content:String(t.product.scores_count)},null,8,So),i[2]||(i[2]=n("meta",{itemprop:"bestRating",content:"10"},null,-1)),i[3]||(i[3]=n("meta",{itemprop:"worstRating",content:"0"},null,-1))])):a("",!0)])):a("",!0),n("div",{class:"tags-block",onMouseenter:i[0]||(i[0]=G((...h)=>o.mouseEnterHandler&&o.mouseEnterHandler(...h),["stop"])),onClick:i[1]||(i[1]=(...h)=>o.openTooltip&&o.openTooltip(...h))},[(s(!0),c(P,null,A(r.productTags,h=>(s(),c("div",{key:h.id,class:"tag"},[h.icon?(s(),c("div",To,[f(l,{class:"tag-image",src:h.icon,alt:h.title,width:"24",height:"24"},null,8,["src","alt"])])):a("",!0)]))),128)),r.rest?(s(),c("div",Ao,"+"+d(r.rest.length),1)):a("",!0)],32)])}const Bo=w(vo,[["render",Eo],["__scopeId","data-v-00023642"]]),xo={name:"ProductTagsFullInfo",props:{product:{type:Object}},data(){return{}},computed:{...M(R,["getAllTags"]),productTags(){return this.getAllTags.filter(e=>this.product?.tags.includes(e.id))}},methods:{}},Oo={class:"container"},Do={key:0,class:"tag-image-wrapper"},Ro={class:"tag-info"},Lo={class:"tag-title"},zo={class:"tag-description"};function qo(e,i,t,m,r,o){const u=K;return s(),c("div",Oo,[(s(!0),c(P,null,A(o.productTags,l=>(s(),c("div",{key:l.id,class:"tag"},[l.icon?(s(),c("div",Do,[f(u,{class:"tag-image",src:l.icon,alt:l.title,width:"24",height:"24"},null,8,["src","alt"])])):a("",!0),n("div",Ro,[n("h6",Lo,d(l.title),1),n("p",zo,d(l.description),1)])]))),128))])}const Go=w(xo,[["render",qo],["__scopeId","data-v-ccc527d0"]]),Ho=6,No={name:"ProductImgBlock",directives:{clickOutside:Se.directive},components:{AppPicture:se,GTag:Qe,ProductTagsFullInfo:Go,ProductImageInfo:Bo,ComboModifier:bo,GButton:oe,Swiper:Ze,SwiperSlide:Ke,PlusIcon:W,ArrowBaseIcon:ie},props:{product:{type:Object},modifiers:{type:Array},selModifiers:{type:Object},selectedProductMod:{type:Object},isCombo:{type:Boolean}},data(){return{modules:[Ye,Xe],swiperOptions:{slidesPerView:1,spaceBetween:0}
1,pagination:{el:".product-image-pagination",clickable:!0},navigation:{nextEl:".next-product-slide",prevEl:".prev-product-slide"},minCountPhotos:2,tagTooltip:!1,discountTooltip:!1,defaultModifier:null,Sizes:N,ButtonView:Z,Side:S,Platform:Pe}},computed:{GTAG_VIEW(){return Ue},...M(ee,["getCart","getExactlySameProductInCart"]),...M(be,["isSelfDelivery"]),...M(T,["openModifiersForCombo"]),...M(R,["getIsAgeVerified","getAdultProductsIds","getCategories"]),isMobile(){const{$screen:e}=Ce();return e.width<1024},selectedModifier(){return this.selectedProductMod?this.selectedProductMod:this.defaultModifier?this.defaultModifier:this.product},photoList(){return this.selectedModifier.photos?.slice(0,Ho)||[]},productInCart(){return this.getExactlySameProductInCart({id:this.product.id,sel_modifiers:this.selModifiers||this.modifiers})},productCount(){return this.productInCart?.quantity||null},tooltipClasses(){return{tooltip__discount:this.discountTooltip,tooltip__tags:this.tagTooltip}},arrowClasses(){return{"info-arrow__discount":this.discountTooltip,"info-arrow__tags":this.tagTooltip}},isShowTooltip(){return this.tagTooltip&&this.product.tags.length||this.discountTooltip},showAdultWarning(){return!this.getIsAgeVerified&&this.getAdultProductsIds?.includes(this.product.id)}},methods:{categories(e){return this.getCategories.find(i=>i.id===e)},openDiscountTooltip(){this.tagTooltip=!1,this.discountTooltip=!0},closeOnMobileHandler(){this.isMobile&&(this.tagTooltip=!1)},scrollHandler(){this.isMobile||(this.tagTooltip=!1)},closeTooltip(e){const i=e?.type==="mouseleave",t=e?.type==="click";(!this.isMobile&&i||t)&&(this.tagTooltip=!1)},getGroup(e){return this.product.modifier_groups.find(i=>i.id===e)}},watch:{product:{handler(){const e=this.product.available_modifiers?.filter(i=>i.group_id===0);e?.length?this.defaultModifier=e.find(i=>!!i.is_default):this.defaultModifier=null},immediate:!0}}},Fo={key:1,class:"image-block-container"},Wo={key:0,class:"product-image-quantity"},Vo={key:2,class:"product-image-weight"},jo={key:3,class:"product-image-container"},Qo={key:4,class:"product-popup-swiper"},Uo={class:"product-popup-navigation"},Yo={class:"control-button prev-product-slide"},Xo={class:"control-button next-product-slide"},Ko={key:5,class:"product-image-pagination"},Zo={key:1,class:"discount-info"},Jo={key:2,class:"tags-tooltip-content"};function $o(e,i,t,m,r,o){const u=p("ComboModifier"),l=p("AppPicture"),h=p("GTag"),_=we,y=p("SwiperSlide"),k=p("Swiper"),E=p("ArrowBaseIcon"),B=p("PlusIcon"),ne=p("GButton"),ce=p("ProductTagsFullInfo"),J=p("ProductImageInfo"),de=ve("click-outside");return he((s(),c("div",{class:"product-image-block",onMouseleave:i[6]||(i[6]=(...I)=>o.closeTooltip&&o.closeTooltip(...I))},[n("div",{class:g(["product-image-wrapper",{"product-image-wrapper_mobile":o.isMobile}]),onClick:i[4]||(i[4]=(...I)=>o.closeOnMobileHandler&&o.closeOnMobileHandler(...I))},[t.isCombo?(s(),c("div",{key:0,class:"combo-modifiers-block scroll-default-small",onScroll:i[0]||(i[0]=(...I)=>o.scrollHandler&&o.scrollHandler(...I))},[(s(!0),c(P,null,A(e.openModifiersForCombo.modifiers,(I,H)=>(s(),b(u,{key:H,index:H,modifier:I,platform:r.Platform.DESKTOP,"selected-modifiers":t.modifiers},null,8,["index","modifier","platform","selected-modifiers"]))),128))],32)):(s(),c("div",Fo,[o.productCount?(s(),c("div",Wo,d(o.productC
1ount),1)):a("",!0),e.isSelfDelivery&&t.product.self_discount_percent?(s(),c("div",{key:1,class:"product-image-discount",onMouseenter:i[1]||(i[1]=(...I)=>o.openDiscountTooltip&&o.openDiscountTooltip(...I)),onMouseleave:i[2]||(i[2]=I=>r.discountTooltip=!1)},d(e.$t("pickup"))+" - "+d(t.product.self_discount_percent)+"% ",33)):a("",!0),o.selectedModifier.info.weight?(s(),c("div",Vo,d(o.selectedModifier.info.weight),1)):a("",!0),o.photoList.length<r.minCountPhotos?(s(),c("div",jo,[f(_,null,{default:v(()=>[f(l,{class:g(["product-image__img",{"product-image_blurred":o.showAdultWarning}]),src:o.selectedModifier.photo,alt:o.selectedModifier.name,sizes:"mobile:100vw tablet:432px desktop:601px",itemprop:"image",densities:"x1 x2"},null,8,["class","src","alt"]),o.showAdultWarning?(s(),b(h,{key:0,class:"adult-tag",size:r.Sizes.XS,view:o.GTAG_VIEW.DEFAULT},{default:v(()=>[q(d(e.$t("Ð¢Ð¾Ð²Ð°Ñ 18+")),1)]),_:1},8,["size","view"])):a("",!0)]),_:1})])):(s(),c("div",Qo,[f(k,qe({class:"product-popup-swiper"},r.swiperOptions,{navigation:r.navigation,pagination:r.pagination,modules:r.modules}),{default:v(()=>[(s(!0),c(P,null,A(o.photoList,(I,H)=>(s(),b(y,{key:H,class:"swiper-slide"},{default:v(()=>[f(l,{class:g(["product-image__img",{"product-image_blurred":o.showAdultWarning}]),src:I,alt:t.product.name,sizes:"mobile:100vw tablet:432px desktop:601px",itemprop:"image",densities:"x1 x2",loading:"lazy",decoding:"async"},null,8,["class","src","alt"]),o.showAdultWarning&&H===0?(s(),b(h,{key:0,class:"adult-tag",size:r.Sizes.XS,view:o.GTAG_VIEW.DEFAULT},{default:v(()=>[q(d(e.$t("Ð¢Ð¾Ð²Ð°Ñ 18+")),1)]),_:1},8,["size","view"])):a("",!0)]),_:2},1024))),128))]),_:1},16,["navigation","pagination","modules"]),n("div",Uo,[n("button",Yo,[f(E,{fill:"var(--mono-100)"})]),n("button",Xo,[f(E,{fill:"var(--mono-100)",rotate:r.Side.RIGHT},null,8,["rotate"])])])])),o.photoList.length>1?(s(),c("div",Ko)):a("",!0),f(X,{name:"slide-fade"},{default:v(()=>[o.isShowTooltip?(s(),c("div",{key:0,class:g(["tooltip",o.tooltipClasses]),onMouseleave:i[3]||(i[3]=(...I)=>o.closeTooltip&&o.closeTooltip(...I))},[o.isMobile&&!r.discountTooltip?(s(),b(ne,{key:0,class:"close-tooltip-button",view:r.ButtonView.GHOST,"only-icon":"",size:r.Sizes.XS,onClick:o.closeTooltip},{default:v(()=>[f(B,{rotate:r.Side.DIAGONALLY,size:r.Sizes.S},null,8,["rotate","size"])]),_:1},8,["view","size","onClick"])):a("",!0),r.discountTooltip?(s(),c("p",Zo,d(e.$t("discountIsValidIfYouPickUpTheDishFromTheRestaurant")),1)):a("",!0),r.tagTooltip?(s(),c("div",Jo,[f(ce,{product:t.product},null,8,["product"])])):a("",!0)],34)):a("",!0)]),_:1}),f(X,{name:"slide-fade"},{default:v(()=>[o.isShowTooltip?(s(),c("span",{key:0,class:g([o.arrowClasses,"info-arrow"])},null,2)):a("",!0)]),_:1})]))],2),f(J,{class:"product-image-info",product:t.product,onEnter:i[5]||(i[5]=I=>r.tagTooltip=!0)},null,8,["product"])],32)),[[de,o.closeTooltip]])}const ei=w(No,[["render",$o],["__scopeId","data-v-81fd4752"]]),ti={name:"QuantityTag",components:{GTooltip:fe},props:{quantity:{type:Number},maxQuantity:{type:Number},view:{type:String,default:"default"},error:{type:String},wasErrored:{type:Boolean}},computed:{TooltipTrigger(){return me},TooltipPosition(){return ke},isEqual(){return this.quantity===this.maxQuantity},classes(){return{quantity__equal:this.isEqual,quantity__error:!!this.wasErrored,[`quantity__${this.view}`]:!!this.view}}}},oi={key:0},ii={key:1},si={class:"error-message"};function ri(e,i,t,m,r,o){const u=p("GTooltip");return s(),b(u,{trigger:t.error?o.TooltipTrigger.SHOW_ALWAYS:o.TooltipTrigger.HIDE,position:o.TooltipPosition.BOTTOM,error:""},{content:v(()=>[n("span",si,d(t.error),1)]),default:v(()=>[n("span",{class:g(["quantity",o.classes])},[t.maxQuantity?(s(),c("span",oi,d(e.$t("xFromY",{x:t.quantity,y:t.maxQuantity})),1)):a("",!0),t.quantity&&!t.maxQuantity?(s(),c("span",ii,d(t.quantity),1)):a("",!0)],2)]),_:1},8,["trigger","position"])}const pe=w(ti,[["render",ri],["__scopeId","data-v-962011dd"]]),ni={name:"ProductInfoTitle",components:{QuantityTag:pe,ArrowBaseIcon:ie},emits:["toggle"],props:{show:{type:Boolean},title:{type:String},quantity:{type:Number},showQuantity:{type:Boolean},isMultiple:{type:Boolean},withoutArrow:{type:Boolean,default:!1},maxQuantity:{type:Number},color:{type:String},error:{type:String},inTooltip:{type:Boolean},wasErrored:{type:Boolean}},data(){return{Side:S}},methods:{toggleInfo(){this.$emit("toggle")}}},ci={class:"product-info-header"};function di(e,i,t,m,r,o){const u=p("QuantityTag"),l=p("ArrowBaseIcon");return s(),c("button",{class:g(["product-info-button",{"product-info-button__showed":!t.withoutArrow}]),onClick:i[0]||(i[0]=G((...h)=>o.toggleInfo&&o.toggleInfo(...h),["prevent"]))},[n("span",ci,[n("span",{class:g(["product-info-title",{"product-info-title_in-tooltip":t.inTooltip}]),style:z({color:t.color})},d(t.title),7),f(u,{quantity:t.quantity,"max-quantity":t.maxQuantity,error:t.error,"was-errored":t.wasErrored},null,8,["quantity","max-quantity","error","was-errored"])]),t.withoutArrow?a("",!0):(s(),b(l,{key:0,rotate:t.show?r.Side.UP:r.Side.DOWN},null,8,["rotate"]))],2)}const re=w(ni,[["render",di],["__scopeId","data-v-4819c94d"]]),ai={name:"NutrientsAndConsist",components:{ProductInfoTitle:re},props:{product:{type:Object},inTooltip:{type:Boolean,default:!1},defaultShow:{type:Boolean,default:!0}},data(){return{show:!0,Side:S}},computed:{tableData(){const e=[];return this.hundredGramNutrients.show&&e.push({head:"100г",data:this.makeNutrientsData({calories_100:this.product.info.calories_100,proteins_100:this.product.info.proteins_100,fats_100:this.product.info.fats_100,carbohydrates_100:this.product.info.carbohydrates_100})}),this.allDishesNutrients.show&&e.push({head:this.product.info.weight,data:this.makeNutrientsData({calories:this.product.info.calories,proteins:this.product.info.proteins,fats:this.product.info.fats,carbohydrates:this.product.info.carbohydrates})}),e},hundredGramNutrients(){const e={calories_100:this.product.info.calories_100,proteins_100:this.product.info.proteins_100,fats_100:this.product.info.fats_100,carbohydrates_100:this.product.info.carbohydrates_100};return{data:e,show:Object.values(e).every(i=>!!i)}},allDishesNutrients(){const e={calories:this.product.info.calories,proteins:this.product.info.proteins,fats:this.product.info.fats,carbohydrates:this.product.info.carbohydrates};return{data:e,show:Object.values(e).every(i=>!!i)}},isIngredients(){return this.hundredGramNutrients.show||this.allDishesNutrients.show}},methods:{makeNutrientsData(e){return Object.entries(e).reduce((i,[t,m])=>(this.product.info&&this.product.info[t]&&i.push({value:m,name:t}),i),[])},translateInfo(e){switch(e){case"calories":case"calories_100":return this.$t("kkal");case"proteins":case"proteins_100":return this.$t("proteine");case"fats":case"fats_100":return this.$t("fat");case"carbohydrates":case"carbohydrates_100":return this.$t("carbohydrate")}},toggleInfo(){this.show=!this.show}},watch:{defaultShow:{handler(e){this.show=e},immediate:!0,deep:!0}}},li={key:0},ui={key:0},hi={class:"table"},fi={class:"table-body"},mi={class:"table__cell-content"};function pi(e,i,t,m,r,o){const u=p("ProductInfoTitle");return o.isIngredients?(s(),c("div",li,[f(u,{title:e.$t("nutrientsAndConsist"),show:r.show,color:t.inTooltip?"var(--mono-100)":"","without-arrow":t.inTooltip,"in-tooltip":t.inTooltip,onToggle:o.toggleInfo},null,8,["title","show","color","without-arrow","in-tooltip","onToggle"]),r.show||t.inTooltip?(s(),c("div",ui,[n("table",hi,[n("tbody",fi,[(s(!0),c(P,
1null,A(o.tableData,(l,h)=>(s(),c("tr",{key:`${l}-${h}`,class:"table__row"},[n("th",{class:g(["table__head",{"table__head_in-tooltip":t.inTooltip}])},d(l.head),3),(s(!0),c(P,null,A(l.data,(_,y)=>(s(),c("td",{key:h+y,class:"table__cell"},[n("div",mi,[n("span",{class:g(["table__cell-value",{"table__cell-value_in-tooltip":t.inTooltip}])},d(_.value),3),n("span",{class:g(["table__cell-unit",{"table__cell-unit_in-tooltip":t.inTooltip}])},d(o.translateInfo(_.name)),3)])]))),128))]))),128))])]),t.product.consist?(s(),c("p",{key:0,class:g(["nutrients-consist",{"nutrients-consist_in-tooltip":t.inTooltip}])},d(t.product.consist),3)):a("",!0)])):a("",!0)])):a("",!0)}const Ee=w(ai,[["render",pi],["__scopeId","data-v-73dbdf52"]]),_i={name:"ConsistProductInfo",components:{ArrowBaseIcon:ie,GButton:oe,NutrientsAndConsist:Ee,StarFillIcon:Te},props:{consistProduct:{type:Object}},data(){return{Side:S,Sizes:N,ButtonView:Z}},computed:{productScore(){return this.consistProduct.avg_score?this.consistProduct.avg_score.toFixed(1).toString().replace(".",","):0},isMobile(){const{$screen:e}=Ce();return e.width<=960},getProductPath(){const i=R().getProductFullInfo(this.consistProduct.id),m=(this._.provides[ue]||this.$route).path.split("/");if(i?.category_url&&i?.url)return`/${m[1]+i.category_url+i.url}`}},methods:{async showProductPopup(){if(!this.getProductPath)return;await T().showProductByPayload(this.consistProduct),await this.$router.push({path:this.getProductPath})}}},gi={class:"consist-header"},yi={class:"consist-title"},bi={key:0,class:"score-info"},vi={class:"score-quantity"},wi={class:"consist-info"},Ci={class:"open-dish-button-body"};function Mi(e,i,t,m,r,o){const u=p("StarFillIcon"),l=p("NutrientsAndConsist"),h=p("ArrowBaseIcon"),_=p("GButton");return s(),c("div",{class:g([{"consist-product-info_mobile":o.isMobile},"consist-product-info"])},[n("div",gi,[n("p",yi,d(t.consistProduct.name),1),o.productScore?(s(),c("div",bi,[f(u,{size:r.Sizes.S,fill:"var(--mono-900)"},null,8,["size"]),n("span",vi,d(o.productScore),1)])):a("",!0)]),n("span",wi,d(t.consistProduct.info.weight),1),f(l,{class:"consist-nutrients",product:t.consistProduct,"in-tooltip":""},null,8,["product"]),o.getProductPath?(s(),b(_,{key:0,class:"open-dish-button",view:r.ButtonView.SECONDARY,size:r.Sizes.XS,onClick:o.showProductPopup},{default:v(()=>[n("span",Ci,[q(d(e.$t("openDish"))+" ",1),f(h,{class:"icon",size:r.Sizes.S,rotate:r.Side.RIGHT},null,8,["size","rotate"])])]),_:1},8,["view","size","onClick"])):a("",!0)],2)}const Ii=w(_i,[["render",Mi],["__scopeId","data-v-ac8cc637"]]),Pi=e=>typeof e=="number"&&Number.isFinite(e);function ki(e,i=m=>m,t=3){if(!e?.length)return 0;const m=10**Math.max(0,t);return e.reduce((o,u,l)=>{const h=i(u,l);return Pi(h)?o+Math.round(h*m):o},0)/m}const Si={name:"IncludedDishesList",components:{GTooltip:fe,PlusIcon:W,GButton:oe,AppPicture:se,ConsistProductInfo:Ii,ProductInfoTitle:re,QuantityTag:pe},props:{product:{type:Object},defaultShow:{type:Boolean,default:!0}},setup(){},data(){return{show:!0,Side:S,Sizes:N,ButtonView:Z,popperOptions:{placement:"bottom",modifiers:{offset:{offset:"0,-5px"}}}}},computed:{TooltipTrigger(){return me},quantityDishes(){return ki(this.product.set_products,e=>e.portion_count)}},methods:{toggleInfo(){this.show=!this.show},closeHandler(){const e=new CustomEvent("close-all-tooltip");window.dispatchEvent(e)}},watch:{defaultShow:{handler(e){this.show=e},immediate:!0,deep:!0}}},Ti={class:"set-consist"},Ai={class:"set-consist_list"},Ei={class:"consist-popover-content"},Bi={class:"close-popover"},xi={class:"constituent-product"},Oi={class:"constituent-product-image-block"},Di={class:"constituent-product-info"},Ri={class:"constituent-product-name"},Li={key:0,class:"constituent-product-description"};function zi(e,i,t,m,r,o){const u=p("ProductInfoTitle"),l=p("PlusIcon"),h=p("GButton"),_=p("ConsistProductInfo"),y=p("AppPicture"),k=p("QuantityTag"),E=p("GTooltip");return s(),c("div",Ti,[f(u,{"show-quantity":"",title:e.$t("dishesInSet"),quantity:o.quantityDishes,show:r.show,onToggle:o.toggleInfo},null,8,["title","quantity","show","onToggle"]),he(n("ul",Ai,[(s(!0),c(P,
1null,A(t.product.set_products,B=>(s(),c("li",{key:B.id},[f(E,{position:"top",trigger:o.TooltipTrigger.HOVER,showDelay:700,hideDelay:100,fallbackPlacements:["top","bottom","left","right"],isOverflow:"",globalCloseable:"",class:"consist-content",ref_for:!0,ref:"consistTooltip"},{content:v(()=>[n("div",Ei,[n("div",Bi,[f(h,{view:r.ButtonView.GHOST,size:r.Sizes.XS,"only-icon":"",onClick:o.closeHandler},{default:v(()=>[f(l,{size:r.Sizes.S,rotate:r.Side.DIAGONALLY},null,8,["size","rotate"])]),_:1},8,["view","size","onClick"])]),f(_,{"consist-product":B},null,8,["consist-product"])])]),default:v(()=>[n("div",xi,[n("div",Oi,[B.photo?(s(),b(y,{key:0,class:"constituent-product-image",src:B.photo,alt:t.product.name,width:"72",height:"72",densities:"x1 x2",loading:"lazy",decoding:"async"},null,8,["src","alt"])):a("",!0)]),n("div",Di,[n("h5",Ri,d(B.name),1),B.info.weight?(s(),c("p",Li,d(B.info.weight),1)):a("",!0)]),f(k,{class:"constituent-product-quantity",quantity:B.portion_count,view:"secondary"},null,8,["quantity"])])]),_:2},1032,["trigger"])]))),128))],512),[[Ge,r.show]])])}const qi=w(Si,[["render",zi],["__scopeId","data-v-227d8092"]]);var F=(e=>(e[e.REPLACEMENT_MODIFIERS=0]="REPLACEMENT_MODIFIERS",e[e.WITH_IMAGE=1]="WITH_IMAGE",e[e.WITHOUT_IMAGE=2]="WITHOUT_IMAGE",e[e.COMBO_MODIFIERS=3]="COMBO_MODIFIERS",e))(F||{});const Gi={name:"ComboButton",props:["group","modifiers","product","selectedModifiers"],computed:{...M(T,["openModifiersForCombo","disableChange"]),isPressed(){return this.openModifiersForCombo.group?.id===this.group.id&&this.openModifiersForCombo.isOpen},chosenModifier(){return this.selectedModifiers?.find(e=>e.group_id===this.group.id)},getPhoto(){for(const e of this.product.available_modifiers)if(e.id===this.chosenModifier.id)return e.photo;return null}},methods:{getModifiers(){const e=[];return this.product.available_modifiers.forEach(i=>{this.group.visual_type===F.COMBO_MODIFIERS&&i.group_id===this.group.id&&e.push(i)}),e},showModifiers(){T().setOpenModifiersForCombo({group:this.group,isOpen:!0,modifiers:this.getModifiers()})}}},Hi={class:"combo-button-wrapper"},Ni=["disabled"],Fi={key:0},Wi={key:1,class:"chosen-modifier"},Vi={class:"chosen-modifier__img"},ji={class:"chosen-modifier__text"},Qi={class:"chosen-modifier__title"},Ui={class:"chosen-modifier__subtitle"};function Yi(e,i,t,m,r,o){const u=K;return s(),c("div",Hi,[n("button",{class:g(["combo-button",{active:o.isPressed,chosen:o.chosenModifier,disabled:e.disableChange}]),"data-testid":"showComboModifiers",disabled:e.disableChange,onClick:i[0]||(i[0]=(...l)=>o.showModifiers&&o.showModifiers(...l))},[o.chosenModifier?(s(),c("div",Wi,[n("div",Vi,[o.getPhoto?(s(),b(u,{key:0,src:o.getPhoto,alt:o.chosenModifier.name,width:"88",height:"88"},null,8,["src","alt"])):a("",!0)]),n("div",ji,[n("div",Qi,d(o.chosenModifier.name),1),n("div",Ui,d(o.chosenModifier.consist),1)])])):(s(),c("div",Fi,d(t.group.title),1))],10,Ni)])}const Xi=w(Gi,[["render",Yi],["__scopeId","data-v-e15506f7"]]),Ki={name:"ComboBundle",components:{ComboButton:Xi},props:["product","selectedModifiers"],computed:{getComboModifiers(){return this.product.modifier_groups.filter(e=>e.visual_type===F.COMBO_MODIFIERS)}}},Zi={class:"combo-wrapper"},Ji={class:"combo__button"};function $i(e,i,t,m,r,o){const u=p("ComboButton");return s(),c("div",Zi,[(s(!0),c(P,null,A(o.getComboModifiers,l=>(s(),c("div",{key:l.id,class:"combo"},[n("div",Ji,[f(u,{group:l,product:t.product,"selected-modifiers":t.selectedModifiers},null,8,["group","product","selected-modifiers"])])]))),128))])}const es=w(Ki,[["render",$i],["__scopeId","data-v-0be0b0d1"]]),ts={name:"ProductModifierCard",components:{QuantityTag:pe,PlusIcon:W,CheckmarkIcon:Ae,MinusIcon:Ie,AppPicture:se},emits:["onClick","increase","decrease"],props:{modifier:{type:Object},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},withoutImage:{type:Boolean},allowStacking:{type:Boolean},quantity:{type:Number},isMax:{type:Boolean}},data(){return{Sizes:N,ButtonView:Z}},computed:{classes(){return{"card-container__active":this.selected,"card-container__disabled":this.disabled}},isImage(){return this.modifier.photos&&this.modifier.photos.length},isPlusButtonHidden(){return this.isMaxCountSelected||!this.disabled&&this.isMax},isMaxCountSelected(){const e=this.modifier.max_number_choose;return e==null||e===0?!1:this.quantity>=e}}
1,methods:{usePrice:te,clickHandler(){this.allowStacking&&this.selected||this.$emit("onClick")}}},os={key:0,class:"card-header"},is={key:0,class:"image-quantity-container"},ss={class:"image-quantity"},rs={key:0,class:"tag-container"},ns={class:"modifier-title"},cs={key:1,class:"card-controls"},ds={key:1},as={key:2,class:"card-controls"},ls={key:0};function us(e,i,t,m,r,o){const u=p("AppPicture"),l=p("QuantityTag"),h=p("MinusIcon"),_=p("PlusIcon"),y=p("CheckmarkIcon");return s(),c("button",{class:g(["card-container",o.classes]),onClick:i[2]||(i[2]=(...k)=>o.clickHandler&&o.clickHandler(...k))},[t.withoutImage?a("",!0):(s(),c("div",os,[f(u,{src:o.isImage?t.modifier.photos[0]:"/img/no-img.webp",class:"card-image",alt:t.modifier.name,width:"300",height:"300",densities:"x1 x2",loading:"lazy",decoding:"async"},null,8,["src","alt"]),t.selected?(s(),c("div",is,[n("span",ss,d(t.quantity),1)])):a("",!0)])),n("div",{class:g(["card-body",{"card-body__without-image":t.withoutImage}])},[t.withoutImage&&t.selected?(s(),c("div",rs,[f(l,{quantity:t.quantity,view:r.ButtonView.PRIMARY},null,8,["quantity","view"])])):a("",!0),n("h6",ns,d(t.modifier.name),1),t.allowStacking?(s(),c("div",cs,[t.quantity>0?(s(),c("button",{key:0,class:g(["control-button",{"control-button_disabled":t.disabled}]),onClick:i[0]||(i[0]=G(k=>e.$emit("decrease"),["stop"]))},[f(h,{size:r.Sizes.S,fill:t.disabled?"var(--mono-500)":"var(--mono-900)"},null,8,["size","fill"])],2)):a("",!0),t.modifier.price?(s(),c("span",ds,d(o.usePrice().convert(t.modifier.price)),1)):a("",!0),n("button",{class:g(["control-button control-button_plus",{"control-button_disabled":t.disabled,"control-button_hidden":o.isPlusButtonHidden}]),onClick:i[1]||(i[1]=G(k=>e.$emit("increase"),["stop"]))},[f(_,{size:r.Sizes.S,fill:t.disabled?"var(--mono-500)":"var(--mono-900)"},null,8,["size","fill"])],2)])):(s(),c("div",as,[t.modifier.price?(s(),c("span",ls,d(o.usePrice().convert(t.modifier.price)),1)):a("",!0),n("button",{class:g(["control-button control-button_plus",{"control-button_disabled":t.disabled}])},[t.selected?(s(),b(y,{key:0,size:r.Sizes.S},null,8,["size"])):(s(),b(_,{key:1,size:r.Sizes.S,fill:t.disabled?"var(--mono-500)":"var(--mono-900)"},null,8,["size","fill"]))],2)]))],2)],2)}const hs=w(ts,[["render",us],["__scopeId","data-v-cc6784d8"]]),fs={name:"ModifierCardView",components:{ProductInfoTitle:re,ProductModifierCard:hs},emits:["clickModifier","increaseModifier","decreaseModifier"],props:{getGroupModifiers:{type:Array},group:{type:Object},disabled:{type:Boolean},sel_modifiers:{type:Object},selectedModifiers:{type:Array},disabledNoChose:{type:Boolean},quantity:{type:Number},maxQuantity:{type:Number},allowStacking:{type:Boolean}},data(){return{wasErrored:!1,ModifiersVisualType:F}},computed:{...M(ye,["displayErrors","hasError"]),getDisplayErrorsModifier(){return{...this.displayErrors?.[L.REQUIRED_MODIFIER]??{},...this.displayErrors?.[L.MODIFIER_QUANTITY]??{}}?.[this.group.id]||null},isMax(){return this.quantity>=this.maxQuantity}},methods:{usePrice:te,beforeClickModifier(e){this.disabled||this.clickModifier(this.group,e)},isModifierSelected(e,i){return this.sel_modifiers?this.sel_modifiers.find(t=>e.id===t.group_id&&t.id===i.id):this.selectedModifiers.find(t=>e.id===t.group_id&&t.id===i.id)},modifierQuantity(e){const i=this.selectedModifiers.find(t=>t.id===e.id);return i?i.quantity:0},clickModifier(e,i){if(this.disabled||this.disabledNoChose&&!this.isModifierSelected(e,i))return null;this.emitModifierEvent("clickModifier",{group:e,modifierByGroup:i})},increaseModifier(e){this.disabled||this.emitModifierEvent("increaseModifier",{group:this.group,modifierByGroup:e})},decreaseModifier(e){this.disabled||this.emitModifierEvent("decreaseModifier",{group:this.group,modifierByGroup:e})},emitModifierEvent(e,i){this.wasErrored=!1,this.$emit(e,i)}},watch:{getDisplayErrorsModifier:{handler(e){e&&(this.wasErrored=!0)}}}},ms={class:"modifier-group"};function ps(e,i,t,m,r,o){const u=p("ProductInfoTitle"),l=p("ProductModifierCard"),h=we;return s(),c("div",null,[f(u,{title:t.group.title,"without-arrow":"","show-quantity":t.group.is_multiple_choice,quantity:t.quantity,"max-quantity":t.maxQuantity,error:o.getDisplayErrorsModifier,"was-errored":r.wasErrored},null,8,["title","show-quantity","quantity","max-quantity","error","was-errored"]),n("div",ms,[f(h,null,{default:v(()=>
1[(s(!0),c(P,null,A(t.getGroupModifiers,(_,y)=>(s(),b(l,{key:_.id,"data-testid":`complementaryModifierButton-${y}`,modifier:_,"allow-stacking":t.allowStacking,"is-max":o.isMax,"without-image":t.group.visual_type===r.ModifiersVisualType.WITHOUT_IMAGE,disabled:t.disabled||t.disabledNoChose&&!o.isModifierSelected(t.group,_),selected:!!o.isModifierSelected(t.group,_),quantity:o.modifierQuantity(_),onOnClick:k=>o.beforeClickModifier(_),onIncrease:k=>o.increaseModifier(_),onDecrease:k=>o.decreaseModifier(_)},null,8,["data-testid","modifier","allow-stacking","is-max","without-image","disabled","selected","quantity","onOnClick","onIncrease","onDecrease"]))),128))]),_:1})])])}const _s=w(fs,[["render",ps],["__scopeId","data-v-50b972c3"]]),gs={name:"ReplacementModifierButtons",emits:["chooseModifier","selectedModifier"],props:{groups:{type:Array,required:!0},sel_modifiers:{type:Object},selectedModifiers:{type:Array},group:{type:Object,required:!0}},data(){return{}},computed:{},methods:{usePrice:te,isModifierSelected(e){const i=this.selectedModifiers.find(t=>t.id===e.id);return i&&this.$emit("selectedModifier",i),i},chooseModifier(e){this.$emit("chooseModifier",e)}}},ys={class:"replacement-modifier-button-wrapper"},bs=["data-testid","disabled","onClick"];function vs(e,i,t,m,r,o){return s(),c("div",ys,[(s(!0),c(P,null,A(t.groups,(u,l)=>(s(),c("button",{key:u.id,class:g(["replacement-modifier-button",{"replacement-modifier-button__active":o.isModifierSelected(u)}]),"data-testid":`replacementModifierButton-${l}`,disabled:t.sel_modifiers,onClick:h=>o.chooseModifier({group:t.group,modifierByGroup:u})},[n("span",{class:g(["replacement-modifier-name",{"replacement-modifier-name_active":o.isModifierSelected(u)}])},d(u.name),3),u.price&&u.price>0?(s(),c("span",{key:0,class:g(["replacement-modifier-price",{"replacement-modifier-price_active":o.isModifierSelected(u)}])},d(o.usePrice().convert(u.price)),3)):a("",!0)],10,bs))),128))])}const ws=w(gs,[["render",vs],["__scopeId","data-v-390fce53"]]),Cs={name:"ModifierView",mixins:[tt],components:{ComboBundle:es,ReplacementModifierButtons:ws,ModifierCardView:_s},emits:["recalcPrice","selectProductMod","selectedModifier","showGroupModifier","change"],props:{product:{type:Object},modifiers:{type:Array},groups:{type:Array},sel_modifiers:{type:Array},userSelectedMods:{type:Array},isCombo:{type:Boolean},onlySelected:{type:Boolean,default:!1}},computed:{...M(T,["openModifiersForCombo","chosenComboModifier","removeComboModifier","disableChange"]),...M(ee,["getProductFromCart"]),currentSelectedMods(){return this.sel_modifiers?this.sel_modifiers:this.userSelectedMods},getModifiersGroups(){return this.modifierGroups.filter(e=>e.visual_type!==F.COMBO_MODIFIERS)},replacementModifiersGroups(){return this.getModifiersGroups.filter(e=>e.id===0)},complementaryModifierGroups(){return this.getModifiersGroups.filter(e=>e.id!==0)},complementaryGroupModifiersVisibility(){return this.complementaryModifierGroups.map(e=>!!this.displayGroupModifiers(e)?.length&&e.id!==0)}},methods:{chooseModifiers(e){const{group:i,modifierByGroup:t}=e;this.clickModifier(i,t),this.$emit("recalcPrice",this.endPrice)},displayGroupModifiers(e){const i=this.getGroupModifiers(e)||[];if(!this.onlySelected)return i;const t=this.product?.sel_modifiers||this.currentSelectedMods||[];return i.filter(m=>t.some(r=>r.id===m.id&&(r.group_id===e.id||e.id===0)))},showReplacementGroupModifier(e){return!!this.displayGroupModifiers(e)?.length&&e.id===0},selectedHandler(e){this.$emit("selectedModifier",e)},setChooseComboModifiers(e){this.chooseModifiers({group:this.openModifiersForCombo.group,modifierByGroup:e})},allowStackingGroup(e){return!!this.normalizedGroupsMap?.[e]?._constraints.allowStacking},increaseModifierHandler(e){const{group:i,modifierByGroup:t}=e;this.increaseModifier(i,t),this.$emit("recalcPrice",this.endPrice)},decreaseModifierHandler(e){const{group:i,modifierByGroup:t}=e;this.decreaseModifier(i,t),this.$emit("recalcPrice",this.endPrice)}},watch:{chosenComboModifier(e){e&&this.setChooseComboModifiers(e)},removeComboModifier(e){e&&this.setChooseComboModifiers(e)},product:{handler(e){e.sel_modifiers&&e.available_modifiers?.length&&e.modifier_groups?.length&&(e.sel_modifiers.forEac
1h(i=>{this.selectModifier(e.modifier_groups.find(t=>t.id===i.group_id),e.available_modifiers.find(t=>t.id===i.id),i.quantity)}),this.onChanges()),this.$emit("recalcPrice",this.endPrice)},deep:!0,immediate:!0},complementaryGroupModifiersVisibility:{handler(e){this.$emit("showGroupModifier",e)}}},mounted(){this.$emit("recalcPrice",this.endPrice)}},Ms={class:"modifier-group-wrap"};function Is(e,i,t,m,r,o){const u=p("ComboBundle"),l=p("ReplacementModifierButtons"),h=p("ModifierCardView");return s(),c("div",Ms,[t.isCombo?(s(),b(u,{key:0,product:t.product,"selected-modifiers":o.currentSelectedMods},null,8,["product","selected-modifiers"])):(s(!0),c(P,{key:1},A(o.replacementModifiersGroups,_=>(s(),c("div",{key:_.id,class:"replacement-modifier-buttons"},[o.showReplacementGroupModifier(_)?(s(),b(l,{key:0,group:_,sel_modifiers:t.sel_modifiers,groups:o.displayGroupModifiers(_),"selected-modifiers":e.selectedModifiers,onChooseModifier:o.chooseModifiers,onSelectedModifier:o.selectedHandler},null,8,["group","sel_modifiers","groups","selected-modifiers","onChooseModifier","onSelectedModifier"])):a("",!0)]))),128)),Me(e.$slots,"default"),(s(!0),c(P,null,A(o.complementaryModifierGroups,(_,y)=>(s(),c("div",{key:_.id},[o.complementaryGroupModifiersVisibility[y]?(s(),b(h,{key:0,"get-group-modifiers":o.displayGroupModifiers(_),group:_,sel_modifiers:t.sel_modifiers,"selected-modifiers":e.selectedModifiers,"disabled-no-chose":e.isDisabledNoChose(_.id),disabled:e.disableChange||t.onlySelected,quantity:e.chosenModifierQuantity(_.id),"max-quantity":e.maxChosenModifierQuantity(_.id),"allow-stacking":o.allowStackingGroup(_.id),onClickModifier:o.chooseModifiers,onIncreaseModifier:o.increaseModifierHandler,onDecreaseModifier:o.decreaseModifierHandler},null,8,["get-group-modifiers","group","sel_modifiers","selected-modifiers","disabled-no-chose","disabled","quantity","max-quantity","allow-stacking","onClickModifier","onIncreaseModifier","onDecreaseModifier"])):a("",!0)]))),128))])}const Ps=w(Cs,[["render",Is]]),ks={name:"ProductIngredientCheckbox",components:{CheckmarkIcon:Ae},props:{selected:{type:Boolean,default:!1}},data(){return{}},methods:{clickHandler(){this.$emit("onClick")}}},Ss={class:"ingredient-text"};function Ts(e,i,t,m,r,o){const u=p("CheckmarkIcon");return s(),c("button",{class:"ingredient-checkbox",onClick:i[0]||(i[0]=(...l)=>o.clickHandler&&o.clickHandler(...l))},[n("span",{class:g(["checkmark",{checkmark__checked:t.selected}])},[t.selected?(s(),b(u,{key:0,fill:"var(--mono-100)"})):a("",!0)],2),n("span",Ss,[Me(e.$slots,"default",{},void 0,!0)])])}const As=w(ks,[["render",Ts],["__scopeId","data-v-102cb553"]]),Es={name:"ProductIngredients",components:{ProductIngredientCheckbox:As,ProductInfoTitle:re},props:{product:{type:Object},defaultShow:{type:Boolean,default:!0},onlySelected:{type:Boolean,default:!1}},data(){return{commentsDetail:!1,comments:[],show:!0,Side:S}},computed:{displayComments(){const e=this.product?.possible_kitchen_comments||[];if(!this.onlySelected)return e;const i=(this.product?.kitchen_comment||[]).map(t=>t.id);return e.filter(t=>i.includes(t.id))}},methods:{toggleInfo(){this.show=!this.show},setComment(e){this.onlySelected||(this.comments.includes(e.id)?this.comments=this.comments.filter(i=>i!==e.id):this.comments.push(e.id),this.$emit("change",this.comments))},commentEnable(e){return this.comments.includes(e)}},watch:{product:{handler(){this.comments=this.product.kitchen_comment?.map(e=>e.id)??[],this.$emit("change",this.comments)},immediate:!0,deep:!0},defaultShow:{handler(e){this.show=e},immediate:!0,deep:!0}}},Bs={key:0},xs={key:0,class:"comment-block"};function Os(e,i,t,m,r,o){const u=p("ProductInfoTitle"),l=p("ProductIngredientCheckbox");return!t.onlySelected||o.displayComments.length?(s(),c("div",Bs,[f(u,{title:e.$t("cookWithout"),show:r.show,"data-testid":"showKitchenComments","show-quantity":"",quantity:r.comments?r.comments.length:0,onToggle:o.toggleInfo},null,8,["title","show","quantity","onToggle"]),r.show?(s(),c("div",xs,[(s(!0),c(P,null,A(o.displayComments,(h,_)=>(s(),b(l,{key:h.id,"data-testid":`kitchenCommentItem-${_}`,selected:o.commentEnable(h.id),onOnClick:y=>o.setComment(h)},{default:v(()=>[q(d(h.title),1)]),_:2},1032,["data-testid","selected","onOnClick"]))),128))])):a("",!0)])):a("",!0)}const Ds=w(Es,[["render",Os],["__scopeId","data-v-702d12d2"]]),Rs={name:"ProductPopupFullInfo",components:{NutrientsAndConsist:Ee,ProductIngredients:Ds,IncludedDishesList:qi,ModifierView:Ps}
1,emits:["setComment","change","recalcPrice","selectProductMod","leave","enter"],props:{product:{type:Object},modifiers:{type:Array},groups:{type:Array},sel_modifiers:{type:Array},userSelectedMods:{type:Array},onlySelected:{type:Boolean,default:!1}},data(){return{fullModifiersInfo:[],totalPrice:0,selectedModifier:null,productInfo:null,defaultShowContent:!0,showProductsIngredients:!0,selectedProductModifier:null}},computed:{...M(T,["disableChange"]),setProduct(){return this.product?.set_products&&this.product.set_products.length>0},isCombo(){return this.product.modifier_groups?this.product.modifier_groups.find(e=>e.visual_type===F.COMBO_MODIFIERS):!1},productDescription(){return this.selectedModifier&&this.selectedModifier.description?this.selectedModifier.description:this.product.description}},methods:{setCurrentModifier(e){this.$emit("change",e)},showGroupModifier(e){this.showProductsIngredients=e.every(i=>i)},recalcPrice(e){this.totalPrice=e,this.$emit("recalcPrice",e)},setSelectedProductMod(e){this.selectedProductModifier=e,this.$emit("selectProductMod",e)},setComment(e){this.$emit("setComment",e)},selectedHandler(e){this.selectedModifier=e}},mounted(){this.$nextTick(()=>{this.$refs.productInfoRef.scrollHeight>this.$refs.productInfoRef.clientHeight&&(this.defaultShowContent=!1)})}},Ls={ref:"productInfoRef",class:"product-info scroll-default-small"},zs={class:"product-info-name"},qs={class:"info-row"},Gs={class:"product-description"}
1,Hs={key:0,class:"info-row"},Ns={key:1,class:"info-row"},Fs={key:2,class:"info-row"};function Ws(e,i,t,m,r,o){const u=p("IncludedDishesList"),l=p("NutrientsAndConsist"),h=p("ProductIngredients"),_=p("ModifierView");return s(),c("div",Ls,[n("h1",zs,d(t.product.name),1),f(_,{product:t.product,groups:t.product.modifier_groups,modifiers:t.product?.available_modifiers||[],sel_modifiers:t.sel_modifiers,"allow-choice-required-remove":!0,"user-selected-mods":r.fullModifiersInfo.modifiers,"is-combo":!!o.isCombo,"only-selected":t.onlySelected,onChange:o.setCurrentModifier,onRecalcPrice:o.recalcPrice,onSelectProductMod:o.setSelectedProductMod,onSelectedModifier:o.selectedHandler,onShowGroupModifier:o.showGroupModifier},{default:v(()=>[n("div",qs,[n("span",Gs,d(o.productDescription),1)]),o.setProduct?(s(),c("div",Hs,[f(u,{product:t.product,"default-show":r.defaultShowContent},null,8,["product","default-show"])])):a("",!0),r.selectedProductModifier||t.product?(s(),c("div",Ns,[f(l,{product:r.selectedProductModifier||t.product,"default-show":r.defaultShowContent},null,8,["product","default-show"])])):a("",!0),t.product.possible_kitchen_comments?(s(),c("div",Fs,[f(h,{product:t.product,"default-show":r.showProductsIngredients,"only-selected":t.onlySelected,onChange:o.setComment},null,8,["product","default-show","only-selected","onChange"])])):a("",!0)]),_:1},8,["product","groups","modifiers","sel_modifiers","user-selected-mods","is-combo","only-selected","onChange","onRecalcPrice","onSelectProductMod","onSelectedModifier","onShowGroupModifier"])],512)}const Vs=w(Rs,[["render",Ws],["__scopeId","data-v-a088493e"]]),js={ref:"modalContent",class:"product-popup",tabindex:"0",itemscope:"",itemtype:"https://schema.org/Product"},Qs={itemprop:"brand",itemscope:"",itemtype:"https://schema.org/Brand",hidden:""},Us=["content"],Ys=["content"],Xs=["content"],Ks=["content"],Zs={itemprop:"offers",itemscope:"",itemtype:"https://schema.org/AggregateOffer",hidden:""},Js=["content"],$s=["content"],er=["content"],tr={ref:"modalScroll",class:"product-popup-body"},or={class:"product-info-wrapper"},ir={class:"product-popup-footer"},sr={__name:"ProductModalContent",props:{product:{type:Object,required:!0}},emits:["closePopup"],setup(e,{emit:i}){const t=He(),m=T(),r=e,o=i,u=$(0),l=$([]),h=$({}),_=$(null),{sel_modifiers:y,openModifiersForCombo:k,gift:E,cartContext:B}=Ne(m),ne=ae(()=>B.value.mode===D.ORDER),ce=ae(()=>t.public.name||""),J=ae(()=>r.product.modifier_groups?r.product.modifier_groups.find(x=>x.visual_type===F.COMBO_MODIFIERS):!1);function de(x){h.value=x}function I(x){_.value=x}function H(x){u.value=x}function Be(x){l.value=x}return Fe(()=>r.product,x=>{x&&(l.value=[],_.value=null)},{deep:!0,immediate:!0}),(x,O)=>(s(),c("article",js,[n("span",Qs,[n("meta",{itemprop:"name",content:C(ce)},null,8,Us)]),n("meta",{itemprop:"productID",content:String(e.product.id)},null,8,Ys),n("meta",{itemprop:"name",content:e.product.name},null,8,Xs),O[4]||(O[4]=n("link",{itemprop:"itemCondition",href:"https://schema.org/NewCondition"},null,-1)),n("meta",{itemprop:"description",content:e.product?.description},null,8,Ks),n("div",Zs,[O[2]||(O[2]=n("link",{itemprop:"availability",href:"https://schema.org/InStock"},null,-1)),O[3]||(O[3]=n("meta",{itemprop:"priceCurrency",content:"RUB"},null,-1)),n("meta",{itemprop:"price",content:String(e.product.min_price)},null,8,Js),n("meta",{itemprop:"lowPrice",content:String(e.product.min_price)},null,8,$s),e.product.has_modifiers?(s(),c("meta",{key:0,itemprop:"highPrice",content:String(e.product?.price)},null,8,er)):a("",!0)]),f(C(oe),{"only-icon":"",class:"product-popup-close",size:C(N).S,view:C(Z).GHOST,"data-testid":"productPopupClose",onClick:O[0]||(O[0]=xe=>o("closePopup"))},{default:v(()=>[f(C(W),{rotate:C(S).DIAGONALLY,size:C(ge).S,fill:"var(--exeption-900)"},null,8,["rotate","size"])]),_:1},8,["size","view"]),n("div",tr,[f(ei,{product:e.product,"sel-modifiers":C(y),modifiers:C(h).modifiers,"selected-product-mod":C(_),"is-combo":!!C(k)?.isOpen&&!!C(J)},null,8,["product","sel-modifiers","modifiers","selected-product-mod","is-combo"]),n("div",or,[(s(),b(Vs,{key:e.product.id,product:e.product,sel_modifiers:C(y),"only-selected":C(ne),onRecalcPrice:H,onChange:de,onSetComment:Be,onSelectProductMod:I},null,8,["product","sel_modifiers","only-selected"]))])],512),n("div",ir,[f(vt,{product:e.product,"is-combo":!!C(J),modifiers:C(h).modifiers,"modifiers-validation-state":C(h).validationState,"arr-comment-ids":C(l),gift:C(E),sel_modifiers:C(y),"new-price":C(u),onClose:O[1]||(O[1]=xe=>o("closePopup"))},null,8,["product","is-combo","modifiers","modifiers-validation-state","arr-comment-ids","gift","sel_modifiers","new-price"])])],512))}},rr=w(sr,[["__scopeId","data-v-3c7a8c96"]]),nr={name:"ProductModal",components:{ArrowBaseIcon:ie,ProductModalContent:rr},setup(){return{isLockScroll:We(document?.body)}},props:{isInCatalog:{type:Boolean,default:!1}},data(){return{categoryIndex:0,productsInCategory:[],hidePrevButton:!1,hideNextButton:!1,Side:S}},computed:{...M(T,["isShow","product"]),...M(R,["getProducts","currentSort","getCategories"]),sortedProducts(){return nt(this.getProducts||[],this.currentSort)}},methods:{productPopupClose(){if(this.isInCatalog){const t=(this._.provides[ue]||this.$route).path.split("/");this.$router.push({path:`/${t[2]}`})}T().closeProductModal()},getCategoryProducts(){const e=this.getCategories[this.categoryIndex];this.productsInCategory=this.sortedProducts.filter(i=>
1i.categories_ids?.includes(e?.id))},nextCategory(){this.categoryIndex<this.getCategories.length-1&&(this.categoryIndex+=1,this.getCategoryProducts(),this.nextProductHandler())},prevCategory(){this.categoryIndex>0&&(this.categoryIndex-=1,this.getCategoryProducts(),this.showProduct(this.productsInCategory[this.productsInCategory.length-1]))},nextProductHandler(){const e=this.productsInCategory.findIndex(i=>i.id===this.product.id);e<this.productsInCategory.length-1?this.showProduct(this.productsInCategory[e+1]):this.nextCategory()},prevProductHandler(){const e=this.productsInCategory.findIndex(i=>i.id===this.product.id);e>0?this.showProduct(this.productsInCategory[e-1]):this.prevCategory()},async showProduct(e){const t=(this._.provides[ue]||this.$route).path.split("/");await this.$router.push({path:`/${t[2]}${e.url}`}),await T().showProductByPayload(e)},handleKeyUp(e){(e.keyCode===39||e.key==="ArrowRight")&&this.nextProductHandler(),(e.keyCode===37||e.key==="ArrowLeft")&&this.prevProductHandler()},closeModalListener(e){e.key==="Escape"&&this.productPopupClose()}},watch:{isShow:{handler(e){if(e&&(this.categoryIndex=this.getCategories.findIndex(i=>i.id===this.product?.category_id),this.getCategoryProducts(),this.isInCatalog)){const{trackProductShow:i}=Ve();i(this.product)}}},product:{handler(e){if(e){_e(!0),this.isLockScroll=!0;const i=this.productsInCategory.findIndex(t=>t.id===this.product.id);this.hidePrevButton=!this.categoryIndex&&!i,this.hideNextButton=this.categoryIndex===this.getCategories.length-1&&i===this.productsInCategory.length-1}else _e(!1),this.isLockScroll=!1},deep:!0,immediate:!0}},mounted(){window.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.closeModalListener)},beforeUnmount(){window.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.closeModalListener)}},cr={class:"button-body"},dr={class:"button-body"};function ar(e,i,t,m,r,o){const u=p("ArrowBaseIcon"),l=p("ProductModalContent");return s(),b(X,{name:"fade"},{default:v(()=>[e.isShow?(s(),c("div",{key:0,class:"product-popup-wrapper modal-open",onClick:i[2]||(i[2]=G((...h)=>o.productPopupClose&&o.productPopupClose(...h),["self"]))},[!r.hidePrevButton&&t.isInCatalog?(s(),c("button",{key:0,"data-testid":"prevProductButton",class:"left-button",onClick:i[0]||(i[0]=(...h)=>o.prevProductHandler&&o.prevProductHandler(...h))},[n("span",cr,[f(u,{rotate:r.Side.LEFT,fill:"var(--exeption-900)"},null,8,["rotate"])])])):a("",!0),!r.hideNextButton&&t.isInCatalog?(s(),c("button",{key:1,"data-testid":"nextProductButton",class:"right-button",onClick:i[1]||(i[1]=(...h)=>o.nextProductHandler&&o.nextProductHandler(...h))},[n("span",dr,[f(u,{rotate:r.Side.RIGHT,fill:"var(--exeption-900)"},null,8,["rotate"])])])):a("",!0),f(l,{product:e.product,onClosePopup:o.productPopupClose},null,8,["product","onClosePopup"])])):a("",!0)]),_:1})}const kr=w(nr,[["render",ar],["__scopeId","data-v-dd021666"]]);export{kr as P,nt as s};
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.