1(function(){var timer;var ajax;PubSub.subscribe('recalcCart',function(e,params){ajax&&ajax.abort&&ajax.abort();clearTimeout(timer);app.updateStore({cartLoading:!0});var timeout=0;if(params.formData){timeout=500} 2var payload={clear:params.clear||null,formData:params.formData||null,changeAmount:params.changeAmount||null,changePromocode:params.changePromocode||null,changeAddress:params.changeAddress||null,repeatCartId:params.repeatCartId||null,addCard:params.addCard||null,checkCard:params.checkCard||null,cartSwitchConfirmed:params.cartSwitchConfirmed||null,env:params.env||null};var target='/cart/recalc3';var fetchCart=function(){ajax=app.fetch(target,payload,function(response){app.updateStore({cartLoading:!1});if(response.error==='confirmCartSwitch'){if(window.confirm(response.message)){payload.cartSwitchConfirmed=!0;fetchCart();return}}else if(response.error==='promoLimitExceeded'){app.growl(response.message,'danger')}else if(response.cart){app.updateStore({cart:response.cart})} 3params.cb&¶ms.cb(response)})};timer=setTimeout(fetchCart,params.noTimeout?0:timeout)})})();app.cartToggleComponent={props:['value'],computed:{isActive(){return!!this.value}},methods:{toggle(){this.$emit('input',this.value?'':1)}},template:` 4 <div class="ctoggle" :class="{'ctoggle--active': isActive}" @click="toggle()"> 5 <i class="ctoggle__flag"></i> 6 </div> 7 `};app.cartBlockComponent={components:{cartToggle:app.cartToggleComponent},props:['withToggle','title','description','value'],computed:{isSlotVisible(){return!!this.value}},methods:{onInput(){this.$emit('input',this.value)}},template:` 8 9 <div class="ctblock"> 10 11 <div v-if="title" class="ctblock__item"> 12 <div v-if="withToggle" class="ctblock__toggle"> 13 <cartToggle v-model="value" @input="onInput"/> 14 </div> 15 16 <div class="ctblock__itemTitle">{{title}}</div> 17 <div v-if="description" class="ctblock__itemDescription">{{description}}</div> 18 </div> 19 20 <div v-if="isSlotVisible" class="ctblock__slot"> 21 <slot/> 22 </div> 23 </div> 24 25 `};app.cartInputComponent={props:['value','caption','name','inputmode','mask'],data(){return{autogrowFn:null,masked:null,text:this.value}},computed:{isFilled(){return this.text.length>0}},mounted(){this.autogrowFn=app.autogrow(this.$refs.textarea);if(this.mask){const code=this.extractFixedPart(this.mask);this.masked=IMask(this.$refs.textarea,{mask:this.mask});this.masked.value=this.value||code;this.text=this.masked.value} 26this.$watch('value',(value)=>{if(this.masked){this.masked.value=value||this.extractFixedPart(this.mask);this.text=this.masked.value;return} 27this.text=value},{immediate:!0});this.$watch('text',()=>{this.autogrowFn.recalc()},{immediate:!0})},methods:{focus(){this.$refs.textarea.focus()},onInput(){if(this.masked){this.masked.updateValue();this.text=this.masked.value;this.$emit('input',this.text);return} 28if(this.text.indexOf("\n")!==-1){this.text=this.text.replace(/\n/g,'')} 29this.$emit('input',this.text)},extractFixedPart(mask){const match=(mask||'').match(/{([^}]+)}/);return match?match[1]:''}},template:` 30 <label class="ctinput2" :class="{'ctinput2--filled': isFilled}"> 31 <div class="ctinput2__caption">{{caption}}</div> 32 <textarea class="ctinput2__text" 33 :name="name" 34 :inputmode="inputmode || 'text'" 35 ref="textarea" 36 v-model="text" 37 @input="onInput()"></textarea> 38 </label> 39 40 `};app.cartSuggestComponent={props:['options','el'],data:function(){return{visible:!1}},mounted:function(){document.body.addEventListener('click',this.clickOutside)},destroyed:function(){document.body.removeEventListener('click',this.clickOutside)},methods:{clickOutside:function(e){if(e.target.closest(this.el)){this.visible=!this.visible;if(this.visible){this.$emit('shown')}}else if(!this.$el.contains(e.target)){this.visible=!1}},select:function(option){this.$emit('selected',option);this.visible=!1}},template:` 41 <div v-if="visible && options" class="csugg"> 42 43 <div class="csugg__scrollable"> 44 <div v-for="option in options" 45 :key="option.id" 46 :data-id="option.id" 47 @click="select(option)"
48 class="csugg__option"> 49 {{option.name}} 50 </div> 51 </div> 52 53 </div> 54 `};Vue.directive('blur-on-focus',{inserted(el){const blurHandler=()=>{if(document.activeElement===el){el.blur()}};el.addEventListener('focus',blurHandler);el.addEventListener('touchstart',blurHandler)},unbind(el){el.removeEventListener('focus',()=>{});el.removeEventListener('touchstart',()=>{})}});app.cartHeaderComponent={props:['title','clear','back','absolute'],methods:{action(event){if(event==='clear'){app.replayAnimation(this.$refs.trash,'trashIco--play',1000);setTimeout(()=>{this.$emit(event)},800);return} 55this.$emit(event)}},template:` 56 <div class="cheader" 57 :class="{'cheader--absolute': absolute}"> 58 59<!-- <transition name="cheader__backTransition" appear>--> 60<!-- <div v-if="back"--> 61<!-- v-press--> 62<!-- class="cheader__back"--> 63<!-- @click="action('back')">--> 64<!-- --> 65<!-- <svg class="cheader__back-ico" width="12" height="21" viewBox="0 0 12 21" fill="none">--> 66<!-- <path d="M11 1.5L2 10.5L11 19.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>--> 67<!-- </svg>--> 68<!-- --> 69<!-- </div> --> 70<!-- </transition>--> 71 72 73 <div class="cheader__title">{{title}}</div> 74 75 <div v-if="clear" 76 class="cheader__trash" 77 v-press 78 @click="action('clear')"> 79 <svg ref="trash" class="cheader__trashIco trashIco" viewBox="0 0 23 23" aria-hidden="true"> 80 <g transform="translate(11.5007 13.5)"> 81 <g transform="translate(-0.0007 0)"> 82 <g class="trashIco__g2" transform="translate(0 2.9888)"> 83 <g class="trashIco__g4"> 84 <path d="M-5.809 -4.088C-6 -3.825 -6 -3.45 -6 -2.7C-6 -2.7 -6 -1.5 -6 -1.5C-6 0.364 -6 1.296 -5.696 2.031C-5.29 3.011 -4.511 3.789 -3.531 4.196C-2.796 4.5 -1.864 4.5 0 4.5C1.864 4.5 2.796 4.5 3.531 4.196C4.511 3.789 5.29 3.011 5.696 2.031C6 1.296 6 0.364 6 -1.5C6 -1.5 6 -2.7 6 -2.7C6 -3.45 6 -3.825 5.809 -4.088C5.747 -4.173 5.673 -4.247 5.588 -4.309C5.325 -4.5 4.95 -4.5 4.2 -4.5C4.2 -4.5 -4.2 -4.5 -4.2 -4.5C-4.95 -4.5 -5.325 -4.5 -5.588 -4.309C-5.673 -4.247 -5.747 -4.173 -5.809 -4.088C-5.809 -4.088 -5.809 -4.088 -5.809 -4.088ZM-2 -2.5C-2.552 -2.5 -3 -2.052 -3 -1.5C-3 -1.5 -3 0.5 -3 0.5C-3 1.052 -2.552 1.5 -2 1.5C-1.448 1.5 -1 1.052 -1 0.5C-1 0.5 -1 -1.5 -1 -1.5C-1 -2.052 -1.448 -2.5 -2 -2.5ZM2 -2.5C1.448 -2.5 1 -2.052 1 -1.5C1 -1.5 1 0.5 1 0.5C1 1.052 1.448 1.5 2 1.5C2.552 1.5 3 1.052 3 0.5C3 0.5 3 -1.5 3 -1.5C3 -2.052 2.552 -2.5 2 -2.5Z" fill-rule="evenodd" fill="#000000"/> 85 </g> 86 </g> 87 </g> 88 <g class="trashIco__g6"> 89 <g class="trashIco__g7" transform="translate(0 -5)"> 90 <g class="trashIco__g8"> 91 <path d="M-7.001 1.489C-7.001 0.936 -6.553 0.489 -6.001 0.489L5.999 0.489C6.552 0.489 6.999 0.936 6.999 1.489L6.999 1.489C6.999 2.041 6.552 2.489 5.999 2.489L-6.001 2.489C-6.553 2.489 -7.001 2.041 -7.001 1.489L-7.001 1.489Z" fill="#000000"/> 92 <path d="M1.016 0.489C0.995 -0.055 0.548 -0.489 0 -0.489C-0.548 -0.489 -0.995 -0.055 -1.016 0.489C-1.016 0.489 -3.016 0.489 -3.016 0.489C-2.995 -1.159 -1.653 -2.489 0 -2.489C1.653 -2.489 2.995 -1.159 3.016 0.489C3.016 0.489 1.016 0.489 1.016 0.489Z" fill="#000000"/> 93 </g> 94 </g> 95 </g> 96 </g> 97 </svg> 98 </div> 99 100 <div class="cheader__close" 101 v-press 102 @click="action('back')"> 103 104 <svg width="38" height="38" viewBox="0 0 38 38" fill="none"> 105 <circle class="cheader__closeBg" cx="19" cy="19" r="19"/>
105 106 <path d="M23.2886 13.2976C23.6825 12.9039 24.3179 12.9012 24.7085 13.2918C25.099 13.6823 25.0965 14.318 24.7027 14.7117L20.4136 18.9988L24.6997 23.2839C25.0935 23.6779 25.0961 24.3134 24.7056 24.7039C24.315 25.0944 23.6787 25.092 23.2847 24.698L18.9996 20.4129L14.7193 24.6931C14.3254 25.0869 13.689 25.0895 13.2984 24.699C12.9078 24.3085 12.9106 23.6728 13.3042 23.2791L17.5845 18.9988L13.2974 14.7117C12.9034 14.3177 12.9 13.6813 13.2906 13.2908C13.6812 12.9002 14.3175 12.9037 14.7115 13.2976L18.9996 17.5847L23.2886 13.2976Z" fill="currentColor"/> 107 </svg> 108 109 </div> 110 111 </div> 112 `};app.cartFooterComponent={inject:['store'],props:['loading','text','disabled','cartLoading','cart','company'],data(){this.resizeObserver=null;this.overlapFrame=null;return{isOverlap:!1,clickTemporarilyLocked:!1}},computed:{isLoading(){return this.cartLoading||this.loading||this.store.ordering},isKaspi(){if(this.store.activeScreen!=='form'){return} 113const kaspi=this.cart.payment.types.kaspiSecondary;const onlineType=kaspi&&!kaspi.off?'kaspiSecondary':'online';return this.cart.payment.activeType===onlineType&&this.company.cartOnlineButtonAppearance==='kaspi'},classes(){return{'cFooter--overlap':this.isOverlap,'cFooter--kaspi':this.isKaspi,'cFooter--disabled':!!this.disabled}}},mounted(){document.addEventListener('scroll',this.scheduleOverlapCheck,{capture:!0,passive:!0});window.addEventListener('resize',this.scheduleOverlapCheck);const content=this.$el.previousElementSibling;if(window.ResizeObserver&&content){this.resizeObserver=new ResizeObserver(this.scheduleOverlapCheck);this.resizeObserver.observe(content)} 114this.scheduleOverlapCheck()},destroyed(){document.removeEventListener('scroll',this.scheduleOverlapCheck,{capture:!0});window.removeEventListener('resize',this.scheduleOverlapCheck);if(this.resizeObserver){this.resizeObserver.disconnect()} 115cancelAnimationFrame(this.overlapFrame)},methods:{scheduleOverlapCheck(){if(this.overlapFrame){return} 116this.overlapFrame=requestAnimationFrame(()=>{this.overlapFrame=null;this.checkOverlap()})},checkOverlap(){const content=this.$el.previousElementSibling;this.isOverlap=!!content&&content.getBoundingClientRect().bottom-this.$el.getBoundingClientRect().top>1},submit(){if(this.isLoading||this.clickTemporarilyLocked){return} 117this.clickTemporarilyLocked=!0;setTimeout(()=>{this.clickTemporarilyLocked=!1},200);this.$emit('submit')}},template:` 118 <div class="cFooter" 119 :class="classes"> 120 121 <div class="cFooter__submit" 122 :class="{'cFooter__submit--disabled': disabled, 'cFooter__submit--loading': isLoading}" 123 v-press 124 @click="submit()"> 125 <transition name="cFooter__fade" mode="out-in"> 126 127 <div v-if="isLoading" :key="0" class="cFooter__spinner"> 128 <i class="cFooter__circle"></i> 129 <i class="cFooter__circle"></i> 130 <i class="cFooter__circle"></i> 131 </div> 132 133 <div v-else-if="isKaspi" :key="1" class="cFooter__kaspi"> 134 <svg width="209" height="28" viewBox="0 0 209 28" fill="none" xmlns="http://www.w3.org/2000/svg"> 135 <path d="M10.708 13.5752V14.3389C10.708 15.2464 10.5946 16.0599 10.3677 16.7793C10.1408 17.4987 9.81429 18.1102 9.38818 18.6138C8.96208 19.1174 8.4502 19.502 7.85254 19.7676C7.26042 20.0332 6.59635 20.166 5.86035 20.166C5.14648 20.166 4.49072 20.0332 3.89307 19.7676C3.30094 19.502 2.7863 19.1174 2.34912 18.6138C1.91748 18.1102 1.58268 17.4987 1.34473 16.7793C1.10677 16.0599 0.987793 15.2464 0.987793 14.3389V13.5752C0.987793 12.6676 1.104 11.8569 1.33643 11.1431C1.57438 10.4237 1.90918 9.81217 2.34082 9.30859C2.77246 8.79948 3.28434 8.41211 3.87646 8.14648C4.47412 7.88086 5.12988 7.74805 5.84375 7.74805C6.57975 7.74805 7.24382 7.88086 7.83594 8.14648C8.43359 8.41211 8.94548 8.79948 9.371
13558 9.30859C9.80322 9.81217 10.1325 10.4237 10.3594 11.1431C10.5918 11.8569 10.708 12.6676 10.708 13.5752ZM9.12256 14.3389V13.5586C9.12256 12.8392 9.04785 12.2028 8.89844 11.6494C8.75456 11.096 8.5415 10.6312 8.25928 10.2549C7.97705 9.87858 7.63118 9.59359 7.22168 9.3999C6.81771 9.20622 6.3584 9.10938 5.84375 9.10938C5.3457 9.10938 4.89469 9.20622 4.49072 9.3999C4.09229 9.59359 3.74919 9.87858 3.46143 10.2549C3.1792 10.6312 2.96061 11.096 2.80566 11.6494C2.65072 12.2028 2.57324 12.8392 2.57324 13.5586V14.3389C2.57324 15.0638 2.65072 15.7057 2.80566 16.2646C2.96061 16.818 3.18197 17.2856 3.46973 17.6675C3.76302 18.0438 4.10889 18.3288 4.50732 18.5225C4.9113 18.7161 5.3623 18.813 5.86035 18.813C6.38053 18.813 6.84261 18.7161 7.24658 18.5225C7.65055 18.3288 7.99089 18.0438 8.26758 17.6675C8.5498 17.2856 8.76286 16.818 8.90674 16.2646C9.05062 15.7057 9.12256 15.0638 9.12256 14.3389ZM18.8594 11.0186V12.2886H14.3188V11.0186H18.8594ZM14.543 11.0186V20H13.0073V11.0186H14.543ZM20.2207 11.0186V20H18.6768V11.0186H20.2207ZM28.6875 11.0186V12.2886H24.3462V11.0186H28.6875ZM30.0405 11.0186V20H28.5049V11.0186H30.0405ZM23.9727 11.0186H25.5166L25.2842 15.3516C25.2454 16.0212 25.1818 16.6133 25.0933 17.1279C25.0103 17.637 24.894 18.0742 24.7446 18.4395C24.6007 18.8047 24.4181 19.1035 24.1968 19.3359C23.981 19.5628 23.7209 19.7316 23.4165 19.8423C23.1121 19.9474 22.7607 20 22.3623 20H21.8809V18.647L22.2129 18.6221C22.4508 18.6055 22.6528 18.5501 22.8188 18.4561C22.9904 18.362 23.1343 18.2236 23.2505 18.041C23.3667 17.8529 23.4608 17.6121 23.5327 17.3188C23.6102 17.0256 23.6683 16.6769 23.707 16.2729C23.7513 15.869 23.7845 15.3986 23.8066 14.8618L23.9727 11.0186ZM37.8101 18.4644V13.8408C37.8101 13.4867 37.7381 13.1795 37.5942 12.9194C37.4559 12.6538 37.2456 12.4491 36.9634 12.3052C36.6812 12.1613 36.3325 12.0894 35.9175 12.0894C35.5301 12.0894 35.1898 12.1558 34.8965 12.2886C34.6087 12.4214 34.3818 12.5957 34.2158 12.8115C34.0553 13.0273 33.9751 13.2598 33.9751 13.5088H32.4395C32.4395 13.1878 32.5225 12.8696 32.6885 12.5542C32.8545 12.2388 33.0924 11.9538 33.4023 11.6992C33.7178 11.4391 34.0941 11.2344 34.5312 11.085C34.974 10.93 35.4665 10.8525 36.0088 10.8525C36.6618 10.8525 37.2373 10.9632 37.7354 11.1846C38.2389 11.4059 38.6318 11.7407 38.9141 12.189C39.2018 12.6317 39.3457 13.1878 39.3457 13.8574V18.041C39.3457 18.3398 39.3706 18.658 39.4204 18.9956C39.4757 19.3332 39.556 19.6237 39.6611 19.8672V20H38.0591C37.9816 19.8229 37.9207 19.5877 37.8765 19.2944C37.8322 18.9956 37.8101 18.7189 37.8101 18.4644ZM38.0757 14.5547L38.0923 15.6338H36.54C36.1029 15.6338 35.7127 15.6698 35.3696 15.7417C35.0265 15.8081 34.7388 15.9105 34.5063 16.0488C34.2739 16.1872 34.0968 16.3615 33.9751 16.5718C33.8534 16.7765 33.7925 17.0173 33.7925 17.2939C33.7925 17.5762 33.8561 17.8335 33.9834 18.0659C34.1107 18.2983 34.3016 18.4837 34.5562 18.6221C34.8162 18.7549 35.1344 18.8213 35.5107 18.8213C35.9811 18.8213 36.3962 18.7217 36.7559 18.5225C37.1156 18.3232 37.4006 18.0798 37.6108 17.792C37.8267 17.5042 37.9429 17.2248 37.9595 16.9536L38.6152 17.6924C38.5765 17.9248 38.4714 18.1821 38.2998 18.4644C38.1283 18.7466 37.8986 19.0177 37.6108 19.2778C37.3286 19.5324 36.991 19.7454 36.5981 19.917C36.2108 20.083 35.7736 20.166 35.2866 20.166C34.6779 20.166 34.1439 20.047 33.6846 19.8091C33.2308 19.5711 32.8766 19.2529 32.6221 18.8545C32.373 18.4505 32.2485 17.9995 32.2485 17.5015C32.2485 17.02 32.3426 16.5967 32.5308 16.2314C32.7189 15.8607 32.9901 15.5535 33.3442 15.3101C33.6984 15.061 34.1245 14.8729 34.6226 14.7456C35.1206 14.6183 35.6768 14.5547 36.291 14.5547H38.0757ZM45.2891 11.0186V20H43.7451V11.0186H45.2891ZM48.3022 11.0186V12.2637H40.79V11.0186H48.3022ZM51.4731 17.5679L55.6152 11.0186H57.1592V20H55.6152V13.4507L51.4731 20H49.9458V11.0186H51.4731V17.5679ZM63.2852 11.0186V20H61.7412V11.0186H63.2852ZM66.2983 11.0186V12.2637H58.7861V11.0186H66.2983ZM69.0708 14.1064H71.7686C72.4935 14.1064 73.105 14.2337 73.603 14.4883C74.1011 14.7373 74.4774 15.0832 74.7319 15.5259C74.992 15.9631 75.1221 16.4611 75.1221 17.02C75.1221 17.4351 75.0501 17.8252 74.9062 18.1904C74.7624 18.5501 74.5465 18.8656 74.2588 19.1367C73.9766 19.4079 73.6252 19.6209 73.2046 19.7759C72.7896 19.9253 72.3109 20 71.7686 20H67.9502V11.0186H69.4858V18.7383H71.7686C72.2113 18.7383 72.5654 18.658 72.8311 18.4976C73.0967 18.3371 73.2876 18.1296 73.4038 17.875C73.52 17.6204 73.5781 17.3548 73.5781 17.0781C73.5781 16.807 73.52 16.5413 73.4038 16.2812C73.2876 16.0212 73.0967 15.8053 72.8311 15.6338C72.5654 15.4567 72.2113 15.3682 71.7686 15.3682H69.0708V14.1064ZM84.8506 18.9043C85.2158 18.9043 85.5534 18.8296 85.8633 18.6802C86.1732 18.5308 86.4277 18.326 86.627 18.0659C86.8262 17.8003 86.9396 17.4987 86.9673 17.1611H88.4282C88.4006 17.6924 88.2207 18.1877 87.8887 18.647C87.5622
13519.1007 87.1333 19.4688 86.6021 19.751C86.0708 20.0277 85.487 20.166 84.8506 20.166C84.1755 20.166 83.5861 20.047 83.0825 19.8091C82.5845 19.5711 82.1694 19.2446 81.8374 18.8296C81.5109 18.4146 81.2646 17.9386 81.0986 17.4019C80.9382 16.8595 80.8579 16.2868 80.8579 15.6836V15.335C80.8579 14.7318 80.9382 14.1618 81.0986 13.625C81.2646 13.0827 81.5109 12.604 81.8374 12.189C82.1694 11.7739 82.5845 11.4474 83.0825 11.2095C83.5861 10.9715 84.1755 10.8525 84.8506 10.8525C85.5534 10.8525 86.1676 10.9964 86.6934 11.2842C87.2191 11.5664 87.6313 11.9538 87.9302 12.4463C88.2345 12.9333 88.4006 13.4867 88.4282 14.1064H86.9673C86.9396 13.7357 86.8345 13.4009 86.6519 13.1021C86.4748 12.8032 86.2313 12.5653 85.9214 12.3882C85.617 12.2056 85.2601 12.1143 84.8506 12.1143C84.3802 12.1143 83.9845 12.2083 83.6636 12.3965C83.3481 12.5791 83.0964 12.8281 82.9082 13.1436C82.7256 13.4535 82.5928 13.7993 82.5098 14.1812C82.4323 14.5575 82.3936 14.9421 82.3936 15.335V15.6836C82.3936 16.0765 82.4323 16.4639 82.5098 16.8457C82.5872 17.2275 82.7173 17.5734 82.8999 17.8833C83.0881 18.1932 83.3398 18.4422 83.6553 18.6304C83.9762 18.813 84.3747 18.9043 84.8506 18.9043Z" fill="white"/> 136 <path fill-rule="evenodd" clip-rule="evenodd" d="M111.019 0C103.265 0 97 6.2473 97 13.9041C97 18.5514 99.3302 22.7036 102.844 25.2178C102.921 25.1035 102.997 24.8368 103.074 24.5702V24.4559C103.417 22.9703 103.494 21.5608 103.341 19.8847C103.226 18.8562 103.074 18.2848 102.921 17.7515C102.768 17.1801 102.653 16.6849 102.653 15.923C102.653 15.2373 102.806 14.7421 102.959 14.2469L102.959 14.2469C103.15 13.6755 103.341 12.9898 103.379 11.847C103.456 9.63761 103.685 9.06621 104.334 8.41862C104.984 7.77103 105.213 7.50438 105.213 7.04726C105.213 6.94783 105.184 6.81776 105.15 6.66372C105.026 6.10956 104.834 5.24515 105.671 4.38073C106.435 3.69505 107.123 3.4284 107.619 3.4284C107.887 3.4284 108.116 3.50458 108.231 3.65696C108.574 4.03789 108.498 4.72357 107.772 5.6759C107.085 6.62823 107.085 7.04726 107.123 7.27582C107.161 7.50438 107.39 7.80913 107.81 8.11387C107.867 8.16333 107.926 8.21279 107.987 8.26322C108.252 8.48468 108.54 8.7249 108.727 9.06621C109.09 9.6992 109.309 10.3083 109.574 11.0446C109.644 11.2388 109.717 11.4419 109.797 11.6566L109.911 11.9613C110.217 12.8755 111.095 13.1803 112.585 13.1803C114.075 13.1803 115.679 12.1899 115.679 11.428C115.679 11.0316 115.597 10.8208 115.517 10.6186C115.444 10.4322 115.374 10.253 115.374 9.94235C115.374 9.29477 116.329 7.42819 117.78 7.42819C118.506 7.42819 118.926 7.9615 118.544 8.72337C118.431 8.96269 118.275 9.23949 118.118 9.51935L118.118 9.51938C117.8 10.0859 117.475 10.6649 117.475 10.9709C117.475 11.8089 118.735 11.1613 119.538 10.5138C120.34 9.86617 120.531 9.6757 121.104 8.68527C121.447 8.07578 121.944 7.9615 122.25 8.11387C122.593 8.30434 122.823 8.83765 122.517 9.56142C122.25 10.1328 121.562 10.8947 120.836 11.6946C120.775 11.7631 120.713 11.832 120.651 11.9012C119.744 12.9111 118.774 13.991 118.774 14.704C118.774 18.5895 120.989 22.0179 121.218 22.3608C121.447 22.7417 121.6 22.856 121.677 22.8941C123.739 20.4942 125 17.3705 125 13.9421V13.8279C125 6.20921 118.735 0 111.019 0ZM115.335 26.7811C115.22 27.0477 114.876 27.3144 114.418 27.543C113.31 27.8096 112.164 27.962 110.98 28.0001H110.598C110.101 27.8477 109.758 27.6191 109.567 27.3144C108.994 26.324 108.955 24.1527 108.955 21.6004V20.8766L108.955 20.5929C108.954 18.1618 108.953 16.0852 109.872 15.315C110.216 15.0103 110.751 14.896 111.438 15.0103C114.112 15.3912 114.342 17.0292 114.532 18.4768L114.571 18.6291L114.723 19.4291C114.743 19.5602 114.764 19.7028 114.786 19.8552L114.786 19.8552L114.786 19.8553C115.033 21.5175 115.449 24.3315 115.449 25.8669C115.449 26.2859 115.411 26.5906 115.335 26.7811ZM105.939 20.304C106.474 20.304 106.817 22.9705 106.894 25.0275C106.97 26.4751 106.817 27.0465 106.55 27.275C106.416 27.2179 106.283 27.1703 106.149 27.1227L106.149 27.1227L106.149 27.1227C106.015 27.075 105.881 27.0274 105.748 26.9703C105.595 26.6274 105.442 26.1322 105.366 25.4846C105.137 23.4276 105.366 20.342 105.939 20.304ZM117.4 20.6092C118.317 20.1902 119.959 23.8852 119.806 24.5328C119.794 24.5836 119.777 24.6344 119.76 24.6852C119.726 24.7868 119.692 24.8883 119.692 24.9899C119.195 25.3709 118.66 25.7137 118.126 26.0185C117.935 26.0565 117.782 26.0185 117.705 25.9042C116.98 24.7233 116.712 20.952 117.4 20.6092Z" fill="white"/> 137 <path fill-rule="evenodd" clip-rule="evenodd" d="M209 18.8929H204.457L208.885 13.0647V11.3886H201.801L199.953 13.7503H204.958L200.53 19.5405V21.2547H209V18.8929ZM178.393 21.2547H181.511V11.4266H178.393V21.2547ZM171.848 13.598C172.888 13.598 173.388 14.4741 173.388 16.2264H173.427V16.6073C173.388 18.2834 172.888 19.1215 171.887 19.1215C171.155 19.1215 170.655 18.8167 170.385 18.2834V14.3979C170.616 13.8646 171.117 13.598 171.848 13.598ZM175.429 20.0738C176.121 19.1596 176.468 17.9406 176.468 16.4169H176.429V16.2645C176.429 14.7027 176.083 13.4837 175.39 12.5694C174.736 11.6933 173.773 11.2362 172.541 11.2362C171.579 11.2362 170.77 11.6171 170.193 12.3409L170.116 11.4266H167.228V25.445H170.347V20.4548C170.963 21.1023 171.694 21.4452 172.618 21.4452C173.773 21.4452 174.736 20.9881 175.429 20.0738ZM161.954 17.8644C162.223 18.0549 162.377 18.2453 162.377 18.512C162.377 18.7786 162.3 19.0072 162.069
13719.0834C161.838 19.2739 161.53 19.35 161.107 19.35C160.645 19.35 160.298 19.2358 159.99 19.0453C159.682 18.8548 159.528 18.512 159.528 18.0549H156.641C156.641 18.6263 156.833 19.1596 157.218 19.6929C157.603 20.2262 158.142 20.6452 158.797 20.95C159.451 21.2547 160.221 21.4071 161.068 21.4071C162.377 21.4071 163.417 21.1404 164.225 20.569C165.034 19.9976 165.419 19.2739 165.419 18.3596C165.419 17.0264 164.687 16.1121 163.186 15.6169C162.724 15.4645 162.185 15.3503 161.607 15.236C160.991 15.1217 160.568 14.9693 160.298 14.817C160.029 14.6646 159.875 14.436 159.875 14.1694C159.875 13.9027 159.99 13.6742 160.221 13.4837C160.414 13.2932 160.722 13.217 161.03 13.217C161.877 13.217 162.3 13.598 162.3 14.3979H165.342C165.342 13.4456 164.957 12.6456 164.148 12.0742C163.378 11.5028 162.3 11.1981 160.991 11.1981C159.759 11.1981 158.797 11.5028 158.027 12.0742C157.295 12.6837 156.91 13.4075 156.91 14.3217C156.91 14.855 157.026 15.3122 157.295 15.6931C157.565 16.074 157.95 16.4169 158.45 16.6835C158.951 16.9883 159.605 17.2168 160.375 17.3692C161.145 17.5597 161.684 17.712 161.954 17.8644ZM151.405 19.0453C151.135 19.1977 150.827 19.2739 150.442 19.2739C150.134 19.2739 149.903 19.1596 149.711 19.0453C149.518 18.8548 149.441 18.6263 149.441 18.3596C149.441 17.4073 149.98 16.9121 151.058 16.9121H151.944V18.4739C151.828 18.7025 151.674 18.8929 151.405 19.0453ZM152.157 20.5777L152.157 20.5778L152.157 20.5778C152.242 20.8661 152.311 21.0987 152.406 21.2547V21.2928H155.486V21.1404C155.216 20.6452 155.062 19.9595 155.062 19.0453V14.5884C155.062 13.5218 154.677 12.6837 153.946 12.0742C153.214 11.4647 152.252 11.16 150.943 11.16C149.634 11.16 148.594 11.4266 147.786 12.0361C146.977 12.6456 146.554 13.4075 146.554 14.3598H149.672C149.672 13.6361 150.057 13.2932 150.789 13.2932C151.597 13.2932 151.982 13.7503 151.982 14.6646V15.1979H151.02C149.48 15.1979 148.325 15.5026 147.516 16.0359C146.708 16.6073 146.323 17.4073 146.323 18.4739C146.323 19.35 146.669 20.0357 147.324 20.6071C147.978 21.1785 148.787 21.4452 149.711 21.4452C150.712 21.4452 151.52 21.1023 152.098 20.3786C152.119 20.4475 152.138 20.514 152.157 20.5777ZM137.699 18.1692L138.816 16.6454L141.895 21.2547H145.745L140.856 13.9789L146.092 7.23639H142.088L137.699 12.9885V7.23639H134.465V21.2547H137.699V18.1692ZM187.133 19.8097C187.133 20.6859 186.401 21.4096 185.516 21.4096C184.592 21.4096 183.86 20.6859 183.86 19.8097C183.86 18.8955 184.63 18.2098 185.516 18.2098C186.401 18.2098 187.133 18.9336 187.133 19.8097ZM179.896 10.4755C180.782 10.4755 181.513 9.75177 181.513 8.87562C181.513 7.99947 180.782 7.2757 179.896 7.2757C179.011 7.2757 178.279 7.99947 178.279 8.87562C178.279 9.75177 179.011 10.4755 179.896 10.4755ZM192.985 19.2358L193.986 17.9787L196.18 21.2166L199.568 21.2547L195.834 15.655L199.106 11.3886H195.68L192.985 14.8931V7.23639H189.866V21.2547H192.985V19.2358Z" fill="white"/> 138 </svg> 139 </div> 140 141 <div v-else :key="2"> 142 {{ text }} 143 </div> 144 145 </transition> 146 </div> 147 148 </div> 149 `};app.cartSummaryComponent={inject:['store'],components:{pointIcon:app.pointIconComponent,},props:['cart','loc','company','address','ui','user'],computed:{...Vuex.mapState(['isKiosk']),rub(){return this.company.currency},gainPoints(){if(this.isKiosk){return} 150if(this.ui.cartGainedPointsVisibility&&this.ui.cartGainedPointsVisibility==='hidden'){return 0} 151return this.cart.amount.gainPoints},insufficientPoints(){return this.cart.amount.pointsExchange>(this.cart.exchange.userPoints*10000)},pointsExchangeWarning(){if(!this.insufficientPoints){return''} 152if(!this.user){return this.loc['cart/summary/authorizationRequired']} 153return this.loc['cart/summary/insufficientPoints']},pointDishMinSumWarning(){if(!this.cart.amount.pointDishMinSumViolation){return''} 154return this.cart.amount.pointDishMinSumError||''},summary(){let deliverySubstring=this.cart.amount.minPriceError||'';if(!deliverySubstring&&this.cart.amount.sumToFree){deliverySubstring=this.cart.amount.sumToFreeText||''} 155return[this.cart.amount.num&&{slug:'dishes',name:this.loc['cart/summary/dishes'],subname:this.cart.amount.num+'Â '+this.loc['unit/count'],substring:'',price:this.cart.amount.sumFormatted,e2e:this.cart.amount.sum/10000},this.address.type==='delivery'&&{slug:'delivery',name:this.loc['cart/fee'],subname:'',substring:deliverySubstring.replaceAll('<br>',' '),price:this.cart.amount.feeFormatted,e2e:this.cart.amount.fee/10000},this.cart.amount.feePriority&&{slug:'priority',name:this.loc['cart/priority'],subname:'',substring:'',price:this.cart.amount.feePriorityFormatted,e2e:this.cart.amount.feePriority/10000},this.cart.amount.tips&&{slug:'tips',name:this.loc['cart/tips'],subname:'',substring:'',price:this.cart.amount.tipsFormatted,},this.cart.amount.pickupDiscount&&{slug:'pickup',name:this.loc['cart/pickup'],subname:'',substring:'',price:'â'+this.cart.amount.pickupDiscountFormatted,e2e:this.cart.amount.pickupDiscount/10000},this.cart.amount.personalDiscount&&{slug:'personal',name:this.loc['history/personalDiscount'],subname:'',substring:'',price:'â'+this.cart.amount.personalDiscountFormatted,e2e:this.cart.amount.personalDiscount/10000},(this.cart.amount.promoDiscount||(this.cart.promo.error&&this.store.activeScreen==='form'))&&{slug:'discount',name:this.loc['cart/discount'],subname:'',substring:this.cart.promo.error||'',price:(this.cart.promo.error?'':'â')+this.cart.amount.promoDiscountFormatted,e2e:this.cart.amount.promoDiscount/10000},(this.cart.amount.pointsExchange||this.pointDishMinSumWarning)&&{slug:'points',name:this.loc['profile/log/exchange'],subname:'',substring:this.pointsExchangeWarning,substring2:this.pointDishMinSumWarning,price:this.cart.amount.pointsExchange?'â'+this.priceFormat(this.cart.amount.pointsExchange):'',e2e:this.cart.amount.pointsExchange/10000},this.cart.amount.totalCross&&{slug:'cross',name:'',subname:'',substring:'',price:'',e2e:this.cart.amount.totalCross/10000},this.cart.amount.serviceCharge&&{slug:'service',name:this.loc['cart/serviceCharge'],subname:'',substring:'',price:this.cart.amount.serviceChargeFormatted,e2e:this.cart.amount.serviceCharge/10000},this.cart.amount.tax>0&&{slug:'tax',name:this.loc['cart/tax'],subname:'',substring:'',price:this.cart.amount.taxFormatted,e2e:this.cart.amount.tax/10000},this.gainPoints&&{slug:'gainPoints',name:this.loc['cart/gainPoints'],subname:'',substring:'',price:'+'+this.cart.amount.gainPointsFormatted,e2e:this.cart.amount.gainPoints/10000},{slug:'total',name:this.loc['cart/total2'],subname:'',substring:'',price:this.cart.amount.totalFormatted,e2e:this.cart.amount.total/10000}
155,].filter(Boolean)},legal(){if(this.isKiosk||this.store.activeScreen!=='form'){return''} 156return this.loc['cart/legal']},isHighDelivery(){if(this.address.type==='delivery'&&this.address&&this.address.delivery&&this.address.delivery.currentZone){return this.address.delivery.currentZone.highDemand.isActive} 157return!1}},methods:{openLegal(e){if(e.target.nodeName==='B'){window.open('/offer','_blank')}else if(e.target.nodeName==='I'){window.open('/policy','_blank')}},priceFormat(price,currency){return app.price.format(price,currency,this.company.priceSeparator)},},template:` 158 <div class="cSummary"> 159 160 <div v-for="item of summary" 161 :key="item.slug" 162 class="cSummary__item" 163 :class="'cSummary__item--' + item.slug" 164 :data-amount="item.e2e" 165 :data-slug="item.slug"> 166 <div :key="item.price" class="cSummary__name"> 167 {{ item.name }} 168 <span v-if="item.subname" :key="item.price" class="cSummary__subname">{{ item.subname }}</span> 169 <div v-if="item.substring" :key="item.price" class="cSummary__substring">{{item.substring}}</div> 170 <div v-if="item.substring2" :key="item.substring2" class="cSummary__substring">{{item.substring2}}</div> 171 </div> 172 <transition name="cSummary__fade" mode="out-in"> 173 <div :key="item.price" 174 class="cSummary__price" 175 :class="[ 176 {'cSummary__price--up': item.substring}, 177 {'cSummary__price--gainPoints': ['gainPoints', 'points'].includes(item.slug)}, 178 {'cSummary__price--highDelivery': ['delivery'].includes(item.slug) && isHighDelivery} 179 ]"> 180 181 <svg v-if="['delivery'].includes(item.slug) && isHighDelivery" class="cSummary__highDeliveryIco" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"> 182 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.21425 0C3.0597 0 2.90932 0.0542244 2.78568 0.154534C2.66205 0.254844 2.57182 0.395827 2.52854 0.556323L0.0285712 9.82837C-0.00247749 9.94353 -0.00831489 10.0649 0.0115214 10.1829C0.0313577 10.301 0.0763227 10.4124 0.142856 10.5083C0.209388 10.6043 0.295662 10.6822 0.394843 10.7358C0.494025 10.7895 0.60339 10.8174 0.714278 10.8174H3.47639L2.86211 16.1303C2.84188 16.3032 2.87626 16.4784 2.95969 16.6275C3.04311 16.7765 3.17068 16.8907 3.32166 16.9515C3.47265 17.0123 3.63819 17.016 3.79141 16.9622C3.94463 16.9084 4.07652 16.8001 4.16567 16.6549L9.8799 7.38287C9.95166 7.26651 9.99288 7.13125 9.99916 6.99152C10.0054 6.8518 9.97653 6.71286 9.91552 6.58952C9.85451 6.46618 9.7637 6.36307 9.65276 6.29118C9.54183 6.2193 9.41493 6.18135 9.28561 6.18137H6.74493L8.52562 1.04388C8.56612 0.927004 8.57985 0.801255 8.56562 0.677392C8.55139 0.553528 8.50963 0.435237 8.44392 0.332639C8.37821 0.230041 8.2905 0.14619 8.1883 0.0882602C8.0861 0.0303306 7.97244 4.686e-05 7.85706 0H3.21425Z" fill="currentColor"/> 183 </svg> 184 185 {{ item.price }} 186 187 <point-icon v-if="['gainPoints', 'points'].includes(item.slug)" 188 class="cSummary__pointsIco" 189 variant="cart"></point-icon> 190 191 </div> 192 </transition> 193 </div> 194 195 <p v-if="legal" class="cSummary__legal" v-html="legal" @click="openLegal"></p> 196 197 </div> 198 `};app.cartPromoGiftComponent={props:['gift','active','loc','mobile'],computed:{locButton(){if(this.active){return this.loc['btn/selected']} 199return this.loc['btn/choose']},video(){if(!this.gift.media||!this.gift.media.length){return null} 200return this.gift.media[0].type==='video'&&this.gift.media[0]},},methods:{chooseGift(){this.$emit('choose',this.gift)},videoPlay(flag){if(!this.video||this.mobile){return} 201if(flag){this.$refs.video.play();return} 202this.$refs.video.pause()},},template:` 203 204 <div class="cGift" 205 @mouseenter="videoPlay(true)" 206 @mouseleave="videoPlay(false)"> 207 208 <div v-if="video || gift.photo" class="cGift__mediaWrap"> 209 <template v-if="video"> 210 <video ref="video" 211 class="cGift__media cGift__media--video" 212 :src="video.preview" 213 :autoplay="mobile" 214 muted loop playsinline webkit-playsinline></video> 215 </template> 216 <img v-else="dish.photo" :src="gift.photo" class="cGift__media"> 217 </div> 218 219 <div class="cGift__name">
220 {{gift.name}} 221 <span v-if="gift.size" class="cGift__size">{{gift.size}}</span> 222 </div> 223 224 <div v-if="gift.ingredients" class="cGift__ingredients"> 225 {{gift.ingredients}} 226 </div> 227 228 <div class="cGift__buttonWrap"> 229 <div class="cGift__button" :class="{'cGift__button--active': active}" @click="chooseGift"> 230 231 <transition name="cGift__buttonTransition" mode="out-in"> 232 <span v-if="active" > 233 <svg width="13" height="11" viewBox="0 0 13 11" fill="none"> 234 <path d="M11.9181 0.614246C12.1903 0.435614 12.5594 0.467184 12.798 0.707019C13.0704 0.981132 13.0691 1.42372 12.795 1.69628L4.44446 10.0019L3.94446 10.5L3.45032 9.99608L0.198369 6.67382L0.109502 6.56249C-0.0667925 6.28893 -0.0325187 5.92015 0.209111 5.68358C0.450916 5.44714 0.820273 5.42111 1.08997 5.6035L1.19837 5.69432L3.95716 8.51171L11.8077 0.70409L11.9181 0.614246Z" fill="currentColor"/> 235 </svg> 236 237 {{locButton}} 238 </span> 239 <span v-else>{{locButton}}</span> 240 </transition> 241 242 </div> 243 </div> 244 245 </div> 246 247 `};app.cartScreenGiftsComponent={components:{cartHeader:app.cartHeaderComponent,cartFooter:app.cartFooterComponent,promoGift:app.cartPromoGiftComponent,},props:['cart','loc','mobile','cartLoading','company'],data(){return{activeGiftId:null}},computed:{gifts(){return this.cart.promo&&this.cart.promo.enabledGifts},isEnabled(){return this.gifts&&this.gifts.length},locTitle(){return this.loc['cart/gift/title']},submitText(){return this.loc['btn/toCheckout']},isDisabled(){return!this.activeGiftId},},methods:{onChoose(gift){this.activeGiftId=gift.posId},onClose(){this.$emit('navigate',{type:'screen',name:'dishes'})},onSubmit(){if(this.isDisabled){return} 248this.cart.promo.forceGift=this.activeGiftId.replace('gift','');if(this.cart.promo.grade){this.cart.promo.grade.forceGift=null} 249this.$emit('navigate',{type:'recalc',noTimeout:!0,cb:()=>{this.onClose()}})}},template:` 250 <div class="cGifts"> 251 252 <cartHeader @back="onClose" :title="locTitle"/> 253 254 <div class="cGifts__content"> 255 <div class="cGifts__items"> 256 <promoGift v-for="gift in gifts" 257 :gift="gift" 258 :active="gift.posId === activeGiftId" 259 :loc="loc" 260 :mobile="mobile" 261 @choose="onChoose"/> 262 </div> 263 </div> 264 265 <cartFooter :text="submitText" 266 :cart-loading="cartLoading" 267 :cart="cart" 268 :company="company" 269 :disabled="isDisabled" 270 @submit="onSubmit"/> 271 272 273 </div> 274 `};app.cartPromoGradeProgressStepComponent={props:['step'],computed:{isFinished(){return this.step.percent===100}},template:` 275 <div class="pstep" 276 :class="{'pstep--finished': isFinished}"> 277 278 <div class="pstep__ico"> 279 <svg width="16" height="16" viewBox="0 0 16 16" fill="none"> 280 <path d="M7.3 9.40016V15H4.5C3.94305 15 3.4089 14.7788 3.01508 14.3849C2.62125 13.9911 2.4 13.457 2.4 12.9001V10.1001C2.4 9.9145 2.47375 9.73645 2.60503 9.60518C2.7363 9.47391 2.91435 9.40016 3.1 9.40016H7.3ZM12.9 9.40016C13.0857 9.40016 13.2637 9.47391 13.395 9.60518C13.5263 9.73645 13.6 9.9145 13.6 10.1001V12.9001C13.6 13.457 13.3788 13.9911 12.9849 14.3849C12.5911 14.7788 12.057 15 11.5 15H8.7V9.40016H12.9ZM11.15 1.00041C11.5634 1.00033 11.97 1.10482 12.3321 1.30418C12.6942 1.50353 13 1.79126 13.221 2.14058C13.442 2.4899 13.571 2.88945 13.596 3.30204C13.621 3.71463 13.5413 4.12685 13.3641 4.50031H13.6C13.9713 4.50031 14.3274 4.6478 14.5899 4.91035C14.8525 5.17289 15 5.52897 15 5.90027V6.60025C15 6.97154 14.8525 7.32762 14.5899 7.59017C14.3274 7.85271 13.9713 8.0002 13.6 8.0002H8.7V4.50031H7.3V8.0002H2.4C2.0287 8.0002 1.6726 7.85271 1.41005 7.59017C1.1475 7.32762 1 6.97154 1 6.60025V5.90027C1 5.52897 1.1475 5.17289 1.41005 4.91035C1.6726 4.6478 2.0287 4.50031 2.4 4.50031H2.6359C2.48011 4.17223 2.39951 3.81352 2.4 3.45034C2.4 2.09728 3.4969 1.00041 4.8381 1.00041C6.0666 0.979411 7.1565 1.76479 7.9
280048 3.05415L8 3.22425C8.7231 1.88448 9.792 1.04451 11.0037 1.00181L11.15 1.00041ZM4.85 2.40037C4.57152 2.40037 4.30445 2.51099 4.10754 2.7079C3.91062 2.90481 3.8 3.17187 3.8 3.45034C3.8 3.72881 3.91062 3.99587 4.10754 4.19278C4.30445 4.38969 4.57152 4.50031 4.85 4.50031H7.0501C6.5314 3.16685 5.6858 2.38637 4.85 2.40037ZM11.1381 2.40037C10.3121 2.38637 9.4686 3.16755 8.9499 4.50031H11.15C11.4285 4.49873 11.6949 4.3866 11.8907 4.18857C12.0865 3.99055 12.1956 3.72286 12.1941 3.44439C12.1925 3.16592 12.0803 2.89948 11.8823 2.70369C11.6843 2.5079 11.4166 2.39879 11.1381 2.40037Z" fill="currentColor"/> 281 </svg> 282 </div> 283 284 <div class="pstep__label">{{ step.availAtSumFormatted }}</div> 285 286 </div> 287 `};app.cartPromoGradeProgressLineComponent={props:['percent'],computed:{fillStyle(){return{width:`${this.percent || 0}%`}}},template:` 288 <div class="pline"> 289 <div class="pline__progress" :style="fillStyle"></div> 290 </div> 291 `};app.cartPromoGradeProgressComponent={props:['steps'],components:{progressStep:app.cartPromoGradeProgressStepComponent,progressLine:app.cartPromoGradeProgressLineComponent},computed:{totalPercent(){const segments=Math.max(1,this.steps.length-1);return this.steps.slice(1).reduce((sum,step)=>sum+(step.percent||0),0)/segments}},template:` 292 <div class="gprog"> 293 294 <div class="gprog__steps" 295 :class="'gprog__steps--'+steps.length"> 296 297 <progressLine v-if="steps.length > 1" :percent="totalPercent"/> 298 299 <div class="gprog__step" v-for="(step, i) in steps" :key="i"> 300 <progressStep :step="step"/> 301 </div> 302 303 </div> 304 305 </div> 306 `};app.cartPromoGradeGiftComponent={props:['gift'],computed:{photo(){return this.gift.photo},name(){return this.gift.name},size(){return this.gift.sizeFormatted},isFinished(){return this.gift.percent===100},isSelected(){return this.gift.selected}},methods:{picked(){if(this.isFinished){this.$emit('picked',this.gift)}}},template:` 307 <div class="pgift" 308 :class="{'pgift--finished': isFinished, 'pgift--notFinished': !isFinished, 'pgift--selected': isSelected}" 309 @click="picked"> 310 311 <img v-if="photo" class="pgift__photo" :src="photo"> 312 313 <div class="pgift__name"> 314 {{name}} 315 316 <span v-if="size" class="pgift__size">{{size}}</span> 317 </div> 318 319 <div class="pgift__checkbox"></div> 320 </div> 321 `};app.cartPromoGradeGiftListComponent={components:{promoGift:app.cartPromoGradeGiftComponent},props:['steps','loc'],data(){return{isOpened:!1}},computed:{},mounted:function(){document.body.addEventListener('click',this.clickOutside)},destroyed:function(){document.body.removeEventListener('click',this.clickOutside)},methods:{clickOutside(e){if(!this.$el.contains(e.target)&&this.isOpened){this.isOpened=!1}},picked(gift){this.$emit('picked',gift);this.isOpened=!1},toggle(){this.isOpened=!this.isOpened}},template:` 322 <div class="giftlist" :class="{'giftlist--opened': isOpened}"> 323 324 <div class="giftlist__wrap"> 325 326 <div class="giftlist__choose" @click="toggle()"> 327 {{ loc['cart/promoGrade/giftList'] }} 328 329 <svg class="giftlist__chooseTick" width="12" height="8" viewBox="0 0 12 8" fill="none"> 330 <path d="M10.9497 1.17149L5.29282 6.82835M1.05042 1.17149L6.70727 6.82835" stroke="currentColor" stroke-width="1.3"/> 331 </svg> 332 333 </div> 334 335 <div v-show="isOpened" class="giftlist__items"> 336 <promoGift v-for="gift in steps" :gift="gift" @picked="picked"/> 337 </div> 338 339 </div> 340 341 342 </div> 343 `};app.cartPromoGradePreviewCircleComponent={props:['steps'],computed:{spaceSize(){return 5},fragmentSize(){return(100/this.steps.length)-this.spaceSize},bgOffset(){return(this.spaceSize/2)*-1},bgDasharray(){const list=[];for(let i=0;i<this.steps.length;i++){list.push(this.fragmentSize);list.push(this.spaceSize)} 344return list},fragments(){const list=[];let i=0;for(let step of this.steps){let size=this.fragmentSize*step.percent/100;list.push({isHidden:step.percent===0,dasharray:[size,100-size],offset:(this.fragmentSize*i*-1)-(this.spaceSize/2)-(this.spaceSize*i)}) 345i++} 346return list}},template:` 347 <div class="pgcircle"> 348
349 <svg class="pgcircle__progress" viewBox="0 0 36 36"> 350 351 <path d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" 352 class="pgcircle__progressBg" 353 fill="none" 354 stroke="rgba(255,255,255,.2)" 355 stroke-linecap="round" 356 stroke-width="2" 357 :stroke-dashoffset="bgOffset" 358 :stroke-dasharray="bgDasharray"/> 359 360 <path v-for="fragment in fragments" 361 d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831" 362 fill="none" 363 stroke="currentColor" 364 stroke-linecap="round" 365 :stroke-width="fragment.isHidden ? 0 : 2" 366 style="transition: stroke-dasharray 200ms" 367 :stroke-dashoffset="fragment.offset" 368 :stroke-dasharray="fragment.dasharray"/> 369 370 </svg> 371 372 373 </div> 374 `};app.cartPromoGradePreviewComponent={props:['steps','trigger','white'],components:{previewCircle:app.cartPromoGradePreviewCircleComponent},watch:{trigger(){this.playGift()}}
374,methods:{playGift(){if(app.replayAnimation(this.$refs.gift,'giftIco--play',1000)){this.$refs.morph.beginElement()}}},template:` 375 <div class="pgview"> 376 377 <previewCircle :steps="steps"/> 378 379 <svg ref="gift" 380 class="pgview__gift giftIco" 381 :class="{'pgview__gift--white': white}" 382 viewBox="0 0 30 30" 383 aria-hidden="true"> 384 <g transform="translate(14.9999 15.0007)"> 385 <g class="giftIco__g3"> 386 <g transform="translate(-0.001 0)"> 387 <g class="giftIco__g5" transform="translate(0 4.6876)"> 388 <g class="giftIco__g8"> 389 <path d="M0.001 -4.688L0.001 4.688" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"/> 390 <path d="M6.888 -4.688L-6.873 -4.688" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"/> 391 <path d="M7.292 -4.688C7.292 -4.688 7.292 -4.688 7.292 -4.688C7.292 -4.688 7.292 -2.625 7.292 -0.693C7.292 1.006 7.292 2.603 7.292 2.603C7.292 3.156 7.072 3.686 6.681 4.077C6.291 4.467 5.761 4.687 5.208 4.687C5.208 4.687 -5.209 4.687 -5.209 4.687C-5.761 4.687 -6.291 4.467 -6.682 4.077C-7.072 3.686 -7.292 3.156 -7.292 2.603C-7.292 2.603 -7.292 1.006 -7.292 -0.693C-7.292 -2.625 -7.292 -4.688 -7.292 -4.688C-7.292 -4.688 -7.292 -4.688 -7.292 -4.688" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"> 392 <animate ref="morph" attributeName="d" begin="indefinite" dur="1s" fill="freeze" calcMode="spline" keyTimes="0;0.3333;0.6667;1" values="M7.292 -4.688C7.292 -4.688 7.292 -4.688 7.292 -4.688C7.292 -4.688 7.292 -2.625 7.292 -0.693C7.292 1.006 7.292 2.603 7.292 2.603C7.292 3.156 7.072 3.686 6.681 4.077C6.291 4.467 5.761 4.687 5.208 4.687C5.208 4.687 -5.209 4.687 -5.209 4.687C-5.761 4.687 -6.291 4.467 -6.682 4.077C-7.072 3.686 -7.292 3.156 -7.292 2.603C-7.292 2.603 -7.292 1.006 -7.292 -0.693C-7.292 -2.625 -7.292 -4.688 -7.292 -4.688C-7.292 -4.688 -7.292 -4.688 -7.292 -4.688;M7.292 -4.688C7.292 -4.688 7.292 -4.688 7.292 -4.688C7.292 -4.688 6.888 -2.625 6.888 -0.693C6.888 1.006 7.292 2.603 7.292 2.603C7.292 3.156 7.072 3.686 6.681 4.077C6.291 4.467 5.761 4.687 5.208 4.687C5.208 4.687 -5.209 4.687 -5.209 4.687C-5.761 4.687 -6.291 4.467 -6.682 4.077C-7.072 3.686 -7.292 3.156 -7.292 2.603C-7.292 2.603 -6.873 1.006 -6.873 -0.693C-6.873 -2.625 -7.292 -4.688 -7.292 -4.688C-7.292 -4.688 -7.292 -4.688 -7.292 -4.688;M7.292 -4.688C7.292 -4.688 7.292 -4.688 7.292 -4.688C7.292 -4.688 7.689 -2.625 7.689 -0.693C7.689 1.006 7.292 2.603 7.292 2.603C7.292 3.156 7.072 3.686 6.681 4.077C6.291 4.467 5.761 4.687 5.208 4.687C5.208 4.687 -5.209 4.687 -5.209 4.687C-5.761 4.687 -6.291 4.467 -6.682 4.077C-7.072 3.686 -7.292 3.156 -7.292 2.603C-7.292 2.603 -7.654 1.006 -7.654 -0.693C-7.654 -2.625 -7.292 -4.688 -7.292 -4.688C-7.292 -4.688 -7.292 -4.688 -7.292 -4.688;M7.292 -4.688C7.292 -4.688 7.292 -4.688 7.292 -4.688C7.292 -4.688 7.292 -2.625 7.292 -0.693C7.292 1.006 7.292 2.603 7.292 2.603C7.292 3.156 7.072 3.686 6.681 4.077C6.291 4.467 5.761 4.687 5.208 4.687C5.208 4.687 -5.209 4.687 -5.209 4.687C-5.761 4.687 -6.291 4.467 -6.682 4.077C-7.072 3.686 -7.292 3.156 -7.292 2.603C-7.292 2.603 -7.292 1.006 -7.292 -0.693C-7.292 -2.625 -7.292 -4.688 -7.292 -4.688C-7.292 -4.688 -7.292 -4.688 -7.292 -4.688" keySplines="0 0 1 1;0.42 0 0.58 1;0.42 0 0.58 1"/> 393 </path> 394 </g> 395 </g> 396 </g> 397 <g class="giftIco__g13" transform="translate(0 -4.6879)"> 398 <path d="M0 1.318L0 4.298" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"/> 399 <path d="M-9.375 1.563C-9.375 1.287 -9.265 1.022 -9.07 0.826C-8.874 0.631 -8.61 0.521 -8.333 0.521C-8.333 0.521 8.333 0.521 8.333 0.521C8.61 0.521 8.875 0.631 9.07 0.826C9.265 1.022 9.375 1.287 9.375 1.563C9.375 1.563 9.375 3.646 9.375 3.646C9.375 3.923 9.265 4.187 9.07 4.383C8.875 4.578 8.61 4.688 8.333 4.688C8.333 4.688 -8.333 4.688 -8.333 4.688C-8.61 4.688 -8.874 4.578 -9.07 4.383C-9.265 4.187 -9.375 3.923 -9.375 3.646C-9.375 3.646 -9.375 1.563 -9.375 1.563Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"/> 400 <g transform="translate(-0.0013 0)"> 401 <g class="giftIco__g19" transform="translate(0 -2.0919)"> 402 <g class="giftIco__g22"> 403 <path d="M-4.687 2.613C-5.378 2.613 -6.04 2.338 -6.529 1.85C-7.017 1.362 -7.292 0.699 -7.292 0.009C-7.292 -0.682 -7.017 -1.344 -6.529 -1.833C-6.04 -2.321 -5.378 -2.595 -4.687 -2.595C-3.683 -2.613 -2.698 -2.125 -1.862 -1.
403196C-1.026 -0.267 -0.377 1.06 0 2.613C0.377 1.06 1.026 -0.267 1.862 -1.196C2.698 -2.125 3.683 -2.613 4.688 -2.595C5.378 -2.595 6.041 -2.321 6.529 -1.833C7.017 -1.344 7.292 -0.682 7.292 0.009C7.292 0.699 7.017 1.362 6.529 1.85C6.041 2.338 5.378 2.613 4.688 2.613" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" fill="none"/> 404 </g> 405 </g> 406 </g> 407 </g> 408 </g> 409 </g> 410 </svg> 411 412 </div> 413 `};app.cartPromoGradeComponent={components:{promoProgress:app.cartPromoGradeProgressComponent,promoGiftList:app.cartPromoGradeGiftListComponent,promoPreview:app.cartPromoGradePreviewComponent},props:['mode','cart','loc','company','white'],data(){return{playTrigger:0}},watch:{cartTotal(now,was){if(was!==null&&now>was){this.playTrigger++}}},computed:{cartTotal(){return this.cart&&this.cart.amount?this.cart.amount.total:null},isVisible(){return!!(this.cart&&this.cart.promo&&this.cart.promo.grade)},isPreviewVisible(){return this.mode==='preview'},isProgressVisible(){return this.mode==='cart'||this.mode==='progress'},isGiftListVisible(){return this.mode==='cart'},steps(){return this.cart.promo.grade.steps}},methods:{picked(gift){this.$emit('picked',gift)}},template:` 414 <div v-if="isVisible" class="pgrade" :class="'pgrade--'+mode"> 415 <promoProgress v-if="isProgressVisible" :steps="steps"/> 416 <promoGiftList v-if="isGiftListVisible" :steps="steps" :loc="loc" @picked="picked"/> 417 <promoPreview v-if="isPreviewVisible" :steps="steps" :trigger="playTrigger" :white="white"/> 418 </div> 419 `};app.cartDishesAddressComponent={props:['company','address','loc'],computed:{...Vuex.mapState(['useExpressDelivery']),isVisible(){return!this.company.qrMenu},currentType(){let currentType=this.address.type;if(currentType==='delivery'&&this.useExpressDelivery&&this.address.isExpress){currentType='express'} 420return currentType},title(){if(!this.address){return'Choose address'} 421const type=this.address.type;const isDelayed=this.address.delayed;if(isDelayed){return this.loc['header/address']} 422if(app.isPointDeliveryType(type)){return this.address.pickup.name||this.loc['address2/title/pickup']} 423const address=this.address.delivery;if(!address.street){return address.name||this.loc['header/address']} 424let res=[];if(address.district){res.push(address.district)} 425res.push(address.street);res.push(address.house);return res.join(', ')},isHighDelivery(){if(this.address.type==='delivery'&&this.address&&this.address.delivery&&this.address.delivery.currentZone){return this.address.delivery.currentZone.highDemand.isActive} 426return!1}},methods:{changeAddresses(){PubSub.publish('showUserAddress',{type:this.currentType,refScreen:'cart'})},},template:` 427 <div v-if="isVisible" 428 class="cAddress" 429 :class="{'cAddress--highDelivery': isHighDelivery}" 430 v-press 431 @click="changeAddresses()"> 432 433 <svg v-if="isHighDelivery" class="cAddress__highDelivery" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"> 434 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.21425 0C3.0597 0 2.90932 0.0542244 2.78568 0.154534C2.66205 0.254844 2.57182 0.395827 2.52854 0.556323L0.0285712 9.82837C-0.00247749 9.94353 -0.00831489 10.0649 0.0115214 10.1829C0.0313577 10.301 0.0763227 10.4124 0.142856 10.5083C0.209388 10.6043 0.295662 10.6822 0.394843 10.7358C0.494025 10.7895 0.60339 10.8174 0.714278 10.8174H3.47639L2.86211 16.1303C2.84188 16.3032 2.87626 16.4784 2.95969 16.6275C3.04311 16.7765 3.17068 16.8907 3.32166 16.9515C3.47265 17.0123 3.63819 17.016 3.79141 16.9622C3.94463 16.9084 4.07652 16.8001 4.16567 16.6549L9.8799 7.38287C9.95166 7.26651 9.99288 7.13125 9.99916 6.99152C10.0054 6.8518 9.97653 6.71286 9.91552 6.58952C9.85451 6.46618 9.7637 6.36307 9.65276 6.29118C9.54183 6.2193 9.41493 6.18135 9.28561 6.18137H6.74493L8.52562 1.04388C8.56612 0.927004 8.57985 0.801255 8.56562 0.677392C8.55139 0.553528 8.50963 0.435237 8.44392 0.332639C8.37821 0.230041 8.2905 0.14619 8.1883 0.0882602C8.0861 0.0303306 7.97244 4.686e-05 7.85706 0H3.21425Z" fill="currentColor"/> 435 </svg> 436 437 <svg v-else class="cAddress__icon" width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg"> 438 <ellipse cx="6" cy="5.70635" rx="6" ry="5.70635" fill="#0F0F0F"/> 439 <ellipse cx="6" cy="5.70632" rx="2" ry="1.90212" fill="white"/> 440 <line x1="5.83325" y1="10.6445" x2="5.83325" y2="17.253" stroke="#0F0F0F" stroke-linecap="round"/> 441 <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6664 11.6966C10.952 11.9176 10.9953 12.3169 10.763 12.5886L6.55671 17.5077C6.3244 17.7793 5.9
4410451 17.8205 5.61886 17.5995C5.3332 17.3786 5.28996 16.9793 5.52226 16.7076L9.72852 11.7885C9.96083 11.5168 10.3807 11.4757 10.6664 11.6966Z" fill="url(#paint0_linear_2111_154636)" fill-opacity="0.5"/> 442 <defs> 443 <linearGradient id="paint0_linear_2111_154636" x1="5.9987" y1="17.1188" x2="9.13654" y2="13.1597" gradientUnits="userSpaceOnUse"> 444 <stop/> 445 <stop offset="1" stop-opacity="0"/> 446 </linearGradient> 447 </defs> 448 </svg> 449 450 451 {{title}} 452 </div> 453 `};app.cartClosedComponent={props:['cart'],data(){return{isCollapsed:!0,observer:null}},computed:{isVisible(){return this.text.length},text(){let text=this.cart.company&&this.cart.timeframe.closedText;if(!text){return''} 454text=text.split(/ /);return `<span>${text.join('</span> <span>')}</span>`}},watch:{text:{handler:function(val,oldVal){this.initObserver()},deep:!0}},destroyed(){this.destroyObserver()},mounted(){this.initObserver()},methods:{destroyObserver(){if(this.observer){this.observer.disconnect()}},initObserver(){this.destroyObserver() 455const textRoot=this.$refs.textRoot;if(textRoot&&window.IntersectionObserver){const options={root:textRoot,rootMargin:'0px 0px -10px 0px',threshold:0};this.observer=new IntersectionObserver((entries)=>{const overlay=textRoot.querySelector('.cclosed__overlay') 456if(overlay){overlay.classList.remove('cclosed__overlay')} 457for(let i=0;i<entries.length;i++){const entry=entries[i];if(!entry.isIntersecting){const leftEntry=entry.target.previousElementSibling;if(leftEntry){leftEntry.classList.add('cclosed__overlay')} 458break}}},options);textRoot.querySelectorAll('span').forEach(span=>this.observer.observe(span))}},toggle(){this.isCollapsed=!this.isCollapsed}},template:` 459 <div v-show="isVisible" 460 class="cclosed" 461 :class="{'cclosed--collapsed': isCollapsed}" 462 @click="toggle()"> 463 464 <svg class="cclosed__ico" width="24" height="24" viewBox="0 0 24 24" fill="none"> 465 <path d="M10.2679 3C11.0377 1.66667 12.9623 1.66667 13.7321 3L20.6603 15C21.4301 16.3333 20.4678 18 18.9282 18H5.0718C3.5322 18 2.56995 16.3333 3.33975 15L10.2679 3Z" fill="#F4CC5A"/> 466 <rect x="11" y="6" width="2" height="7" rx="1" fill="white"/> 467 <rect x="11" y="14" width="2" height="2" rx="1" fill="white"/> 468 </svg> 469 470 <div class="cclosed__text" ref="textRoot" v-html="text"></div> 471 472 </div> 473 `};app.cartDeliveryComponent={props:['cart','company','address','loc','isKiosk'],computed:{...Vuex.mapState(['useExpressDelivery']),isVisible(){return this.types.length>1},currentType(){let currentType=this.address.type;if(currentType==='delivery'&&this.useExpressDelivery&&this.address.isExpress){currentType='express'} 474return currentType},pointerStyle(){var index=0;for(var i=0;i<this.types.length;i++){if(this.types[i].active){index=i;break}} 475var x=index*100;return{"-webkit-transform":"translateX("+x+"%)",transform:"translateX("+x+"%)"}},typeStyle:function(){return{width:'calc(100% / '+this.types.length+')'}},types(){var items=[];if(this.company.enabledDeliveryTypes.courier){items.push({id:'delivery',name:this.loc['cart/delivery'],active:this.currentType==='delivery'});if(this.useExpressDelivery){items.push({id:'express',name:'Express',active:this.currentType==='express'})}} 476if(this.company.enabledDeliveryTypes.pickup){const discount=this.cart.amount.pickupDiscountPercentAvail;items.push({id:'pickup',name:this.isKiosk?this.loc['kiosk/pickup']:this.loc['cart/pickup'],active:this.currentType==='pickup',discount:discount?`â${discount}%`:''})} 477if(this.company.enabledDeliveryTypes.inside){items.push({id:'inside',name:this.isKiosk?this.loc['kiosk/inside']:this.loc['cart/inside'],active:this.currentType==='inside'})} 478if(this.company.enabledDeliveryTypes.drive){items.push({id:'drive',name:this.loc['cart/drive'],active:this.currentType==='drive'})} 479if(this.company.enabledDeliveryTypes.banquet){items.push({id:'banquet',name:this.loc['cart/banquet'],active:this.currentType==='banquet'})} 480return items},isMany:function(){return this.types.length>=4},isAltDiscount(){return this.types.length>=3},},methods:{select(type){if(type.off){return} 481if(this.isKiosk){this.$emit('loading',!0);this.ajax&&this.ajax.abort&&this.ajax.abort();const address=JSON.parse(JSON.stringify(this.address));address.type=type.id;const payload={address,meta:{company:this.company.id}};this.ajax=app.fetch('/address/change',payload,(response)=>{this.ajax=null;this.$emit('loading',!1);if(response.error){app.alert(response.message,'danger');return} 482app.updateStore({address:response.address});PubSub.publish('recalcCart',{formData:this.cart?JSON.parse(JSON.stringify(this.cart)):null,})});return} 483PubSub.publish('showUserAddress',{type:type.id,refScreen:'cart'})}},template:` 484 485 <div v-if="isVisible" 486 class="cdv" 487 :class="[{'cdv--many': isMany}, 'cdv--length' + types.length]"> 488 489 <div v-for="(type, i) in types" 490 :key="type.id" 491 class="cdv__item" 492 @click="select(type)" 493 :data-id="type.id" 494 :style="typeStyle" 495 :class="{'cdv__item--active': type.active, 'cdv__item--inactive': !type.active, 'cdv__item--off': type.off}"> 496 497 <div class="cdv__name">{{type.name}}</div> 498 499 <div v-if="type.discount" 500 class="cdv__discount" 501 :class="{'cdv__discount--alt': isAltDiscount}"> 502 {{type.discount}} 503 </div> 504 505 <div v-if="i === 0" 506 ref="pointer" 507 class="cdv__pointer" 508 :style="pointerStyle"></div> 509 510 </div> 511 512 </div> 513 514 `};app.cartZoneHintComponent={props:['company','address','cart'],data(){return{isCollapsed:!0,observer:null}},computed:{isVisible(){return this.address&&this.address.type==='delivery'&&this.hint},hint(){let hint;if(this.company.cartZoneHintVisibility){hint=this.address&&this.address.delivery&&this.address.delivery.currentZone&&this.address.delivery.currentZone.hint} 515if(this.cart.amount.useReserveDeliveryFee){hint=this.store.loc['cart/fee/reserved']} 516return hint},hintFormatted(){if(!this.hint){return''} 517let hint=this.hint.split(/ /).filter(line=>!!line);return `<span>${hint.join('</span> <span>')}</span>`}},watch:{hint:{handler:function(val,oldVal){this.initObserver()},deep:!0}},destroyed(){this.destroyObserver()},mounted(){this.initObserver()},methods:{destroyObserver(){if(this.observer){this.observer.disconnect()}}
517,initObserver(){this.destroyObserver() 518const textRoot=this.$refs.textRoot;if(textRoot&&window.IntersectionObserver){const options={root:textRoot,rootMargin:'0px 0px -10px 0px',threshold:0};this.observer=new IntersectionObserver((entries)=>{const overlay=textRoot.querySelector('.zhint__overlay') 519if(overlay){overlay.classList.remove('zhint__overlay')} 520for(let i=0;i<entries.length;i++){const entry=entries[i];if(!entry.isIntersecting){const leftEntry=entry.target.previousElementSibling;if(leftEntry){leftEntry.classList.add('zhint__overlay')} 521break}}},options);textRoot.querySelectorAll('span').forEach(span=>this.observer.observe(span))}},toggle(){this.isCollapsed=!this.isCollapsed}},template:` 522 523 <div v-show="isVisible" 524 class="zhint" 525 :class="{'zhint--collapsed': isCollapsed}" 526 @click="toggle()"> 527 528 <svg class="zhint__ico" width="24" height="24" viewBox="0 0 24 24" fill="none"> 529 <path d="M10.2679 3C11.0377 1.66667 12.9623 1.66667 13.7321 3L20.6603 15C21.4301 16.3333 20.4678 18 18.9282 18H5.0718C3.5322 18 2.56995 16.3333 3.33975 15L10.2679 3Z" fill="#F4CC5A"/> 530 <rect x="11" y="6" width="2" height="7" rx="1" fill="white"/> 531 <rect x="11" y="14" width="2" height="2" rx="1" fill="white"/> 532 </svg> 533 534 <div class="zhint__text" ref="textRoot" v-html="hintFormatted"></div> 535 </div> 536 537 `};app.cartDishComponent={components:{partialWeight:app.partialWeightComponent,animatedCount:app.commonAnimatedCountComponent,pointIcon:app.pointIconComponent,},props:['dish','loc','company','cart','cartLoading','mobile','ui'],data(){return{isWaitRecalc:!1,navigating:!1,localPartialWeight:null,partialWeightTimer:null,}},computed:{isVisible(){return this.dish.num>0},isControlsVisible(){return!this.dish.gift&&!this.dish.isAutoDish},isPlusDisabled(){return!!this.dish.promoLimited},giftText(){if(!this.dish.gift){return null} 538return[this.dish.num>1&&'Ã'+this.dish.num,this.loc['history/gift']].filter(Boolean).join(' ')},chooseGiftLoc(){if(!this.giftText){return null} 539if(!this.cart.promo||!this.cart.promo.enabledGifts){return null} 540return this.loc['btn/choose']},nameFormatted(){return this.dish.name.split('+')[0]},toppings(){const dishes=this.dish.topping&&this.dish.topping.dishes;if(!dishes){return null} 541const res=[];dishes.forEach(dish=>{res.push({name:dish.name,count:dish.count,total:dish.total,price:dish.price})}) 542return res},sizeFormatted(){if(this.partial){return null} 543return this.dish.sizeFormatted},price(){if(this.dish.gift){return this.priceFormat(0)} 544if(this.partial){const toppingSum=this.dish.topping?this.dish.topping.sum:0;return this.priceFormat(this.partialWeight*this.partial.priceOneUnit+toppingSum)} 545const price=(this.dish&&this.dish.price*this.dish.num)||0;return this.priceFormat(price)},discountPrice(){return this.priceFormat(this.dish.price*this.dish.num-this.dish.discount)},priceTarget(){return this.dish.discount?this.discountPrice:this.price},partial(){return this.dish.partialConfig},partialWeight:{get(){return this.localPartialWeight},set(value){this.localPartialWeight=value;this.$set(this.partial,'weight',value)}},e2ePrice(){return(this.dish.price*this.dish.num/10000)},e2eDiscount(){return this.dish.discount/10000},video(){if(!this.dish.media||!this.dish.media.length){return null} 546return this.dish.media[0].type==='video'&&this.dish.media[0]},isAppearanceInput(){return this.company.toppingCounterAppearance==='input'},isAir(){return this.ui.commonTemplate==='air'&&!this.mobile},},created(){if(!this.partial){return} 547this.localPartialWeight=this.partial.weight;this.isAir&&PubSub.subscribe('dishSelected',(_,{dishPosId,addWeight})=>{if(this.dish.dishPosId!==dishPosId){return} 548this.localPartialWeight+=addWeight})},watch:{cartLoading(isLoading){if(isLoading||!this.isWaitRecalc){return} 549this.isWaitRecalc=!1},},methods:{priceFormat(price){const currency=this.dish.isWithPoints?'':this.company.currency;return app.price.format(price,currency,this.company.priceSeparator)},changeAmount(sign){if(sign==='plus'){this.handleIncrease()}else{this.handleDecrease()} 550if(this.dish.discount){this.isWaitRecalc=!0} 551this.$emit('navigate',{type:'recalc'})},updatePartialWeight(weight){if(weight===undefined){clearTimeout(this.partialWeightTimer);this.partialWeight=this.localPartialWeight;this.$emit('navigate',{type:'recalc'});return} 552clearTimeout(this.partialWeightTimer);if(this.dish.discount){this.isWaitRecalc=!0} 553if(weight<this.partial.defaultWeight){return} 554this.partialWeightTimer=setTimeout(()=>{this.$emit('navigate',{type:'recalc'})},400)},handleIncrease(){if(this.isPlusDisabled){return} 555if(this.partial){const newWeight=(Math.round(this.partialWeight*1000)+Math.round(this.partial.partialStep*1000))/1000;this.partialWeight=newWeight>9999?9999:newWeight}else{this.dish.num++}},handleDecrease(){if(this.partial){const updWeight=(Math.round(this.partialWeight*1000)-Math.round(this.partial.partialStep*1000))/1000;if(updWeight<this.partial.defaultWeight){this.dish.num--}else{this.partialWeight=updWeight}}else{this.dish.num--} 556this.dish.num=Math.max(this.dish.num,0)},editDish(){if(this.dish.gift||this.dish.isAutoDish||!this.dish.issetModifiers||this.partial){return} 557if(this.navigating){return} 558this.navigating=!0;setTimeout(()=>{this.navigating=!1},500);const isCombo=this.company.isUseCombo&&this.dish.dishPosId&&this.dish.dishPosId.indexOf('#')!==-1;if(isCombo){this.$emit('navigate',{type:'alert',message:this.loc['cart/err/comboNotEditable']});return} 559PubSub.publish('showTopping',{preload:{dish:this.dish,company:this.company,menu:this.cart.menu}})},videoPlay(flag){if(!this.video||this.mobile){return} 560if(flag){this.$refs.video.play();return} 561this.$refs.video.pause()}
561,chooseGift(){this.$emit('navigate',{type:'screen',name:'gifts'})}},template:` 562 <div v-if="isVisible" 563 class="cDish" 564 :class="{'cDish--photo': dish.photo || video, 'cDish--gift': giftText}" 565 @mouseenter="videoPlay(true)" 566 @mouseleave="videoPlay(false)" 567 @click="editDish()"> 568 569 <template v-if="video"> 570 <video ref="video" 571 class="cDish__photo cDish__photo--video" 572 :src="video.preview" 573 :autoplay="mobile" 574 muted loop playsinline webkit-playsinline></video> 575 </template> 576 <img v-else-if="dish.photo" 577 class="cDish__photo" 578 :src="dish.photo.high"> 579 580 <div class="cDish__container"> 581 582 <div v-if="giftText" class="cDish__gift">{{giftText}}</div> 583 584 <div class="cDish__name"> 585 {{nameFormatted}} 586 587 <span v-if="sizeFormatted" class="cDish__size"> {{sizeFormatted}}</span> 588 </div> 589 590 <div v-if="toppings" class="cDish__toppings"> 591 <div v-for="topping in toppings" class="cDish__topping"> 592 <span class="cDish__toppingName">+{{topping.name}}</span> <span class="cDish__toppingMultiply">Ã</span> <span class="cDish__toppingCount">{{topping.count}}</span> 593 </div> 594 </div> 595 596 597 </div> 598 599 600 <div v-if="chooseGiftLoc" 601 class="cDish__chooseGift" 602 v-press 603 @click="chooseGift"> 604 {{chooseGiftLoc}} 605 606 <svg width="15" height="10" viewBox="0 0 15 10" fill="none"> 607 <path d="M1.125 4.35417C0.768316 4.35417 0.479167 4.64332 0.479167 5C0.479167 5.35668 0.768316 5.64583 1.125 5.64583V4.35417ZM14.4983 5.45667C14.7506 5.20446 14.7506 4.79554 14.4983 4.54333L10.3883 0.433269C10.1361 0.181055 9.72715 0.181055 9.47494 0.433269C9.22272 0.685483 9.22272 1.0944 9.47494 1.34662L13.1283 5L9.47494 8.65338C9.22272 8.9056 9.22272 9.31452 9.47494 9.56673C9.72715 9.81894 10.1361 9.81894 10.3883 9.56673L14.4983 5.45667ZM1.125 5V5.64583L14.0417 5.64583V5V4.35417L1.125 4.35417V5Z" fill="currentColor"/> 608 </svg> 609 610 611 </div> 612 613 <div v-if="!giftText" class="cDish__footer"> 614 <div class="cDish__meta"> 615 616 <transition name="cDish__fade" mode="out-in"> 617 618 <div v-if="!isWaitRecalc"> 619 620 <div v-if="dish.discount" 621 class="cDish__priceDiscount" 622 :data-price="e2ePrice" 623 :data-discount="e2eDiscount" 624 :data-percent="dish.discountPercentFormatted"> 625 <span>{{price}}</span> 626 </div> 627 <div class="cDish__priceTarget" :data-price="e2ePrice"> 628 {{priceTarget}} 629 <point-icon v-if="dish.isWithPoints" 630 class="cDish__pointIcon" 631 variant="dish"></point-icon> 632 </div> 633 634 </div> 635 </transition> 636 637 </div> 638 639 <div v-if="isControlsVisible" class="cDish__controls"> 640 <button type="button" 641 class="cDish__button cDish__button--minus" 642 v-press 643 data-action="minus" 644 @click.stop="changeAmount('minus')"> 645 <svg width="17" height="3" viewBox="0 0 17 3" fill="none"> 646 <path d="M15.5 1.5L1.5 1.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> 647 </svg> 648 649 </button> 650 651 <div v-if="partial" class="cDish__num cDish__num--partial"> 652 653 <partialWeight v-model="partialWeight"
654 @blur="updatePartialWeight()" 655 @input="updatePartialWeight($event)" 656 :readonly="!isAppearanceInput" 657 :unit="partial.sizeTypeFormatted" 658 :min="partial.defaultWeight" 659 :max="9999"/> 660 </div> 661 <div v-else class="cDish__num cDish__num--animated"> 662 <animatedCount :value="dish.num" /> 663 </div> 664 665 <button type="button" 666 class="cDish__button cDish__button--plus" 667 data-action="plus" 668 v-press 669 :disabled="isPlusDisabled" 670 @click.stop="changeAmount('plus')"> 671 672 <svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"> 673<path d="M8.5 1.5V15.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> 674<path d="M15.5 8.5L1.5 8.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> 675</svg> 676 677 678 </button> 679 </div> 680 </div> 681 682 </div> 683 `};app.cartDishesComponent={components:{'cart-dish':app.cartDishComponent},inject:['store'],props:['cart','loc','company','cartLoading','mobile','ui'],computed:{dishes(){return this.cart.dishes}},methods:{onNavigate(params){this.$emit('navigate',params)}},template:` 684 <div class="cDishes"> 685 <cart-dish v-for="dish of dishes" 686 :data-id="dish.dishId" 687 :key="dish.dishPosId" 688 :dish="dish" 689 :cart="cart" 690 :loc="loc" 691 :company="company" 692 :cart-loading="cartLoading" 693 :mobile="mobile" 694 :ui="ui" 695 @navigate="onNavigate"> 696 </cart-dish> 697 </div> 698 `};app.cartExtraDishesComponent={props:['cart','loc','mobile','company'],data(){return{skipNextDish:!1,isInitHammer:!1}},computed:{isVisible(){return this.cart.extra&&this.cart.extra.dishes.length},title(){return this.loc['cart/extra/title']},},watch:{isVisible:{handler(isVisible){if(!isVisible){this.isInitHammer=!1;return} 699if(this.mobile||this.isInitHammer){return} 700this.$nextTick(this.initHammer)},immediate:!0}},methods:{add(dish){if(this.skipNextDish){this.skipNextDish=!1;return} 701if(dish.issetRequiredModifiers&&dish.sectionId){PubSub.publish('showTopping',{preload:{dish:{dishId:dish.dishId,sectionId:dish.sectionId,},company:this.company,menu:this.cart.menu,},});return} 702const dishes=this.cart.extra.dishes.filter((item)=>item.dishId!==dish.dishId);this.cart.dishes.push(JSON.parse(JSON.stringify(dish)));this.cart.extra.dishes=dishes;this.$emit('navigate',{type:'recalc'})},initHammer(){const container=this.$refs.container;let startX;let scrollLeft;let isDown;const startDragging=(e)=>{isDown=!0;startX=e.pageX-container.offsetLeft;scrollLeft=container.scrollLeft};const stopDragging=(e)=>{if(!isDown){return} 703isDown=!1;setTimeout(()=>{this.skipNextDish=!1},50)};const move=(e)=>{if(!isDown){return} 704e.preventDefault();const isScroll=Math.abs(scrollLeft-container.scrollLeft)>1;if(isScroll){this.skipNextDish=!0} 705const x=e.pageX-container.offsetLeft;const walkX=x-startX;container.scrollLeft=scrollLeft-walkX};container.addEventListener('mousedown',startDragging);container.addEventListener('mouseup',stopDragging);container.addEventListener('mouseleave',stopDragging);container.addEventListener('mousemove',move);this.isInitHammer=!0},},template:` 706 <div v-if="isVisible" 707 class="cextra"> 708 709 <div class="cextra__header">{{title}}</div> 710 711 <div ref="container" class="cextra__scrollable"> 712 713 <div v-for="dish in cart.extra.dishes" 714 :key="dish.dishPosId" 715 :data-id="dish.dishId" 716 class="cextra__item" 717 @click="add(dish)"> 718 719 <template v-if="dish.media && dish.media[0]"> 720 <template v-if="dish.media[0].type === 'video'"> 721 <video ref="video" 722 class="cextra__photo" 723 :src="dish.media[0].preview" 724 autoplay muted loop playsinline webkit-playsinline></video> 725 </template> 726 <img v-else 727 class="cextra__photo" 728 :src="dish.photo.high"> 729 </template> 730 731 <div v-else class="cextra__nophoto"></div> 732 733 <div class="cextra__name">{{dish.name}}</div> 734 735 <div class="cextra__price">
736 <span v-if="dish.priceCross" class="cextra__cross">{{dish.priceCrossFormatted}}</span> 737 {{dish.priceFormatted}} 738 </div> 739 740 </div> 741 742 </div> 743 744 745 746 </div> 747 `};app.cartPriorityComponent={props:['cart','address','loc'],computed:{isVisible(){return this.cart.company.feePriorityFormatted&&(this.address&&this.address.type==='delivery')},isApplied(){return this.cart.amount.feePriority},value(){return(this.isApplied?'':'+')+this.cart.company.feePriorityFormatted},valueFeePriority(){return this.cart.amount.feePriority/10000},title(){return this.loc['cart/priority']},text(){return this.loc['cart/priority/hint']}},methods:{toggle:function(){this.cart.amount.feePriority=!this.cart.amount.feePriority;if(this.cart.amount.feePriority){this.cart.amount.feePriorityFormatted=this.cart.company.feePriorityFormatted} 748this.$emit('navigate',{type:'recalc'})}},template:` 749 <div v-if="isVisible" 750 @click="toggle()" 751 class="ctprior" :data-value="valueFeePriority"> 752 753 <div class="ctprior__right"> 754 <div class="ctprior__value" 755 :class="{'ctprior__value--applied': isApplied}"> 756 {{value}} 757 </div> 758 </div> 759 760 <div class="ctprior__left"> 761 762 <div class="ctbox ctprior__checkbox" 763 :class="{'ctbox--selected': isApplied}"></div> 764 765 <div class="ctprior__title" 766 :class="{'ctprior__title--applied': isApplied}">{{title}}</div> 767 <div class="ctprior__text" v-html="text"></div> 768 </div> 769 770 </div> 771 `};app.optionsMediaComponent={props:['media'],data(){return{error:!1,loading:!0,}},computed:{classes(){return{'oMedia--error':this.error,'oMedia--loading':this.loading,}},},methods:{onError(){this.error=!0;this.loading=!1},onLoad(){this.loading=!1}},template:` 772<div class="oMedia" :class="classes"> 773 <template v-if="media.type === 'video'"> 774 <video ref="video" 775 class="oMedia__video" 776 :src="media.preview" 777 @canplay="onLoad()" 778 @error="onError()" 779 autoplay muted loop playsinline webkit-playsinline></video> 780 </template> 781 <img v-else 782 class="oMedia__img" 783 :src="media.high" 784 @load="onLoad()" 785 @error="onError()"> 786</div> 787`};app.optionsCutleryComponent={components:{optionsMedia:app.optionsMediaComponent,animatedCount:app.commonAnimatedCountComponent,},props:['isShowImg','cart','loc','company'],computed:{cutlery(){const isPersons=this.company.cutleryVisible==="visible";let amount=this.cart.amount.cutlery;if(isPersons&&amount<=0){amount=1} 788return{isPersons,amount,title:isPersons?this.loc['cart/cutlery']:this.loc['cart/cutleryNum'],min:isPersons?1:0,}},img(){return{high:'data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="40" height="40" fill="white"/><path d="M16.1167 17.2538C15.7731 17.5035 15.5144 17.8838 15.5359 18.308L16.1436 30.2924C16.1601 30.5107 16.1296 30.7298 16.054 30.9362C15.9783 31.1426 15.8592 31.3318 15.704 31.492C15.5488 31.6523 15.3608 31.78 15.1519 31.8674C14.9429 31.9548 14.7175 31.9999 14.4896 3
7881.9999C14.2617 31.9999 14.0362 31.9548 13.8272 31.8674C13.6183 31.78 13.4304 31.6523 13.2751 31.492C13.1199 31.3318 13.0008 31.1426 12.9252 30.9362C12.8495 30.7298 12.819 30.5107 12.8355 30.2924L13.4629 18.3085C13.4851 17.8841 13.2266 17.5031 12.8831 17.2529C11.7555 16.4317 11 14.7603 11 12.7999C11 10.0235 12.5719 7.99991 14.5 7.99991C16.4281 7.99991 18 10.0235 18 12.7999C18 14.761 17.2464 16.433 16.1167 17.2538Z" fill="%23DEDEDE"/><path d="M27.2091 17.2922C26.7936 17.5148 26.4784 17.9266 26.5043 18.3973L27.1599 30.2925C27.1764 30.5107 27.1459 30.7299 27.07 30.9363C26.9942 31.1427 26.8748 31.3319 26.7192 31.4921C26.5636 31.6523 26.3752 31.7801 26.1657 31.8675C25.9563 31.9549 25.7302 32 25.5018 32C25.2733 32 25.0472 31.9549 24.8378 31.8675C24.6283 31.7801 24.4399 31.6523 24.2843 31.4921C24.1287 31.3319 24.0093 31.1427 23.9335 30.9363C23.8576 30.7299 23.8271 30.5107 23.8436 30.2925L24.4991 18.3981C24.5251 17.9271 24.2094 17.5151 23.7934 17.2926C23.3728 17.0676 23.0025 16.7605 22.7084 16.388C22.2494 15.8068 22.0007 15.0982 22 14.3695L22.4913 8.42991C22.5114 8.18695 22.7145 8 22.9583 8C23.2071 8 23.4125 8.19451 23.4261 8.44297L23.726 13.9306C23.7395 14.1768 23.943 14.3695 24.1896 14.3695C24.4344 14.3695 24.6372 14.1793 24.6528 13.9349L25.005 8.43862C25.0208 8.19197 25.2255 8 25.4726 8C25.7181 8 25.922 8.18948 25.9399 8.43432L26.3438 13.9434C26.3614 14.1836 26.5614 14.3695 26.8023 14.3695C27.0514 14.3695 27.2552 14.171 27.2618 13.9219L27.406 8.45579C27.4127 8.20214 27.6202 8 27.874 8C28.1125 8 28.3129 8.17939 28.3392 8.41649L29 14.3695C28.9995 15.0977 28.7513 15.806 28.293 16.3872C27.9992 16.7597 27.6294 17.067 27.2091 17.2922Z" fill="%23DEDEDE"/></svg>'}}},methods:{changeCutlery(term){let count=this.cutlery.amount+term;const min=this.cutlery.isPersons?1:0;if(count<min){count=min} 789if(this.cart.amount.cutlery!==count){this.cart.amount.cutlery=count;this.$emit('navigate',{type:'recalc'})}},},template:` 790<div class="cOptions__item cOptions__item--cutlery"> 791 792 <optionsMedia v-if="isShowImg" :media="img"/> 793 794 <div class="cOptions__name"> 795 {{cutlery.title}} 796 </div> 797 <div class="cOptions__control"> 798 799 <button type="button" 800 class="cOptions__button" 801 :class="{'cOptions__button--hidden': cutlery.amount === cutlery.min}" 802 data-action="minus" 803 @click="changeCutlery(-1)" 804 :disabled="cutlery.amount === cutlery.min" 805 v-blur-on-focus> 806 <svg width="13" height="3" viewBox="0 0 13 3" fill="none"> 807 <path d="M12.1997 1.6001L0.999706 1.6001" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/> 808 </svg> 809 </button> 810 811 <div class="cOptions__count cOptions__count--animated"> 812 <animatedCount :value="cutlery.amount" /> 813 </div> 814 815 <button type="button" 816 class="cOptions__button" 817 data-action="plus" 818 @click="changeCutlery(1)" 819 v-blur-on-focus> 820 <svg width="13" height="13" viewBox="0 0 13 13" fill="none"> 821 <path d="M6.6001 1V12.2" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/> 822 <path d="M12.2 6.6001L0.99995 6.6001" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/> 823 </svg> 824 </button> 825 826 </div> 827</div> 828`};app.optionsAutodishComponent={components:{optionsMedia:app.optionsMediaComponent,},props:['value','isShowImg','company','loc'],computed:{autodish:{get(){return this.value},set(entry){this.$emit('input',entry)}},items(){return this.autodish.items||[]},count(){return this.items.reduce((sum,item)=>sum+(item.count||0),0)},max(){if(this.items.some((item)=>!item.max)){return null} 829return this.items.reduce((sum,item)=>sum+item.max,0)},disabled(){return{minus:!this.items.some((item)=>item.count>item.min),plus:!this.items.some((item)=>!item.max||item.count<item.max)}},priceNumber(){const isSingle=this.items.length===1;const paid=this.items.filter((item)=>item.price);if(!paid.length){return isSingle?'':this.priceFormat(0)} 830const price=paid.reduce((sum,item)=>{const count=isSingle?Math.max(item.count||0,1):(item.count||0);return sum+item.price*count},0);return this.priceFormat(price)},freeText(){if(this.items.length<2){return''} 831const free=this.items.filter((item)=>!item.price);if(!free.length||free.some((item)=>!item.max)){return''} 832const count=free.reduce((sum,item)=>sum+item.max,0);const template=this.loc['autodish/free'];return count&&template?template.replace('{count}',count):''},amount(){const template=this.loc['autodish/amount'];if(!this.max||this.max===1||!template){return null} 833return template.replace('{current}',this.count).replace('{max}',this.max)},media(){const withMedia=this.items.find((item)=>item.media&&item.media[0]);return(withMedia&&withMedia.media[0])||{high:'data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M40 0H0V40H40V0Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M27.0338 5.59357C29.5095 13.2495 29.5413 22.4822 29.2686 31.9112L24.8114 34.6411L21.9967 14.8125L27.0338 5.59357Z" fill="%23E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.9819 5.27472L27.0338 5.59355C24.453 13.4089 24.5004 23.8912 24.8114 34.6411L10.882 32.9198C10.7419 23.6429 10.3126 14.3446 12.9819 5.27472Z" fill="%23F4F4F4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M25.6897 8.0903L11.6955 7.69804C11.8176 7.24751 12.5292 5.68206 12.9819 5.27472L27.0339 5.59355C26.5998 6.0663 25.7972 7.64107 25.6897 8.0903Z" fill="%23D0D0D0"/></svg>'}}},methods:{priceFormat(price){return app.price.format(price,'',this.company.priceSeparator)},changeCount(term){const target=term>0?this.items.find((item)=>!item.max||item.count<item.max):this.items.slice().reverse().find((item)=>item.count>item.min);if(!target){return} 834target.count=target.count+term;this.$emit('navigate',{type:'recalc'})}},template:` 835<div class="cOptions__item"> 836 837 <optionsMedia v-if="isShowImg" 838 :media="media"/> 839 840 <div class="oAutodish"> 841 842 <div class="cOptions__name"> 843 {{ autodish.name }}
844 <span class="cOptions__subname" 845 v-if="priceNumber"><span class="oAutodish__price">{{ priceNumber }}</span>{{ company.currency }}</span> 846 <span class="cOptions__subname" 847 v-else>{{ loc['history/free'] }}</span> 848 </div> 849 850 <div class="cOptions__control"> 851 852 <button :disabled="disabled.minus" 853 @click="changeCount(-1)" 854 class="cOptions__button" 855 :class="{'cOptions__button--hidden': disabled.minus}" 856 data-action="minus" 857 type="button" 858 v-blur-on-focus> 859 <svg fill="none" height="3" viewBox="0 0 13 3" width="13"> 860 <path d="M12.1997 1.6001L0.999706 1.6001" stroke="currentColor" stroke-linecap="round" stroke-width="1.6"/> 861 </svg> 862 </button> 863 864 <div class="cOptions__count">{{ count }}</div> 865 866 <button :disabled="disabled.plus" 867 @click="changeCount(1)" 868 class="cOptions__button" 869 data-action="plus" 870 type="button" 871 v-blur-on-focus> 872 <svg fill="none" height="13" viewBox="0 0 13 13" width="13"> 873 <path d="M6.6001 1V12.2" stroke="currentColor" stroke-linecap="round" stroke-width="1.6"/> 874 <path d="M12.2 6.6001L0.99995 6.6001" stroke="currentColor" stroke-linecap="round" stroke-width="1.6"/> 875 </svg> 876 </button> 877 878 </div> 879 880 <div v-if="freeText" 881 class="oAutodish__free cOptions__sub">{{ freeText }}</div> 882 883 <div v-if="amount" 884 class="oAutodish__amount cOptions__sub">{{ amount }}</div> 885 886 </div> 887</div> 888 `};app.optionsPromocodeComponent={components:{commonInput:app.commonInputComponent,},props:['cart','loc','company','isKiosk'],data(){return{code:(this.cart&&this.cart.promo.code)||'',myCodes:[],myCodesLoaded:!1,myCodesLoading:!1,dropdownVisible:!1}},computed:{isVisible(){if(this.isKiosk&&!this.isApplied){return!1} 889return!0},title(){return this.loc['cart/promocode']},isDropdownVisible(){return this.dropdownVisible&&!this.isApplied&&this.myCodes.length>0},locMyCodesTitle(){return this.loc['cart/promo/myCodes/title']},isApplied(){return this.cart.promo.id&&this.code},isGift(){const dishes=this.cart.dishes.filter((dish)=>dish.gift);return dishes&&dishes.length>0},warning(){if(!this.code){return null} 890if(this.message.isError){return'ð¯'} 891return null},message(){var text=this.cart.promo.error;var isError=!!text;if(this.isApplied){if(this.cart.promo.discount){text=this.loc['cart/promocode/discount'].replace('{sum}',this.cart.promo.discountFormatted)}else{if(this.isGift){text=this.loc['cart/promocode/gift']}else{text=this.loc['cart/promocode/applied']}}} 892return{text:text.replace('{','<span>').replace('}','</span>'),isError:isError}},},watch:{'cart.promo.code'(cur){if(cur){this.code=cur}},isApplied(){this.$refs.input.$el.querySelector('input').blur()}}
892,methods:{cancel(){this.code='';this.cart.promo.cancelled=!0;this.onInput()},onCancel(){const isConfirm=window.confirm(this.loc['cart/promocode/cancel']) 893if(!isConfirm){return} 894this.cancel()},onInput(){this.cart.promo.code=this.code;this.cart.promo.cancelled=!0;this.cart.promo.codeSource='manual';this.$emit('navigate',{type:'recalc'})},onClickSpoiler(){this.$refs.input.$el.querySelector('input').focus()},onClickMessage(e){if(e.target.nodeName==='SPAN'){this.$emit('navigate',{type:'close'});setTimeout(()=>{PubSub.publish('showAuth',{returnTo:'cart',})},500)}},onFocus(){this.dropdownVisible=!0;this.fetchMyCodes()},onBlur(){setTimeout(()=>{this.dropdownVisible=!1},200)},fetchMyCodes(){if(!this.$store.state.user||this.myCodesLoaded||this.myCodesLoading){return} 895this.myCodesLoading=!0;app.fetch('/profile/promo-codes/get',{},(res)=>{this.myCodesLoading=!1;if(res&&!res.error){this.myCodes=res.codes||[];this.myCodesLoaded=!0}})},selectMyCode(item){this.code=item.code;this.dropdownVisible=!1;this.onInput()},myCodeDate(item){if(!item.dateEnd){return''} 896return(this.loc['cart/promo/myCodes/validUntil']||'').replace('{date}',item.dateEnd)}},directives:{spoiler:{inserted(el){el.style.height=el.scrollHeight+'px'},update(el){el.style.height=el.scrollHeight+'px'}},},template:` 897<div v-if="isVisible" class="cOptions__item cOptions__item--promo"> 898 <div class="oPromo" 899 @focusin="onFocus()" 900 @focusout="onBlur()"> 901 902 <commonInput ref="input" 903 v-model="code" 904 :caption="title" 905 :inner="true" 906 class="oPromo__input" 907 @input="onInput()"/> 908 909 <transition name="oPromo__fade"> 910 <div v-if="isDropdownVisible" class="oPromoCodes"> 911 <div v-if="locMyCodesTitle" class="oPromoCodes__title">{{locMyCodesTitle}}</div> 912 <div v-for="item in myCodes" 913 :key="item.code" 914 class="oPromoCodes__item" 915 @mousedown.prevent="selectMyCode(item)"> 916 <div class="oPromoCodes__code">{{item.code}}</div> 917 <div v-if="item.name" class="oPromoCodes__name">{{item.name}}</div> 918 <div v-if="item.dateEnd" class="oPromoCodes__date">{{myCodeDate(item)}}</div> 919 </div> 920 </div> 921 </transition> 922 923 <transition name="oPromo__fade"> 924 <svg v-if="warning" 925 class="oPromo__warning" 926 width="21" height="18" viewBox="0 0 21 18" fill="none" xmlns="http://www.w3.org/2000/svg"> 927 <path fill-rule="evenodd" clip-rule="evenodd" d="M8.19708 1.28831C9.26972 -0.429434 11.7303 -0.429437 12.8029 1.2883L20.5688 13.7248C21.7252 15.5767 20.4199 18 18.2659 18H2.7341C0.580144 18 -0.725226 15.5767 0.431181 13.7248L8.19708 1.28831ZM9.08452 5.53356C9.08452 4.73694 9.71821 4.09116 10.4999 4.09116C11.2816 4.09116 11.9153 4.73694 11.9153 5.53356V10.0668C11.9153 10.8634 11.2816 11.5092 10.4999 11.5092C9.71821 11.5092 9.08452 10.8634 9.08452 10.0668V5.53356ZM10.4491 13.3637C9.6953 13.3637 9.08425 13.9864 9.08425 14.7546C9.08425 15.5228 9.6953 16.1455 10.4491 16.1455H10.5502C11.304 16.1455 11.915 15.5228 11.915 14.7546C11.915 13.9864 11.304 13.3637 10.5502 13.3637H10.4491Z" fill="#FFD600"/> 928 </svg> 929 </transition> 930 931 <transition name="oPromo__fade"> 932 <div v-if="isApplied" 933 class="cOptions__trash" 934 @click="onCancel()"> 935 <div class="cOptions__mirror">{{code}}</div> 936 <svg class="cOptions__trashIcon" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 937 <path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6ZM8.49963 8.50054C8.22357 8.7766 7.76525 8.76587 7.47596 8.47657L5.99862 6.99923L4.52348 8.47437C4.23418 8.76367 3.77586 8.7744 3.4998 8.49834C3.22374 8.22227 3.23447 7.76396 3.52377 7.47466L4.99891 5.99952L3.52504 4.52566C3.23575 4.23636 3.22502 3.77805 3.50108 3.50198C3.77714 3.22592 4.23546 3.23665 4.52476 3.52595L5.99862 4.99981L7.47468 3.52375C7.76398 3.23445 8.22229 3.22372 8.49836 3.49978C8.77442 3.77584 8.76369 4.23416 8.47439 4.52346L6.99833 5.99952L8.47567 7.47686C8.76497 7.76616 8.7757 8.22448 8.49963 8.50054Z" fill="currentColor"/> 938 </svg> 939 </div> 940 </transition> 941 942 <div class="cOptions__spoiler" @click="onClickSpoiler()"> 943 <transition name="cOptions__spoiler"> 944 <div v-if="message.text" 945 :key="message.text" 946 class="cOptions__message" 947 :class="{'cOptions__message--error': message.isError}" 948 v-spoiler 949 @click="onClickMessage($event)" 950 v-html="message.text"> 951 </div> 952 </transition> 953 </div> 954 955 </div> 956</div> 957 `};app.optionsExchangeComponent={props:['cart'],data(){return{animExchange:!1,}},computed:{exchange(){return{title:this.cart.exchange.title,sub:this.cart.exchange.error||this.cart.exchange.maxPointsText,warn:!!this.cart.exchange.error,maxPercent:this.cart.exchange.maxPercent,maxAllowedExchange:this.cart.exchange.maxAllowedExchange,userPointsRound:this.cart.exchange.userPointsRound,userPoints:this.cart.exchange.userPoints,}}
957,exchangeValue:{get(){return this.cart.exchange.discountFormatted},set(flag){this.cart.exchange.discountFormatted=flag?this.cart.exchange.maxDiscountFormatted:'';this.$emit('navigate',{type:'recalc'})}},},methods:{onClickExchange(){if(!this.exchange.warn||this.animExchange){return} 958this.animExchange=!0},onAnimationendExchange(){this.animExchange=!1}},template:` 959<label class="cOptions__item tSwitch oPoint" 960 :class="{'oPoint--warning': exchange.warn}" 961 @click="onClickExchange()"> 962 963 <span class="cOptions__name tSwitch__caption"> 964 <span v-html="exchange.title"></span> 965 <div v-if="exchange.sub" 966 class="cOptions__sub" 967 :data-percent="exchange.maxPercent" 968 :data-allowed-exchange="exchange.maxAllowedExchange" 969 :data-user-points-round="exchange.userPointsRound" 970 :data-user-points="exchange.userPoints" 971 v-html="exchange.sub"></div> 972 </span> 973 <input v-model="exchangeValue" 974 :disabled="exchange.warn" 975 type="checkbox" 976 name="exchange" 977 class="tSwitch__input"> 978 <span class="tSwitch__switch"> 979 <svg class="tSwitch__tick" 980 :class="{'oPoint__disabledAnim': animExchange}" 981 @animationend="onAnimationendExchange()" 982 width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg"> 983 <path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 0C6.04416 0 0 6.04416 0 13.5C0 20.9558 6.04416 27 13.5 27C20.9558 27 27 20.9558 27 13.5C27 6.04416 20.9558 0 13.5 0ZM8.52942 16.8532C7.95647 17.4262 7.96688 18.3655 8.55266 18.9513C9.13845 19.5371 10.0778 19.5475 10.6507 18.9745L18.4754 11.1499C19.0484 10.5769 19.0379 9.63758 18.4522 9.05179C17.8664 8.466 16.927 8.4556 16.3541 9.02854L8.52942 16.8532ZM11.0234 11.5239C10.2424 12.3049 8.97602 12.3049 8.19497 11.5239C7.41393 10.7428 7.41393 9.47651 8.19497 8.69546C8.97602 7.91441 10.2424 7.91441 11.0234 8.69546C11.8045 9.47651 11.8045 10.7428 11.0234 11.5239ZM15.9762 19.3051C16.7573 20.0862 18.0236 20.0862 18.8047 19.3051C19.5857 18.5241 19.5857 17.2578 18.8047 16.4767C18.0236 15.6957 16.7573 15.6957 15.9762 16.4767C15.1952 17.2578 15.1952 18.5241 15.9762 19.3051Z" fill="currentColor"/> 984 </svg> 985 </span> 986 987</label> 988 `};app.cartOptionsComponent={components:{optionsCutlery:app.optionsCutleryComponent,optionsAutodish:app.optionsAutodishComponent,optionsPromocode:app.optionsPromocodeComponent,optionsExchange:app.optionsExchangeComponent,},props:['cart','company','loc','isKiosk','ui','mobile'],computed:{autoDishes(){const groups=[];const indexByName={};(this.cart.autoDishes||[]).forEach((autodish)=>{const key=autodish.name||'';if(indexByName[key]===undefined){indexByName[key]=groups.length;groups.push({key,name:autodish.name,items:[]})} 989groups[indexByName[key]].items.push(autodish)});groups.forEach((group)=>{group.items.sort((a,b)=>((a.price||0)-(b.price||0))||(a.id-b.id))});return groups},isShowImg(){if(!this.autoDishes.length){return} 990return this.cart.autoDishes.find((autodish)=>autodish.media&&autodish.media[0])}},methods:{onNavigate(params){this.$emit('navigate',params)}},template:` 991<div class="cOptions"> 992 993 <optionsCutlery v-if="company.cutleryVisible && !isKiosk" 994 :cart="cart" 995 :loc="loc" 996 :company="company" 997 :isShowImg="isShowImg" 998 @navigate="onNavigate"/> 999 1000 <optionsAutodish v-for="group in autoDishes" 1001 :key="group.key" 1002 v-model="group" 1003 :company="company" 1004 :loc="loc" 1005 :isShowImg="isShowImg" 1006 @navigate="onNavigate"/> 1007 1008 <optionsPromocode 1009 :cart="cart" 1010 :loc="loc" 1011 :company="company" 1012 :is-kiosk="isKiosk" 1013 @navigate="onNavigate"/> 1014 1015 <optionsExchange v-if="cart.exchange.maxDiscountFormatted" 1016 :cart="cart" 1017 @navigate="onNavigate"/> 1018 1019</div> 1020 `};app.cartTipComponent={components:{commonInput:app.commonInputComponent,},props:['cart','loc','company'],computed:{...Vuex.mapState(['isKiosk']),tips(){if(this.isKiosk){return} 1021return this.cart.tips},isActive:{get(){return this.tips.isActive},set(flag){this.$set(this.tips,'isActive',flag);this.$emit('navigate',{type:'recalc'})}},amount:{get(){return this.tips.amount},set(value){this.$set(this.tips,'amount',value);this.$emit('navigate',{type:'recalc'})}},},directives:{spoiler:{inserted(el){el.style.height=el.scrollHeight+'px'},},},template:` 1022 <div v-if="tips" class="cTips"> 1023 1024 <commonInput v-model="isActive" 1025 type="checkbox" 1026 :caption="loc['cart/tips/caption']"/> 1027 1028 <transition name="cInput__spoiler"> 1029 <commonInput v-if="tips.isActive" 1030 type="buttons" 1031 v-model="amount" 1032 :options="tips.options" 1033 v-spoiler/> 1034 </transition> 1035 1036 </div> 1037 `};app.cartScreenDishesComponent={components:{cartHeader:app.cartHeaderComponent,cartDelivery:app.cartDeliveryComponent,cartDishes:app.cartDishesComponent,cartClosed:app.cartClosedComponent,cartPriority:app.cartPriorityComponent,cartExtraDishes:app.cartExtraDishesComponent,cartPromoGrade:app.cartPromoGradeComponent,cartBanner:app.cartBanner,cartAddress:app.cartDishesAddressComponent,cartOptions:app.cartOptionsComponent,cartFooter:app.cartFooterComponent,cartSummary:app.cartSummaryComponent,cartTip:app.cartTipComponent,kioskPayment:app.kioskPaymentComponent,cartMultiCart:app.cartMultiCartComponent,},props:['cart','loc','company','ui','mobile','isKiosk','address','cartLoading','user','useExpressDelivery'],data(){return{isSubmitting:!1}},computed:{locTitle(){const isMultiCarts=this.cart.multiCarts&&this.cart.multiCarts.carts.length>0;if(this.company.aggregator&&!isMultiCarts){return this.cart.company.name} 1038if(!this.mobile&&this.ui&&this.ui.commonTemplate==='air'){return this.loc['site/home/cartPreview/title']} 1039return this.loc['tab/cart']},submitText(){return this.loc['btn/toCheckout']},isSingleKioskPayment(){if(!this.isKiosk){return!1} 1040return Object.values(this.cart.payment.types).filter((type)=>!type.off).length===1},},methods:{clear(){this.$emit('navigate',{type:'screen',name:'clear'})},navigateBack:function(){this.$emit('navigate',{type:'close'})},onSubmit(){if(this.address.type==='delivery'&&this.cart.amount.minPriceError){this.$emit('navigate',{type:'alert',message:this.cart.amount.minPriceError});return} 1041if(this.cart.amount.pointDishMinSumViolation){this.$emit('navigate',{type:'alert',message:this.cart.amount.pointDishMinSumError});return} 1042if(this.cart.company.closedText&&this.cart.timeframe.types.preorder.off){this.$emit('navigate',{type:'alert',message:this.cart.company.closedText});return} 1043if(this.company.cutleryVisible==='cutlery-required'&&!this.cart.amount.cutlery){this.$emit('navigate',{type:'alert',message:this.loc['cart/err/cutlery']});return} 1044if(this.cart.extra.confirmText&&!this.cart.extra.confirmed){this.$emit('navigate',{type:'confirm',message:this.cart.extra.confirmText,cb:()=>{this.cart.extra.confirmed=!0;this.$emit('navigate',{type:'recalc'});this.$emit('navigate',{type:'screen',name:'form'})}});return} 1045this.isSubmitting=!0;setTimeout(()=>{this.isSubmitting=!1},400);if(this.isKiosk){this.$emit('navigate',{type:'order'});return} 1046this.$emit('navigate',{type:'screen',name:'form'});PubSub.publish('gtmNotify',{event:'initiateCheckout',cart:this.cart})},onGiftPicked(gift){this.cart.promo.code=this.cart.promo.grade.code;this.cart.promo.codeSource='manual';this.cart.promo.grade.forceGift=gift.posId.replace('gift','');this.cart.promo.forceGift=null;this.$emit('navigate',{type:'recalc'})},onNavigate(params){this.$emit('navigate',params)},onLoading(flag){this.isSubmitting=flag}},template:` 1047<div class="csdishes"> 1048 1049 <cartHeader 1050 :title="locTitle" 1051 clear="true" 1052 @back="navigateBack()" 1053 @clear="clear()"/> 1054 1055 <div class="csdishes__content"> 1056 1057 <cartMultiCart 1058 :cart="cart" 1059 :loc="loc" 1060 :mobile="mobile" 1061 @navigate="onNavigate"/> 1062 1063 <cartClosed :cart="cart"/> 1064 1065 1066 <cartDelivery 1067 :cart="cart" 1068 :company="company" 1069 :address="address" 1070 :useExpressDelivery="useExpressDelivery" 1071 :isKiosk="isKiosk" 1072 :loc="loc" 1073 @loading="onLoading"/> 1074 1075 <cartAddress 1076 :company="company" 1077 :address="address" 1078 :useExpressDelivery="useExpressDelivery" 1079 :loc="loc"/> 1080 1081 <cartBanner :address="address"/> 1082 1083 <cartPromoGrade 1084 :cart="cart" 1085 :loc="loc" 1086 :company="company" 1087 mode="cart" 1088 @picked="onGiftPicked" 1089 @navigate="onNavigate"/> 1090 1091 <cartDishes 1092 :cart="cart" 1093 :loc="loc" 1094 :company="company" 1095 :cart-loading="cartLoading" 1096 :mobile="mobile" 1097 :ui="ui" 1098 @navigate="onNavigate"/> 1099 1100 <cartExtraDishes 1101 :cart="cart" 1102 :loc="loc" 1103 :mobile="mobile" 1104 :company="company" 1105 @navigate="onNavigate"/> 1106 1107 <kioskPayment 1108 v-if="isKiosk && !isSingleKioskPayment" 1109 :cart="cart" 1110 :loc="loc" 1111 @navigate="onNavigate"/> 1112 1113 <cartPriority 1114 :cart="cart" 1115 :address="address" 1116 :loc="loc" 1117 @navigate="onNavigate"/> 1118 1119 <cartOptions 1120 :cart="cart" 1121 :company="company" 1122 :loc="loc" 1123 :isKiosk="isKiosk" 1124 :ui="ui" 1125 :mobile="mobile" 1126 @navigate="onNavigate"/> 1127 1128 <cartTip 1129 :cart="cart" 1130 :loc="loc" 1131 :company="company" 1132 @navigate="onNavigate"/> 1133 1134 <cartSummary 1135 :cart="cart" 1136 :loc="loc" 1137 :company="company" 1138 :address="address" 1139 :ui="ui" 1140 :user="user" 1141 @navigate="onNavigate"/> 1142 </div> 1143 1144 <cartFooter :text="submitText" 1145 :cart-loading="cartLoading" 1146 :cart="cart" 1147 :company="company" 1148 :loading="isSubmitting" 1149 @submit="onSubmit()"/> 1150</div> 1151`};app.cartScreenEmptyIconComponent={template:` 1152 <svg viewBox="0 0 65 65" aria-hidden="true"> 1153 <g class="cemptyIcon__box"> 1154 <rect x="-20.35" y="-23" width="40.69" height="38.92" rx="7.08" fill="#c5c5c5"/> 1155 <rect x="-22.12" y="-15.92" width="44.23" height="38.92" rx="7.08" fill="#919191"/> 1156 <path class="cemptyIcon__smile" 1157 fill="#fff" 1158 fill-rule="evenodd" 1159 d="M9.73-3.54C9.73 1.84 5.37 6.19 0 6.19C-5.37 6.19-9.73 1.84-9.73-3.54V-4.42C-9.73-5.4-8.94-6.19-7.96-6.19C-6.98-6.19-6.19-5.4-6.19-4.42V-3.54C-6.19-.12-3.42 2.65 0 2.65C3.42 2.65 6.19-.12 6.19-3.54V-4.42C6.19-5.4 6.98-6.19 7.96-6.19C8.94-6.19 9.73-5.4 9.73-4.42Z"/> 1160 </g> 1161 </svg> 1162 `};app.cartScreenEmptyComponent={components:{'cart-header':app.cartHeaderComponent,cartScreenEmptyIcon:app.cartScreenEmptyIconComponent,cartMultiCart:app.cartMultiCartComponent,},inject:['store'],props:['loc','cart','mobile'],data:function(){return{animation:null,}},computed:{locTitle(){if(this.cart&&this.cart.multiCarts&&this.cart.multiCarts.carts.length>0){return this.loc['tab/cart']} 1163return''},title(){return this.loc['cart/empty/title']},text:function(){return this.loc['cart/empty/hint']},go:function(){return this.loc['cart/empty/go']},},methods:{close(){this.$emit('navigate',{type:'close'})},navigate(){this.close();if(location.hostname.includes('qr')){return} 1164if(location.pathname&&location.pathname.length>1){location.href='/'}},onNavigate(params){this.$emit('navigate',params)}},template:` 1165 <div class="cempty"> 1166 1167 <cart-header :title="locTitle" 1168 @back="close()"/> 1169 1170 <cartMultiCart 1171 :cart="cart" 1172 :loc="loc" 1173 :mobile="mobile" 1174 @navigate="onNavigate"/> 1175 1176 <div class="cempty__content"> 1177 1178 1179 <cartScreenEmptyIcon class="cempty__animation"/> 1180 1181 <div class="cempty__title">{{title}}</div> 1182 <div class="cempty__text" v-html="text"></div> 1183 <div class="cempty__button" @click="navigate()" v-press>{{go}}</div> 1184 1185 </div> 1186 </div> 1187 `};app.cartScreenWaitingComponent={components:{'cart-header':app.cartHeaderComponent,},inject:['store'],props:['loc','cart','pendingOrderId'],data(){return{pollTimer:null,waitingSince:0,timedOut:!1,}},computed:{title(){return this.loc[this.timedOut?'cart/waiting/timeoutTitle':'cart/waiting/title']},text(){return this.loc[this.timedOut?'cart/waiting/timeout':'cart/waiting/text']},toHistory(){return this.loc['cart/waiting/toHistory']},},mounted(){this.waitingSince=Date.now();this.checkPayment();this.pollTimer=setInterval(this.checkPayment,10000)},beforeUnmount(){this.stopPolling()},beforeDestroy(){this.stopPolling()},methods:{stopPolling(){if(this.pollTimer){clearInterval(this.pollTimer);this.pollTimer=null}},checkPayment(){if(Date.now()-this.waitingSince>10*60*1000){this.stopPolling();this.timedOut=!0;return} 1188this.$emit('navigate',{type:'checkPayment',orderId:this.pendingOrderId,})},goToHistory(){this.$emit('navigate',{type:'showOrderDetails',orderId:this.pendingOrderId,})},close(){this.$emit('navigate',{type:'close'})},},template:` 1189 <div class="cwaiting"> 1190 <cart-header @back="close()"/> 1191 <div class="cwaiting__content"> 1192 <svg v-if="!timedOut" class="cwaiting__animation" viewB
1192ox="0 0 325 325" aria-hidden="true"> 1193 <g transform="translate(162.18 172.18)"> 1194 <g class="cwaiting__pulse"> 1195 <g fill="none" stroke="currentColor" stroke-width="14" stroke-linecap="round" stroke-linejoin="round"> 1196 <rect x="-92.66" y="-60.23" width="185.31" height="120.45" rx="18.53"/> 1197 <path d="M-92.66 -23.16H92.66M-62.94 33.55H-44.4"/> 1198 </g> 1199 <g transform="translate(76.75 51.75) rotate(-90)"> 1200 <circle class="cwaiting__disk" r="32.75"/> 1201 <circle class="cwaiting__arc cwaiting__arc--halo" r="32.75" stroke-width="26"/> 1202 <circle class="cwaiting__arc" r="32.75" stroke-width="14"/> 1203 </g> 1204 </g> 1205 </g> 1206 </svg> 1207 <div class="cwaiting__title">{{ title }}</div> 1208 <div class="cwaiting__text">{{ text }}</div> 1209 <div v-if="timedOut" class="cwaiting__button" @click="goToHistory()" v-press>{{ toHistory }}</div> 1210 </div> 1211 </div> 1212 `};app.cartScreenClearComponent={components:{cartHeader:app.cartHeaderComponent,},inject:['store'],props:['loc'],computed:{title(){return this.loc['cart/clear']},locClear(){return this.loc['site/cart/clear/yes']},locCancel(){return this.loc['site/cart/clear/cancel']}},methods:{clear(){this.$emit('navigate',{type:'clear'})},cancel(){this.$emit('navigate',{type:'screen',name:'dishes'})}},template:` 1213 <div class="cClear"> 1214 1215 <cartHeader title="" 1216 @back="cancel"/> 1217 1218 <div class="cClear__content"> 1219 1220 <svg class="cClear__ico" width="82" height="74" viewBox="0 0 82 74" fill="none"> 1221 <path d="M74.3333 28.667L68.1437 59.6152C67.3801 63.4332 66.9983 65.3423 66.0015 66.7702C65.1225 68.0294 63.9126 69.0213 62.5055 69.6363C60.9098 70.3337 58.9629 70.3337 55.0693 70.3337H26.9307C23.0371 70.3337 21.0902 70.3337 19.4945 69.6363C18.0874 69.0213 16.8775 68.0294 15.9985 66.7702C15.0017 65.3423 14.6199 63.4332 13.8563 59.6152L7.66667 28.667M3.5 28.667H78.5M24.3333 41.167V41.2087M57.6667 41.167V41.2087M16 28.667L28.5 3.66699M66 28.667L53.5 3.66699" stroke="currentColor" stroke-width="5.46667" stroke-linecap="round" stroke-linejoin="round"/> 1222 </svg> 1223 1224 <div class="cClear__title">{{title}}</div> 1225 <div class="cClear__button cClear__button--yes" @click="clear" v-press>{{locClear}}</div> 1226 <div class="cClear__button cClear__button--no" @click="cancel" v-press>{{locCancel}}</div> 1227 1228 </div> 1229 </div> 1230 `};app.cartFormAddressComponent={components:{'zone-hint':app.cartZoneHintComponent},props:['value','cart','loc','address','ui','company'],computed:{...Vuex.mapState(['useExpressDelivery']),currentType(){let currentType=this.address.type;if(currentType==='delivery'&&this.useExpressDelivery&&this.address.isExpress){currentType='express'} 1231return currentType},loading:{get(){return this.value},set(flag){this.$emit('input',flag)},},isVisible(){return this.address.type==='delivery'},delivery(){return this.address.delivery},locAddress(){return this.loc['cart/address']},name(){return this.getAddressName(this.delivery,'full')},},methods:{getAddressName(address,format){if(!address){return''} 1232const loc=this.loc;let name=[];if(address.city){if(['cityStreetHouse','full'].includes(format)){name.push(address.city)}} 1233if(address.district){if(['cityStreetHouse','withoutCity','full','streetHouse'].includes(format)){name.push(address.district)}} 1234if(address.street){if(['cityStreetHouse','withoutCity','full','streetHouse'].includes(format)){const street=address.street.replace('ÑлиÑа','Ñл.').replace('пÑоезд ','пÑ-д ').replace(' пÑоезд',' пÑ-д').replace('пеÑеÑлок','пеÑ.').replace('набеÑежнаÑ','наб.').replace('плоÑадÑ','пл.').replace('ÑоÑÑе','Ñ.').replace('пÑоÑпекÑ','пÑ-Ñ');name.push(street)}} 1235if(address.house){if(['cityStreetHouse','withoutCity','full','streetHouse'].includes(format)){name.push(address.house)}} 1236if(address.buildingName){if(['cityStreetHouse','withoutCity','full','streetHouse'].includes(format)){name.push(address.buildingName)}} 1237if(address.block){if(['cityStreetHouse','withoutCity','full','streetHouse'].includes(format)){name.push(address.block)}} 1238if(address.flat){if(['withoutCity','full'].includes(format)){let locApartment=loc['cart/address/room'];if(address.type&&address.type==='office'){locApartment=loc['address/office']} 1239name.push(locApartment.toLowerCase()+' '+address.flat)}} 1240if(address.entrance){if(['withoutCity','full'].includes(format)){let locEntrance=loc['cart/address/entrance'];if(address.type&&address.type==='office'){locEntrance=loc['address/officeEntrance']}
1240 1241name.push(locEntrance.toLowerCase()+' '+address.entrance)}} 1242if(address.floor){if(['withoutCity','full'].includes(format)){name.push(loc['cart/address/floor'].toLowerCase()+' '+address.floor)}} 1243if(address.intercom){if(['withoutCity','full'].includes(format)){let locIntercom=loc['address/intercom'];name.push(locIntercom.toLowerCase()+' '+address.intercom)}} 1244if(!name.length){return address.name} 1245name=name.join(', ');name=name.substr(0,1).toUpperCase()+name.substr(1);return name},navigateAddresses(){PubSub.publish('showUserAddress',{type:this.currentType,refScreen:'cart'})},},template:` 1246 <div v-if="isVisible" class="cAddr"> 1247 1248 <div class="cAddr__container" 1249 :class="{'cAddr__container--fill': name}" 1250 @click="navigateAddresses()"> 1251 1252 <div class="cAddr__label">{{locAddress}}</div> 1253 <div v-if="name" class="cAddr__name">{{name}}</div> 1254 1255 <div v-if="delivery.comment && ui.isShowAddressComment"" class="cAddr__comment"> 1256 <svg class="cAddr__iconComment" width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 1257 <path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 0C0.223858 0 0 0.223858 0 0.5V9C0 9.55228 0.447715 10 1 10H4.58579L3.66988 10.9159C3.47462 11.1112 3.47462 11.4277 3.66988 11.623C3.86515 11.8183 4.18173 11.8183 4.37699 11.623L6.14645 9.85355C6.34171 9.65829 6.34171 9.34171 6.14645 9.14645C6.1463 9.1463 6.14616 9.14616 6.14602 9.14602C6.14361 9.14351 6.14118 9.14103 6.13871 9.13856L4.36925 7.3691C4.17399 7.17384 3.85741 7.17384 3.66215 7.3691C3.46688 7.56436 3.46689 7.88095 3.66215 8.07621L4.58594 9H1L1 0.5C1 0.223858 0.776142 0 0.5 0Z" fill="currentColor"/> 1258 </svg> 1259 {{delivery.comment}} 1260 </div> 1261 1262 <zone-hint 1263 :company="company" 1264 :address="address" 1265 :cart="cart" 1266 class="cAddr__zoneHint"/> 1267 </div> 1268 1269 1270 </div> 1271 `};app.cartRestaurantComponent={components:{cartAddress:app.cartDishesAddressComponent,},props:['address','company','loc'],computed:{isVisible(){return app.isPointDeliveryType(this.address.type)},},template:` 1272 <cartAddress v-if="isVisible" 1273 :company="company" 1274 :address="address" 1275 :loc="loc" 1276 class="restaurant__address"/> 1277 `};app.cartInsideComponent={components:{commonInput:app.commonInputComponent,},props:['loc','cart','address','company'],data(){return{localTable:''}},computed:{isVisible(){if(this.company.cartEatInTableNumberHidden){return!1} 1278return this.address.type==='inside'&&!this.cart.stadium},table:{get(){return this.localTable},set(table){const clean=String(table).replace(/\D/g,'').slice(0,3);this.localTable=clean;this.cart.inside.tableNumber=clean;this.$emit('navigate',{type:'recalc'})}},},created(){const tableFromUrl=this.extractTableNumberFromUrl();if(tableFromUrl&&tableFromUrl!==this.cart.inside.tableNumber){this.table=tableFromUrl;return} 1279this.localTable=this.cart.inside.tableNumber||''},methods:{extractTableNumberFromUrl(){const tableNumberMatch=window.location.href.match(/&t=(\d+)/);return tableNumberMatch?tableNumberMatch[1]:null},},template:` 1280 <div v-if="isVisible" class="inside"> 1281 1282 <commonInput v-model="table" 1283 :caption="loc['cart/table']" 1284 inputmode="numeric" 1285 maxlength="3" 1286 name="numberTable"/> 1287 1288 </div> 1289 `};app.cartDriveComponent={components:{commonInput:app.commonInputComponent},props:['cart','loc','company','address'],data(){const drive=(this.cart&&this.cart.drive)||{};const brandOn=!!(this.company&&this.company.cartDriveCarBrandVisible);let carNumber=drive.carNumber||'';let carBrand=drive.carBrand||'';if(!carNumber&&!carBrand){const combined=drive.car||'';if(brandOn){const space=combined.indexOf(' ');carNumber=space===-1?combined:combined.slice(0,space);carBrand=space===-1?'':combined.slice(space+1).trim()}else{carNumber=combined}} 1290return{carNumber,carBrand,numberFocused:!1}},computed:{isVisible(){return this.address.type==='drive'},isBrandVisible(){return!!this.company.cartDriveCarBrandVisible},carNumberSlots(){return this.company.cartDriveCarNumberSlots||''},carNumberExample(){return this.company.cartDriveCarNumberExample||''},numberMaxLength(){return this.isBrandVisible?(this.carNumberSlots.length||null):null},locNumberTitle(){return this.isBrandVisible?this.loc['cart/carNumber']:this.loc['cart/car']},locBrandTitle(){return this.loc['cart/carBrand']}},methods:{onFocusIn(event){if(event.target&&event.target.name==='carNumber'){this.numberFocused=!0}},onFocusOut(event){if(event.target&&event.target.name==='carNumber'){this.numberFocused=!1}},onInput(){this.carNumber=this.maskCarNumber(this.carNumber);if(this.isBrandVisible){const number=(this.carNumber||'').trim();const brand=(this.carBrand||'').trim();
1290this.cart.drive.car=[number,brand].filter(Boolean).join(' ');this.cart.drive.carNumber=number;this.cart.drive.carBrand=brand}else{const value=(this.carNumber||'').trim();const space=value.indexOf(' ');this.cart.drive.car=value;this.cart.drive.carNumber=space===-1?value:value.slice(0,space);this.cart.drive.carBrand=space===-1?'':value.slice(space+1).trim()} 1291this.$emit('navigate',{type:'recalc'})},maskCarNumber(value){if(!this.carNumberSlots){return value} 1292if(this.isBrandVisible){return this.applySlots(value)} 1293const space=value.indexOf(' ');if(space===-1){return this.applySlots(value)} 1294return this.applySlots(value.slice(0,space))+' '+value.slice(space+1)},applySlots(value){const slots=this.carNumberSlots;return value.toUpperCase().split('').reduce((result,char)=>{if(result.length>=slots.length){return result} 1295const allowed=slots[result.length]==='D'?/[0-9]/:/[A-ZÐ-ЯÐ]/;return allowed.test(char)?result+char:result},'')}},template:` 1296 <div v-if="isVisible" class="drive" @focusin="onFocusIn" @focusout="onFocusOut"> 1297 1298 <commonInput v-model="carNumber" 1299 :caption="locNumberTitle" 1300 name="carNumber" 1301 :maxlength="numberMaxLength" 1302 :placeholder="numberFocused ? carNumberExample : ''" 1303 @input="onInput"/> 1304 1305 <commonInput v-if="isBrandVisible" 1306 v-model="carBrand" 1307 :caption="locBrandTitle" 1308 name="carBrand" 1309 @input="onInput"/> 1310 1311 </div> 1312 `};app.cartClientComponent={components:{commonInput:app.commonInputComponent,},props:['cart','loc','company','address'],data(){return{name:'',phone:''}},mounted(){this.name=this.cart.client.name;this.phone=this.cart.client.phone},computed:{isVisible(){if(this.company.qrMenu&&this.address.type==='inside'){return!this.company.cartHidePhoneInQr} 1313return!this.company.isAirport},useCartAuth(){return this.cart&&this.cart.client&&this.cart.client.useCartAuth},locName(){return this.loc['cart/yourname']},locPhone(){return this.loc['cart/yourphone']},isPhoneReadOnly(){if(this.useCartAuth){return!0} 1314return this.company.userSubscriptionIsRequired}},methods:{onInput(){this.cart.client.name=this.name;if(!this.isPhoneReadOnly){this.cart.client.phone=this.phone} 1315this.$emit('navigate',{type:'recalc'})},onPhoneClick(){if(this.isPhoneReadOnly){this.$emit('navigate',{type:'AUTH_REQUIRED',})}}},template:` 1316 <div v-if="isVisible" class="cclient"> 1317 1318 <commonInput v-model="name" 1319 :caption="locName" 1320 name="name" 1321 maxlength="30" 1322 @input="onInput"> 1323 <svg class="cclient__ico" width="13" height="13" viewBox="0 0 13 13" fill="none"> 1324 <path d="M1.46647 9.92667C1.46647 9.92667 4.31912 9.19339 4.72147 8.39552C4.90449 8.03034 4.72357 7.56259 4.5405 7.24083C4.45668 7.12845 4.375 7.00915 4.29605 6.88262V6.88123C3.81967 6.12143 3.45644 5.11849 3.41942 3.87961C3.36358 2.01704 4.80605 0.504225 6.51728 0.5H6.52148H6.52497C8.2362 0.504225 9.67862 2.01704 9.62274 3.87961C9.58573 5.11858 9.22249 6.12143 8.74683 6.88123L8.74607 6.88262C8.66712 7.00906 8.5854 7.12845 8.50162 7.24083C8.3186 7.5625 8.137 8.0303 8.32141 8.39552C8.72233 9.19335 11.5764 9.92667 11.5764 9.92667C12.1254 10.1093 12.5215 10.6289 12.5215 11.24V11.4091C12.5215 12.0116 12.0331 12.5 11.4306 12.5H1.61239C1.0099 12.5 0.521484 12.0116 0.521484 11.4091V11.24C0.521395 10.6289 0.916725 10.1093 1.46647 9.92667Z" fill="currentColor"/> 1325 </svg> 1326 </commonInput> 1327 1328 <commonInput v-if="useCartAuth" 1329 v-model="cart.client.phone" 1330 :caption="locPhone" 1331 @input="onInput" 1332 @inputClicked="onPhoneClick" 1333 type="tel" 1334 name="phone" 1335 :readonly="isPhoneReadOnly"> 1336 <svg class="cclient__ico" width="12" height="13" viewBox="0 0 12 13" fill="none"> 1337 <path d="M1.76724 8.85232C2.47379 8.23222 3.19283 7.8554 3.89046 8.4755L4.30797 8.84866C4.61307 9.12122 5.18045 10.3907 7.37325 7.80235C9.56605 5.2195 8.26179 4.81708 7.9549 4.54818L7.53561 4.1732C6.84155 3.55309 7.10383 2.77202 7.6052 1.96717L7.90673 1.48059C8.40988 0.6794 8.95942 0.152586 9.65526 0.77086L10.0317 1.10926C10.3404 1.33792 11.2004 2.08606 11.4091 3.50553C11.6607 5.20853 10.8667 7.1603 9.0522 9.30048C7.23943 11.4425 5.46235 12.5181 3.78162 12.4998C2.38458 12.4833 1.53886 11.715 1.2748 11.4352L0.898329 11.0968C0.202484 10.4785 0.634264 9.84741 1.3426 9.22731L1.76724 8.85232Z" fill="currentColor"/> 1338 </svg> 1339 </commonInput> 1340 1341 1342 <commonInput v-else 1343 v-model="phone" 1344 :caption="locPhone"
1345 @input="onInput" 1346 type="tel" 1347 name="phone" 1348 :readonly="isPhoneReadOnly"> 1349 <svg class="cclient__ico" width="12" height="13" viewBox="0 0 12 13" fill="none"> 1350 <path d="M1.76724 8.85232C2.47379 8.23222 3.19283 7.8554 3.89046 8.4755L4.30797 8.84866C4.61307 9.12122 5.18045 10.3907 7.37325 7.80235C9.56605 5.2195 8.26179 4.81708 7.9549 4.54818L7.53561 4.1732C6.84155 3.55309 7.10383 2.77202 7.6052 1.96717L7.90673 1.48059C8.40988 0.6794 8.95942 0.152586 9.65526 0.77086L10.0317 1.10926C10.3404 1.33792 11.2004 2.08606 11.4091 3.50553C11.6607 5.20853 10.8667 7.1603 9.0522 9.30048C7.23943 11.4425 5.46235 12.5181 3.78162 12.4998C2.38458 12.4833 1.53886 11.715 1.2748 11.4352L0.898329 11.0968C0.202484 10.4785 0.634264 9.84741 1.3426 9.22731L1.76724 8.85232Z" fill="currentColor"/> 1351 </svg> 1352 </commonInput> 1353 1354 </div> 1355 `};app.merchantTypeComponent={props:['type','cart','loc','company','user'],computed:{isCard(){return!!this.type.info},brand(){return(this.type.info&&this.type.info.brand)||''},prefix(){const first6=this.type.info&&this.type.info.first6;return String(first6||'').substring(0,4)},last4(){const value=this.type.info&&this.type.info.last4;return/^\d{4}$/.test(value)?value:''},name(){if(this.type.name){return this.type.name} 1356return this.last4||this.loc['cart/onlinePayment/savedCard']},removeButtonVisible(){return this.type.info&&this.company.id!==1068},},methods:{selectType(){if(this.type.id==='new'&&this.type.useAddCardForm){this.user?this.addCard():PubSub.publish('showLoginModalWindow');this.$emit('select')}else{this.cart.merchant.activeType=this.type.id;this.$emit('navigate',{type:'recalc'});this.$emit('select')}},addCard(){this.$emit('navigate',{type:'recalc',addCard:!0,cb:()=>{const url=this.cart.merchant.addCardUrl;if(!url){return} 1357app.viewer({bgClose:!0,class:'mType__aPay',html:`<iframe src="${url}" width="100%" height="100%" frameborder="0"></iframe>`,onClose:()=>{this.$emit('navigate',{type:'recalc',checkCard:!0})}})}})},confirmRemove(){if(!window.confirm(this.loc['cart/onlinePayment/deleteCard'])){return} 1358this.removeType(this.type.id)},removeType(id){app.fetch('/merchant/card/remove',{id},(response)=>{this.$emit('navigate',{type:'recalc'})})}},template:` 1359 <div class="mType cInput__option" 1360 @mousedown.prevent 1361 @click="selectType()"> 1362 1363 <div class="mType__container"> 1364 1365 <template v-if="isCard"> 1366 <span class="cmtype__brand" 1367 :class="'cmtype__brand--'+brand"></span> 1368 1369 <span v-if="prefix" class="cmtype__prefix">{{prefix}}</span> 1370 1371 <span v-if="prefix" class="cmtype__dots">···</span> 1372 <span v-if="last4" class="cmtype__dots">···</span> 1373 </template> 1374 1375 {{name}} 1376 </div> 1377 1378 <div v-if="removeButtonVisible" 1379 class="mType__delete" 1380 @click.stop="confirmRemove()"> 1381 <svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg"> 1382 <path fill-rule="evenodd" clip-rule="evenodd" d="M7 0C5.34315 0 4 1.34315 4 3H1C0.447715 3 0 3.44772 0 4C0 4.55228 0.447716 5 1 5H13C13.5523 5 14 4.55228 14 4C14 3.44772 13.5523 3 13 3H10C10 1.34315 8.65685 0 7 0ZM7 2C6.44772 2 6 2.44772 6 3H8C8 2.44772 7.55228 2 7 2Z" fill="#B2B2B2"/> 1383 <path fill-rule="evenodd" clip-rule="evenodd" d="M1.19098 6.41221C1 6.67508 1 7.05005 1 7.8V9C1 10.8638 1 11.7956 1.30448 12.5307C1.71046 13.5108 2.48915 14.2895 3.46927 14.6955C4.20435 15 5.13623 15 7 15C8.86377 15 9.79565 15 10.5307 14.6955C11.5108 14.2895 12.2895 13.5108 12.6955 12.5307C13 11.7956 13 10.8638 13 9V7.8C13 7.05005 13 6.67508 12.809 6.41221C12.7473 6.32732 12.6727 6.25266 12.5878 6.19098C12.3249 6 11.9499 6 11.2 6H2.8C2.05005 6 1.67508 6 1.41221 6.19098C1.32732 6.25266 1.25266 6.32732 1.19098 6.41221ZM8.71429 8C8.3198 8 8 8.3198 8 8.71429V11.2857C8 11.6802 8.3198 12 8.71429 12C9.42437 12 10 11.4244 10 10.7143V9.28571C10 8.57563 9.42437 8 8.71429 8ZM4 9.14894C4 8.5144 4.5144 8 5.14894 8C5.61897 8 6 8.38103 6 8.85106V11.1489C6 11.619 5.61897 12 5.14894 12C4.5144 12 4 11.4856 4 10.8511V9.14894Z" fill="#B2B2B2"/> 1384 </svg> 1385 </div> 1386 1387 </div> 1388 `};app.paymentMerchantComponent={components:{commonSelectArrow:app.commonSelectArrowComponent,merchantType:app.merchantTypeComponent,},props:['cart','loc','company','user'],data(){return{isShowList:!1}},computed:{merchantVisible(){return['online','online2'].includes(this.cart.payment.activeType)&&this.cart.merchant&&this.cart.merchant.types&&this.cart.merchant.types.length>0},types(){return this.cart.merchant.types},merchantValue(){const type=this.cart.merchant.types.find((item)=>{return item.id===this.cart.merchant.activeType});if(!type){return this.loc['cart/onlinePayment/pickCard']}
1389if(type.name){return type.name} 1390const info=type.info||{};const prefix=String(info.first6||'').substring(0,4);const last4=/^\d{4}$/.test(info.last4)?info.last4:'';if(!prefix&&!last4){return this.loc['cart/onlinePayment/savedCard']||''} 1391const parts=[`<div class="cpay__brand cpay__brand--${ info.brand || '' }"></div>`,];if(prefix){parts.push(prefix);parts.push('<span class="cpay__dots">···</span>')} 1392if(last4){parts.push('<span class="cpay__dots">···</span>');parts.push(last4)} 1393return parts.join('')},classes(){return{'cInput--fill':this.merchantValue,'cInput--icon':this.hasIcon,'cInput--list':this.isShowList,}},},methods:{onSelectClick(){if(this.isDisabled){this.$refs.label.blur();return} 1394if(this.isShowList){this.$refs.label.blur();return} 1395this.isShowList=!0},onSelectBlur(){this.$nextTick(()=>{this.isShowList=!1})},changeType(type){this.$refs.label.blur()},onNavigate(params){this.$emit('navigate',params)}},template:` 1396 <transition name="spoiler"> 1397 1398 <div v-if="merchantVisible" 1399 class="cInput cInput--select" 1400 :class="classes" 1401 v-spoiler> 1402 1403 <div ref="label" 1404 class="cInput__item pMerchant__input" 1405 tabindex="0" 1406 @click="onSelectClick()" 1407 @blur="onSelectBlur()" v-html="merchantValue"></div> 1408 1409 <commonSelectArrow class="cInput__tick" 1410 :open="isShowList"/> 1411 1412 <transition name="cInput__list"> 1413 <div v-if="isShowList" 1414 class="cInput__list"> 1415 <div class="cInput__container"> 1416 1417 <merchantType v-for="type in types" 1418 :key="type.id" 1419 class="cInput__option" 1420 :type="type" 1421 :cart="cart" 1422 :loc="loc" 1423 :company="company" 1424 :user="user" 1425 @select="changeType(type)" 1426 @navigate="onNavigate"/> 1427 1428 </div> 1429 </div> 1430 </transition> 1431 1432 </div> 1433 1434 </transition> 1435 `};app.cartPayment2Component={components:{commonInput:app.commonInputComponent,paymentMerchant:app.paymentMerchantComponent,},props:['cart','address','loc','company','user'],data(){return{email:(this.cart&&this.cart.email)||'',oddmoney:(this.cart&&this.cart.payment&&this.cart.payment.oddmoney)||'',}},computed:{types(){return Object.values(this.cart.payment.types).map((type)=>!type.off&&type).filter(Boolean)},activeType:{get(){return this.cart.payment.activeType},set(id){if(this.cart.payment.activeType===id){return} 1436if(id!=='cash'){this.oddmoney='';this.cart.payment.oddmoney=''} 1437this.cart.payment.activeType=id;this.$emit('navigate',{type:'recalc'});PubSub.publish('syncPreorderDays')}},oddmoneyVisible(){return this.activeType==='cash'&&this.cart.company.oddmoney&&this.address.type==='delivery'},isCardIcon(){return this.activeType&&this.activeType!=='cash'},isKaspi(){if(!this.activeType){return} 1438const kaspi=this.cart.payment.types.kaspiSecondary;const onlineType=kaspi&&!kaspi.off?'kaspiSecondary':'online';return this.activeType===onlineType&&this.company.cartOnlineButtonAppearance==='kaspi'},exactCash:{get(){return this.cart.payment.exactCash},set(flag){this.$set(this.cart.payment,'exactCash',flag);if(flag){this.oddmoney=''} 1439this.$emit('navigate',{type:'recalc'})}},emailVisible(){if(this.company.showEmailInCart){return this.company.showEmailInCart&&this.activeType} 1440return this.company.cartEmailAppearance==='onlinePaymentOnly'&&['online','online2'].includes(this.activeType)}},methods:{onInputEmail(){this.cart.email=this.email;this.$emit('navigate',{type:'recalc'})},onInputOddmoney(){this.cart.payment.oddmoney=this.oddmoney;this.$emit('navigate',{type:'recalc'})},onNavigate(params){this.$emit('navigate',params)}},directives:{spoiler:{inserted(el){el.style.height=el.scrollHeight+'px'},componentUpdated(el){el.style.height=el.scrollHeight+'px'},},},template:` 1441 <div class="cPay"> 1442 1443 <commonInput v-model="activeType" 1444 type="select" 1445 :caption="loc['common/paymentMethod']" 1446 :options="types"> 1447 1448 <transition name="cPay__fade" mode="out-in"> 1449 <svg v-if="isKaspi" 1450 :key="0" 1451 class="cPay__kaspiIcon" 1452 width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> 1453 <path fill-rule="evenodd" clip-rule="evenodd" d="M7.00956 0C3.13233 0 0 3.12366 0 6.95207C0 9.27577 1.16508 11.3519 2.92224 12.6089C2.96043 12.5518 2.99862 12.4185 3.03684 12.2852V12.228C3.20873 11.4852 3.24693 10.7805 3.17054 9.94241C3.11323 9.42815 3.03684 9.14244 2.96043 8.87578C2.88404 8.59009 2.82673 8.34247 2.82673 7.96154C2.82673 7.61869 2.90314 7.37109 2.97953 7.12348C3.07503 6.83777 3.17054 6.49495 3.18964 5.92353C3.22783 4.81882 3.34243 4.53313 3.66712 4.20934C3.99182 3.88555 4.10642 3.75222 4.10642 3.52365C4.10642 3.47393 4.09196 3.40889 4.07483 3.33187C4.01323 3.0548 3.91713 2.62259 4.3356 2.19037C4.71761 1.84753 5.06139 1.71421 5.3097 1.71421C5.44337 1.71421 5.55798 1.7523 5.61527 1.82849C5.78718 2.01896 5.74897 2.3618 5.38608 2.83798C5.0423 3.31413 5.0423 3.52365 5.06139 3.63792C5.08049 3.75222 5.19509 3.90458 5.40518 4.05696C5.43353 4.08168 5.46317 4.10642 5.4934 4.13162C5.62621 4.24237 5.77023 4.36247 5.86357 4.53313C6.04494 4.84962 6.15453 5.15419 6.28703 5.52234C6.32196 5.61945 6.35849 5.72097 6.39837 5.82831L6.45566 5.98067C6.60846 6.43779 7.04775 6.59017 7.79264 6.59017C8.53753 6.59017 9.33971 6.09497 9.33971 5.71403C9.33971 5.51582 9.29834 5.41043 9.25866 5.30933C9.22206 5.21609 9.18691 5.12652 9.18691 4.9712C9.18691 4.6474
14531 9.6644 3.71411 10.3902 3.71411C10.7531 3.71411 10.9632 3.98077 10.7722 4.3617C10.7153 4.48136 10.6376 4.61976 10.559 4.75967C10.4 5.04293 10.2374 5.33247 10.2374 5.48546C10.2374 5.9045 10.8677 5.58071 11.2688 5.25691C11.6699 4.9331 11.7654 4.83787 12.0518 4.34267C12.2237 4.03791 12.472 3.98077 12.6248 4.05696C12.7967 4.15218 12.9113 4.41884 12.7585 4.78074C12.6248 5.06642 12.281 5.44738 11.9182 5.84734C11.9008 5.86674 11.8833 5.88621 11.8658 5.90575C11.8524 5.92067 11.8389 5.93563 11.8255 5.95063C11.3719 6.45555 10.8868 6.99554 10.8868 7.35203C10.8868 9.29482 11.9945 11.009 12.1091 11.1804C12.2237 11.3709 12.3001 11.428 12.3383 11.4471C13.3697 10.2471 14 8.68532 14 6.9711V6.91397C14 3.10461 10.8677 0 7.00956 0ZM9.16722 13.3072C9.10993 13.4405 8.93802 13.5738 8.70883 13.6881C8.15493 13.8214 7.58194 13.8976 6.98987 13.9167H6.79886C6.55058 13.8405 6.37868 13.7262 6.28318 13.5738C5.99668 13.0786 5.97758 11.9929 5.97758 10.7168V10.3549L5.97752 10.2131C5.97684 8.99749 5.97627 7.9592 6.43598 7.57411C6.60787 7.42173 6.87527 7.36459 7.21906 7.42173C8.55603 7.61219 8.67064 8.43122 8.76612 9.15499L8.78522 9.23118L8.86163 9.63115C8.87125 9.69671 8.88182 9.76804 8.89308 9.84421C9.01617 10.6753 9.22451 12.0823 9.22451 12.8501C9.22451 13.0596 9.20542 13.212 9.16722 13.3072ZM4.46926 10.05C4.73666 10.05 4.90855 11.3833 4.94675 12.4118C4.98496 13.1356 4.90855 13.4213 4.77485 13.5356C4.708 13.507 4.64115 13.4832 4.57432 13.4594C4.50747 13.4356 4.44063 13.4118 4.37378 13.3832C4.29737 13.2118 4.22098 12.9642 4.18276 12.6404C4.06818 11.6118 4.18276 10.069 4.46926 10.05ZM10.1998 10.2165C10.6582 10.007 11.4795 11.8545 11.4031 12.1783C11.3967 12.2037 11.3882 12.2291 11.3797 12.2545C11.3628 12.3053 11.3458 12.3561 11.3458 12.4069C11.0975 12.5974 10.8301 12.7688 10.5627 12.9211C10.4672 12.9402 10.3908 12.9211 10.3526 12.864C9.9897 12.2736 9.856 10.3879 10.1998 10.2165Z" fill="#F14635"/> 1454 </svg> 1455 1456 <svg v-else-if="!activeType || !isCardIcon" 1457 key="1" 1458 class="cPay__cashIcon" 1459 :class="{'cPay__cashIcon--active': activeType && !isCardIcon}" 1460 width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"> 1461 <path fill-rule="evenodd" clip-rule="evenodd" d="M9.3548 2.71048L8.20484 0.740437C8.15013 0.646729 8.06022 0.578479 7.95513 0.551395C7.85059 0.525395 7.73847 0.540562 7.6453 0.596354L4.12988 2.7056L9.3548 2.71048ZM1.625 3.2526C1.32708 3.2526 1.08333 3.00885 1.08333 2.71094C1.08333 2.41302 1.32708 2.16927 1.625 2.16927H3.45042L5.25958 1.08594H1.625C0.823333 1.08594 0.157083 1.67094 0.0270833 2.4401C0.0245517 2.45023 0.0217243 2.46036 0.0188776 2.47055C0.00954257 2.50399 0 2.53816 0 2.57552V10.8359C0 11.7297 0.73125 12.4609 1.625 12.4609H10.8333C11.4292 12.4609 11.9167 11.9734 11.9167 11.3776V10.2943H10.5625C9.21917 10.2943 8.125 9.2001 8.125 7.85677C8.125 6.51344 9.21917 5.41927 10.5625 5.41927H11.9167V4.33594C11.9167 3.7401 11.4292 3.2526 10.8333 3.2526H1.625ZM10.2917 2.16927C10.2917 1.62219 9.88542 1.16719 9.35458 1.09677L10.2917 2.71094V2.16927ZM10.5625 6.22656H12.5938C12.818 6.22656 13 6.40856 13 6.63281V9.07031C13 9.29456 12.818 9.47656 12.5938 9.47656H10.5625C9.66658 9.47656 8.9375 8.74748 8.9375 7.85156C8.9375 6.95565 9.66658 6.22656 10.5625 6.22656ZM10.0208 7.85156C10.0208 8.15056 10.2635 8.39323 10.5625 8.39323C10.8615 8.39323 11.1042 8.15056 11.1042 7.85156C11.1042 7.55256 10.8615 7.3099 10.5625 7.3099C10.2635 7.3099 10.0208 7.55256 10.0208 7.85156Z" fill="currentColor"/> 1462 </svg> 1463 1464 <svg v-else key="2" width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"> 1465 <path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.11929 1.07452 0 2.4 0H9.6C10.9255 0 12 1.11929 12 2.5V2.8125C12 2.98509 11.8657 3.125 11.7 3.125H0.3C0.134316 3.125 0 2.98509 0 2.8125V2.5ZM0.3 4.375C0.134316 4.375 0 4.51494 0 4.6875V7.5C0 8.88069 1.07452 10 2.4 10H9.6C10.9255 10 12 8.88069 12 7.5V4.6875C12 4.51494 11.8657 4.375 11.7 4.375H0.3ZM6.6 6.875C6.6 6.52981 6.86862 6.25 7.2 6.25H9C9.33138 6.25 9.6 6.52981 9.6 6.875C9.6 7.22019 9.33138 7.5 9 7.5H7.2C6.86862 7.5 6.6 7.22019 6.6 6.875Z" fill="#19AA2F"/> 1466 </svg> 1467 </transition> 1468 1469 </commonInput> 1470 1471 <transition name="spoiler">
1472 <commonInput v-if="oddmoneyVisible && !exactCash" 1473 v-model="oddmoney" 1474 inputmode="decimal" 1475 :caption="loc['cart/oddmoney']" 1476 @input="onInputOddmoney" 1477 v-spoiler/> 1478 </transition> 1479 1480 <transition name="spoiler"> 1481 <commonInput v-if="oddmoneyVisible" 1482 v-model="exactCash" 1483 type="checkbox" 1484 :caption="loc['cart/payment/noChangeNeeded']" 1485 v-spoiler/> 1486 </transition> 1487 1488 <transition name="spoiler"> 1489 <commonInput v-if="emailVisible" 1490 v-model="email" 1491 caption="Email" 1492 inputmode="email" 1493 @input="onInputEmail()" 1494 v-spoiler/> 1495 </transition> 1496 1497 <paymentMerchant 1498 :cart="cart" 1499 :loc="loc" 1500 :company="company" 1501 :user="user" 1502 @navigate="onNavigate"/> 1503 1504 </div> 1505 `};app.timeframeSpinnerComponent={props:['loading'],template:` 1506<transition name="timeSpinner"> 1507 <div v-if="loading" 1508 class="timeSpinner"> 1509 <span class="timeSpinner__dot">.</span> 1510 <span class="timeSpinner__dot">.</span> 1511 <span class="timeSpinner__dot">.</span> 1512 </div> 1513</transition> 1514`};app.preorderDatepickerComponent={props:['days','loc'],computed:{locale(){const loc=this.loc||(this.$store&&this.$store.state&&this.$store.state.loc);if(!loc){return} 1515const daysMin=[];const months=[];for(let i=1;i<=12;i++){i<=7&&daysMin.push(loc['day/'+(i)]);months.push(loc['month/'+i])} 1516daysMin.unshift(daysMin.pop());return{daysMin,months,}},dateRange(){if(!this.days||!this.days.length){return{}} 1517return{min:this.days[0].id,max:this.days[this.days.length-1].id,}},enabledDatesSet(){if(!this.days||!this.days.length){return} 1518return new Set(this.days.map((day)=>day.id))},},mounted(){this.initDatepicker()},beforeDestroy(){if(!this._datepicker){return} 1519this._datepicker.destroy();this._datepicker=null},methods:{initDatepicker:function(){const options={classes:'preorder__datepicker',inline:!0,navTitles:{days:'MMMM',},dateFormat:'yyyy-MM-dd',locale:this.locale,minDate:this.dateRange.min,maxDate:this.dateRange.max,onSelect:({formattedDate})=>{this.$emit('select',formattedDate)},onRenderCell:({date,cellType})=>
1519{if(cellType!=='day'){return} 1520if(!this.enabledDatesSet){return{disabled:!0}} 1521const dateStr=this.formatDateLocal(date);const isEnabled=this.enabledDatesSet.has(dateStr);return{disabled:!isEnabled}},};this._datepicker=new AirDatepicker(this.$refs.datepicker,options)},formatDateLocal(date){const year=date.getFullYear();const month=String(date.getMonth()+1).padStart(2,'0');const day=String(date.getDate()).padStart(2,'0');return `${year}-${month}-${day}`},},template:`<div ref="datepicker" class="pDatepicker"></div>`};app.preorderFieldComponent={components:{commonSelectArrow:app.commonSelectArrowComponent,timeframeSpinner:app.timeframeSpinnerComponent,},props:['value','caption','current','loading','disabled'],computed:{isActive:{get(){return this.value},set(flag){this.$emit('input',flag)}},classes(){return{'pField--fill':this.current,'pField--active':this.isActive,}},},methods:{onClick(){if(this.isActive){this.$refs.field.blur();return} 1522this.isActive=!0},onBlur(){this.isActive=!1},},template:` 1523<div class="pField" 1524 :class="classes"> 1525 1526 <div class="pField__icon"> 1527 <slot></slot> 1528 </div> 1529 1530 <div class="pField__caption">{{ caption }}</div> 1531 1532 <div ref="field" 1533 class="pField__item" 1534 :class="{'pField__item--active': isActive && !disabled}" 1535 tabindex="0" 1536 @click="onClick()" 1537 @blur="onBlur()">{{ current }}</div> 1538 1539 <commonSelectArrow class="pField__tick" 1540 :open="isActive"/> 1541 1542 <timeframeSpinner :loading="loading"/> 1543 1544</div> 1545 `};app.cartPreorderComponent={components:{preorderDatepicker:app.preorderDatepickerComponent,timeframeSpinner:app.timeframeSpinnerComponent,preorderFieldComponent:app.preorderFieldComponent,},props:['cart','loc','address','company'],data(){return{loading:!1,isShow:{date:!1,time:!1},days:null,}},computed:{isVisible(){return this.timeframe.activeType==='preorder'},timeframe(){return this.cart.timeframe},date(){const name=this.timeframe.activeDay&&this.timeframe.activeDay.name;return name||''},time(){if(!this.timeframe.activeTime){return''} 1546return this.timeframe.activeTime.name},captions(){return{date:this.date?this.loc['common/date']:this.loc['common/dateTime'],time:this.loc['common/time'],}},datesHashMap(){return(this.days||[]).reduce((map,day)=>{map[day.id]=day;return map},{})},times(){if(!this.timeframe.activeDay||!this.timeframe.activeDay.id){return[]} 1547const currentDay=this.datesHashMap[this.timeframe.activeDay.id];return currentDay?currentDay.times:[]},isShowTimeField(){return this.date}},mounted(){PubSub.subscribe('syncPreorderDays',()=>{if(!this.days){return} 1548this.days=null})},beforeDestroy(){PubSub.unsubscribe('syncPreorderDays')},methods:{sync(field){if(this.loading||this.days){return} 1549this.loading=field;const isPickupLike=app.isPointDeliveryType(this.address.type);const payload={deliveryMethod:isPickupLike?'pickup':'courier'};app.fetch('/timeframe/get',payload,(response)=>{if(response.error){this.loading=!1;return} 1550this.days=response.days;this.checkTimeframe();this.loading=!1;this.$set(this.isShow,field,!0)})},setDate(dateId){const day=this.datesHashMap[dateId]||{id:null,name:null,};this.timeframe.activeDay={id:day.id,name:day.name};this.timeframe.activeTime=null;this.$emit('navigate',{type:'recalc'});dateId&&document.activeElement&&document.activeElement.blur();this.$set(this.isShow,'date',!1)},setTime(time){this.timeframe.activeTime=time||null;this.$emit('navigate',{type:'recalc'});time&&document.activeElement&&document.activeElement.blur();this.$set(this.isShow,'time',!1)},checkTimeframe(){if(!this.timeframe.activeDay||!this.timeframe.activeDay.id){return} 1551if(!this.datesHashMap[this.timeframe.activeDay.id]){this.setDate();return} 1552if(!this.timeframe.activeTime||!this.timeframe.activeTime.id){return} 1553if(!this.times.find(({id})=>id===this.timeframe.activeTime.id)){this.setTime()}}},template:` 1554<div v-if="isVisible" 1555 class="preorder"> 1556 1557 <div class="preorder__wrapper"> 1558 <preorderFieldComponent v-model="isShow.date" 1559 :caption="captions.date" 1560 :current="date" 1561 :disabled="!days" 1562 :loading="loading === 'date'"
1563 @input="sync('date')"> 1564 <svg class="cIcon__date"> 1565 <use xlink:href="#cIcon__date"></use> 1566 </svg> 1567 </preorderFieldComponent> 1568 <preorderFieldComponent v-if="isShowTimeField" 1569 v-model="isShow.time" 1570 :caption="captions.time" 1571 :current="time" 1572 :disabled="!days" 1573 :loading="loading === 'time'" 1574 @input="sync('time')"> 1575 <svg class="cIcon__time"> 1576 <use xlink:href="#cIcon__time"></use> 1577 </svg> 1578 </preorderFieldComponent> 1579 </div> 1580 1581 <transition name="preorder__dropdown" mode="out-in"> 1582 1583 <div v-if="!loading && isShow.date" 1584 key="0" 1585 class="preorder__dropdown preorder__dropdown--date" 1586 @mousedown.prevent> 1587 <preorderDatepicker 1588 :days="days" 1589 :loc="loc" 1590 @select="setDate"/> 1591 </div> 1592 1593 <div v-else-if="!loading && isShow.time" 1594 key="1" 1595 class="preorder__dropdown"> 1596 <div class="preorder__container"> 1597 <div v-for="time of times" 1598 :key="time.id" 1599 class="preorder__option" 1600 @mousedown.prevent 1601 @click="setTime(time)"> 1602 {{ time.name }} 1603 </div> 1604 </div> 1605 </div> 1606 1607 </transition> 1608 1609</div> 1610 `};app.cartPickupComponent={components:{commonInput:app.commonInputComponent,timeframeSpinner:app.timeframeSpinnerComponent,},props:['cart','address','loc','company'],data(){return{times:null,loading:!1,}},computed:{timeframe(){return this.cart.timeframe},isVisible(){if(this.address.type==='pickup'&&this.address.pickup&&this.address.pickup.slotsActive){return!1} 1611return this.timeframe.activeType==='now'&&!this.timeframe.pickupTimeOff&&app.isPointDeliveryType(this.address.type)},currentTime:{get(){return this.timeframe.activePickupTime},set(timeId){this.timeframe.activePickupTime=timeId;this.timeframe.activePickupTimeName=this.timesNameHashMap[timeId];this.$emit('navigate',{type:'recalc'})}},timesList(){return this.times||[this.timeframe.activePickupTime&&this.timeframe.activePickupTimeName&&{id:this.timeframe.activePickupTime,name:this.timeframe.activePickupTimeName,}].filter(Boolean)},timesNameHashMap(){return this.timesList.reduce((map,time)=>{map[time.id]=time.name;return map},{})}},methods:{onClick(){if(this.times){return} 1612this.sync()},sync(){if(this.loading){return} 1613this.loading=!0;app.fetch('/timeframe/getPickup',{},(response)=>{this.loading=!1;if(response.error){console.error('/timeframe/getPickup',response.error);return} 1614this.times=response.times;this.$nextTick(()=>{if(document.activeElement!==document.body){return} 1615this.$refs.select.$refs.label.click();this.$refs.select.$refs.label.focus()});this.clearList()})},clearList(){setTimeout(()=>{if(!document.contains(this.$el)){return} 1616if(document.activeElement===this.$refs.select.$refs.label){this.clearList();return} 1617this.times=null},300000)}},template:` 1618<div v-if="isVisible" 1619 class="pickup" 1620 @click="onClick()"> 1621 1622 <div class="pickup__select"> 1623 <commonInput ref="select" 1624 v-model="currentTime" 1625 type="select" 1626 :class="{'pickup__inactive': !times}" 1627 :caption="loc['cart/pickup-time']" 1628 :options="timesList"/> 1629 </div> 1630 1631 <timeframeSpinner :loading="loading"/> 1632 1633</div> 1634`};app.cartTimeframeComponent={components:{'cart-preorder':app.cartPreorderComponent,'cart-pickup':app.cartPickupComponent},props:['cart','address','company','ui','loc'],data(){return{deliveryTime:null,}},computed:{isShowNearestDeliveryDate(){return this.ui.isShowNearestDeliveryDate},isVisible(){if(this.company.isAirport){return!1} 1635if(app.isInsideLikeDeliveryType(this.address.type)){if(!this.company.cartEatInPreorderVisible){return!1}} 1636if(this.address.type==='drive'){if(!this.company.cartDrivePreorderVisible){return!1}} 1637return!0},timeframe(){return this.cart.timeframe},types(){var res=[];var types=this.timeframe.types;types=[types.now,types.preorder];for(var i=0;i<types.length;i++){res.push({name:types[i].name,id:types[i].id,off:types[i].off,selected:types[i].id===this.timeframe.activeType})} 1638return res},title(){return this.timeframe.needPreorderMessage},typesVisible(){return!(app.isInsideLikeDeliveryType(this.address.type)||this.timeframe.types.now.off||this.timeframe.types.preorder.off)},isSlotsPolicy(){if(this.address.type==='pickup'){return!!(this.address.pickup&&this.address.pickup.slotsActive)} 1639var zone=this.address.delivery&&this.address.delivery.currentZone;return!!(zone&&zone.restaurantPolicy==='slots')},nearestSlotLabel(){if(!this.isSlotsPolicy||this.timeframe.activeType!=='now'){return null} 1640var day=this.timeframe.activeDay&&this.timeframe.activeDay.name;var time=this.timeframe.activeTime&&this.timeframe.activeTime.name;
1640return[day,time].filter(Boolean).join(', ')||null}},created(){this.isShowNearestDeliveryDate&&this.getDeliveryTime()},methods:{selectType(type){if(!type.off){this.timeframe.activeType=type.id;this.$emit('navigate',{type:'recalc'})}},getDeliveryTime(){app.fetch('/timeframe/getNearestDelivery',{},(response)=>{if(response.error){return} 1641this.deliveryTime=response.message})},onNavigate(params){this.$emit('navigate',params)}},directives:{spoiler:{inserted(el){el.style.height=el.scrollHeight+'px'},update(el){el.style.height=el.scrollHeight+'px'}},},template:` 1642 <div v-if="isVisible" 1643 class="cpre"> 1644 1645 <div v-if="title" class="cpre__title">{{title}}</div> 1646 1647 <div v-if="typesVisible" 1648 class="cpre__types"> 1649 1650 <div v-for="type in types" 1651 @click="selectType(type)" 1652 :key="type.id" 1653 :data-id="type.id" 1654 class="copt" 1655 :class="{'copt--active': type.selected}"> 1656 <div class="copt__caption"> 1657 {{ type.name }} 1658 1659 <transition name="copt__spoiler"> 1660 <div v-if="type.id === 'now' && (nearestSlotLabel || deliveryTime)" 1661 class="copt__sub" 1662 v-spoiler>{{ nearestSlotLabel || deliveryTime }}</div> 1663 </transition> 1664 </div> 1665 </div> 1666 1667 </div> 1668 1669 <cart-pickup 1670 :cart="cart" 1671 :address="address" 1672 :loc="loc" 1673 :company="company" 1674 @navigate="onNavigate"/> 1675 1676 <cart-preorder 1677 :cart="cart" 1678 :loc="loc" 1679 :address="address" 1680 :company="company" 1681 @navigate="onNavigate"/> 1682 1683 </div> 1684 `};app.cartCommentComponent={props:['cart','loc','ui'],data(){return{isFocus:!1,comment:this.cart&&this.cart.comment}},computed:{isVisible(){return!this.ui.isHideOrderComment},maxLength(){return this.$store.state.maxCartCommentLength},caption(){return this.loc['cart/comment']},isActive(){return this.isFocus||this.comment.trim()},blanks(){if(!this.cart.commentSnippets){return null} 1685const commentFormatted=this.comment.toLowerCase();return this.cart.commentSnippets.filter(({name})=>!commentFormatted.includes(name.toLowerCase()))}},mounted(){const icon=this.$refs.icon;const submitObserver=new IntersectionObserver(([e])=>{if(e.intersectionRatio<1){return} 1686this.playIcon();submitObserver.unobserve(icon)},{rootMargin:'0px 0px -100px 0px',threshold:1});submitObserver.observe(icon)},methods:{toggleFocus(flag){this.isFocus=flag;flag&&setTimeout(()=>{this.playIcon()},200)},playIcon(){app.replayAnimation(this.$refs.icon,'commentIco--play',1500)},addBlank(text){if(this.comment.trim().length){this.comment+='\n'}else{this.comment=''} 1687this.comment+=text;this.$nextTick(()=>{this.$refs.textarea.dispatchEvent(new Event('input',{bubbles:!1}));this.$refs.textarea.focus()})},focusComment(){this.$refs.textarea.focus()},onInput(){this.cart.comment=this.comment;this.$emit('navigate',{type:'recalc'})},onMousedown(e){if(e.target.closest('.cComment__textarea')){return} 1688e.preventDefault()}},directives:{autogrow:{inserted(el){el._autogrow=app.autogrow(el)}},spoiler(el){setTimeout(()=>{el.style.height=el.firstElementChild.offsetHeight+16+'px'},0)},},template:` 1689 <div v-if="isVisible" class="cComment" @click="focusComment" @mousedown="onMousedown"> 1690 1691 <div class="cComment__text" 1692 :class="{'cComment__text--active': isActive}"> 1693 <div class="cComment__icon"> 1694 <svg ref="icon" class="cComment__ico commentIco" viewBox="0 0 16 16" aria-hidden="true"> 1695 <g transform="translate(7.9866 13.5001)"> 1696 <g class="commentIco__g1"> 1697 <g class="commentIco__g2"> 1698 <path d="M0.013 0C0.013 0 0.013 -2 0.013 -2C-2.97 -1.702 -4.987 -3.563 -4.987 -6.307C-4.987 -8.895 -2.744 -11 0.013 -11C2.77 -11 5.013 -8.895 5.013 -6.307C5.013 -6.139 5.003 -5.974 4.985 -5.81C4.687 -2.93 2.079 -1.379 1.513 -1C1.513 -1 0.013 0 0.013 0Z" fill="#ae51b6"/> 1699 <g transform="translate(-2.9908 -6.4263)"> 1700 <g class="commentIco__g4" transform="scale(0 0)"> 1701 <g class="commentIco__g5" opacity="0"> 1702 <path d="M0.004 0.927C0.004 0.651 0.228 0.427 0.504 0.427C0.504 0.427 5.504 0.427 5.504 0.427C5.78 0.427 6.004 0.651 6.004 0.927C6.004 1.203 5.78 1.427 5.504 1.427C5.504 1.427 0.504 1.427 0.504 1.427C0.228 1.427 0.004 1.203 0.004 0.927Z" fill="#ffffff"/> 1703 <path d="M0.004 -1.073C0.004 -1.349 0.228 -1.573 0.504 -1.573C0.504 -1.573 1.504 -1.573 1.504 -1.573C1.78 -1.573 2.004 -1.349 2.004 -1.073C2.004 -0.797 1.78 -0.573 1.504 -0.573C1.504 -0.573 0.504 -0.573 0.504 -0.573C0.228 -0.573 0.004 -0.797 0.004 -1.073Z" fill="#ffffff"/> 1704 </g> 1705 </g> 1706 <g class="commentIco__g8"> 1707 <g class="commentIco__g9"> 1708 <path d="M0.004 -1.073C0.004 -1.349 0.228 -1.573 0.504 -1.573C0.504 -1.573 5.504 -1.573 5.504 -1.573C5.78 -1.573 6.004 -1.349 6.004 -1.073C6.004 -0.797 5.78 -0.573 5.504 -0.573C5.504 -0.573 0.504 -0.573 0.504 -0.573C0.228 -0.573 0.004 -0.797 0.004 -1.073Z" fill="#ffffff"/> 1709 <path d="M0.004 0.927C0.004 0.651 0.228 0.427 0.504 0.427C0.504 0.427 4.433 0.427 4.433 0.427C4.709 0.427 4.933 0.651 4.933 0.927C4.933 1.203 4.709 1.427 4.433 1.427C4.433 1.427 0.504 1.427 0.504 1.427C0.228 1.427 0.004 1.203 0.004 0.927Z" fill="#ffffff"/> 1710 </g> 1711 </g> 1712 </g> 1713 </g> 1714 </g> 1715 </g> 1716 </svg> 1717 </div> 1718 <textarea ref="textarea" 1719 v-model="comment" 1720 class="cComment__textarea" 1721 name="comment" 1722 rows="1" 1723 :maxlength="maxLength" 1724 @focus="toggleFocus(true)" 1725 @blur="toggleFocus(false)"
1726 @input="onInput" 1727 v-autogrow></textarea> 1728 <div class="cComment__caption">{{ caption }}</div> 1729 </div> 1730 1731 <div class="cComment__blanks" v-spoiler> 1732 <transition-group name="cComment__list" tag="div" class="cComment__list"> 1733 <div v-for="blank of blanks" 1734 :key="blank.id" 1735 class="cComment__blank" 1736 @click.stop="addBlank(blank.value || blank.name)">{{ blank.name }}</div> 1737 </transition-group> 1738 </div> 1739 1740 </div> 1741 1742 `};app.cartCallmeComponent={components:{commonInput:app.commonInputComponent,},inject:['store'],props:['cart','company','loc'],computed:{isVisible(){return this.company.cartCallMeAppearance==='doNotCall'},callme:{get(){return this.cart.callme},set(flag){this.cart.callme=flag;this.$emit('navigate',{type:'recalc'})},}},template:` 1743 <div v-if="isVisible" 1744 class="callme"> 1745 1746 <commonInput v-model="callme" 1747 type="checkbox" 1748 :caption="loc['cart/callme/doNotCall']"/> 1749 1750 </div> 1751 `};app.cartAirportComponent={components:{'cart-suggest':app.cartSuggestComponent},props:['cart','loc','company'],data:function(){const airport=this.cart&&this.cart.airport;return{firstName:airport?airport.firstName:'',lastName:airport?airport.lastName:'',flightNumber:airport?airport.flightNumber:'',arrivalDateTime:airport?airport.arrivalDateTime:'',messengerName:airport?airport.messengerName:'',messengerPhone:airport?airport.messengerPhone:'',messengers:[{id:'whatsapp',name:'WhatsApp'},{id:'telegram',name:'Telegram'},]}},computed:{isVisible(){return this.company.isAirport},locFlightNumber(){return this.loc['cart/flightNumber']},locArrivalDateTime(){return this.loc['cart/arrivalDateTime']},locMessengerPhoneNumber(){return this.loc['cart/messengerPhoneNumber']},locMessengerName(){return this.loc['cart/messengerName']},locName:function(){return this.loc['cart/yourname']},locLastName(){return this.loc['cart/lastName']},locPhone:function(){return this.loc['cart/yourphone']}},methods:{onMessengerSelected(messenger){this.messengerName=messenger.name;this.onInput()},onInput:function(){this.cart.airport.firstName=this.firstName;this.cart.airport.lastName=this.lastName;this.cart.airport.flightNumber=this.flightNumber;this.cart.airport.arrivalDateTime=this.arrivalDateTime;this.cart.airport.messengerPhone=this.messengerPhone;this.cart.airport.messengerName=this.messengerName;this.$emit('navigate',{type:'recalc'})}},template:` 1752 <div v-if="isVisible" class="cair"> 1753 1754 <div class="cair__field"> 1755 1756 <div class="ctinput__wrap cair__number"> 1757 <div class="ctinput__caption">{{locFlightNumber}}</div> 1758 <input class="ctinput" v-model="flightNumber" @input="onInput()"> 1759 </div> 1760 1761 <div class="ctinput__wrap cair__date"> 1762 <div class="ctinput__caption">{{locArrivalDateTime}}</div> 1763 <input class="ctinput" v-model="arrivalDateTime" @input="onInput()"> 1764 </div> 1765 1766 </div> 1767 1768 <div class="cair__field"> 1769 1770 <div class="ctinput__wrap cair__name"> 1771 <div class="ctinput__caption">{{locName}}</div> 1772 <input class="ctinput" v-model="firstName" @input="onInput()"> 1773 </div> 1774 1775 <div class="ctinput__wrap cair__secondName"> 1776 <div class="ctinput__caption">{{locLastName}}</div> 1777 <input class="ctinput" v-model="lastName" @input="onInput()"> 1778 </div> 1779 1780 </div> 1781 1782 1783 <div class="cair__field"> 1784 1785 <div class="ctinput__wrap cair__messengerPhone"> 1786 <div class="ctinput__caption">{{locMessengerPhoneNumber}}</div> 1787 <input type="tel" 1788 class="ctinput" 1789 v-model="messengerPhone" 1790 @input="onInput()"> 1791 </div> 1792 1793 <div class="ctinput__wrap cair__messengerName"> 1794 <div class="ctinput__caption">{{locMessengerName}}</div> 1795 <div class="ctinput ctinput--tick messenger__input">{{messengerName}}</div> 1796 1797 <cart-suggest @selected="onMessengerSelected" 1798 el=".messenger__input" 1799 :options="messengers"/> 1800 1801 </div> 1802 1803 </div> 1804 1805 </div> 1806 `};app.cartRecipientComponent={components:{cartBlock:app.cartBlockComponent,cartInput:app.cartInputComponent,},props:['cart','loc','company','phoneMask'],data(){const recipient=(this.cart&&this.cart.recipient)||{};return{name:recipient.name||'',phone:recipient.phone||'',text:recipient.text||'',}},computed:{isVisible(){return this.company.useRecipient&&this.cart.delivery.activeType==='courier'},locTitle(){return this.loc['cart/recipient/title']},locSub(){return this.loc['cart/recipient/sub']},locName(){return this.loc['cart/recipient/name']},locPhone(){return this.loc['cart/recipient/phone']},locText(){return this.loc['cart/recipient/text']}},methods:{onInput(){this.cart.recipient.name=this.name;this.cart.recipient.phone=this.phone;this.cart.recipient.text=this.text;this.$emit('navigate',{type:'recalc'})}},template:` 1807 1808 <cartBlock v-if="isVisible" 1809 :title="locTitle" 1810 :description="locSub" 1811 v-model="cart.recipient.active"
1812 @input="onInput" 1813 withToggle="true"> 1814 1815 <div class="ctblock__item"> 1816 <cartInput :caption="locName" name="name" v-model="name" @input="onInput"/> 1817 </div> 1818 1819 <div class="ctblock__item"> 1820 <cartInput :caption="locPhone" inputmode="tel" name="phone" :mask="phoneMask" v-model="phone" @input="onInput"/> 1821 </div> 1822 1823 <div class="ctblock__item"> 1824 <cartInput :caption="locText" name="text" v-model="text" @input="onInput"/> 1825 </div> 1826 1827 </cartBlock> 1828 1829 1830 `};app.cartScreenFormComponent={components:{'cart-header':app.cartHeaderComponent,'cartFooter':app.cartFooterComponent,cartAddress:app.cartFormAddressComponent,cartRestaurant:app.cartRestaurantComponent,'cart-inside':app.cartInsideComponent,'cart-drive':app.cartDriveComponent,'cart-client':app.cartClientComponent,cartPayment2:app.cartPayment2Component,'cart-timeframe':app.cartTimeframeComponent,'cart-contactless':app.cartContactlessComponent,cartComment:app.cartCommentComponent,'cart-stadium':app.cartStadiumComponent,'cart-airport':app.cartAirportComponent,'cart-recipient':app.cartRecipientComponent,'cart-callme':app.cartCallmeComponent,cartSummary:app.cartSummaryComponent,},props:['ui','cart','address','loc','company','user','cartLoading','phoneMask'],data(){return{loading:!1}},computed:{title(){var activeType=this.address&&this.address.type;var title=this.loc['cart/delivery'];if(activeType==='pickup'){if(this.company.isAirport){title=this.loc['tab/cart']}else{title=this.loc['cart/pickup']}}else if(activeType==='inside'){title=this.loc['cart/inside']}else if(activeType==='drive'){title=this.loc['cart/drive']}else if(activeType==='banquet'){title=this.loc['cart/banquet']} 1831return title},submitText(){return this.loc['btn/order']},},methods:{navigateBack(){this.$emit('navigate',{type:'screen',name:'dishes'})},submit(){this.$emit('navigate',{type:'order'})},navigate(params){this.$emit('navigate',params)}},template:` 1832 <div class="csform"> 1833 1834 <cart-header :title="title" 1835 back="true" 1836 @back="navigateBack()"/> 1837 1838 <div class="csform__content"> 1839 <cartAddress 1840 :cart="cart" 1841 :loc="loc" 1842 :address="address" 1843 :ui="ui" 1844 :company="company" 1845 v-model="loading"/> 1846 <cartRestaurant 1847 :address="address" 1848 :company="company" 1849 :loc="loc"/> 1850 <cart-client 1851 :cart="cart" 1852 :loc="loc" 1853 :company="company" 1854 :address="address" 1855 @navigate="navigate"/> 1856 <cart-recipient 1857 :cart="cart" 1858 :loc="loc" 1859 :company="company" 1860 :phoneMask="phoneMask" 1861 @navigate="navigate"/> 1862 <cart-airport 1863 :cart="cart" 1864 :loc="loc" 1865 :company="company" 1866 @navigate="navigate"/> 1867 <cart-timeframe 1868 :cart="cart" 1869 :address="address" 1870 :company="company" 1871 :loc="loc" 1872 :ui="ui" 1873 @navigate="navigate"/> 1874 <cart-contactless 1875 :cart="cart" 1876 @navigate="navigate"/> 1877 <cartPayment2 1878 :cart="cart" 1879 :address="address" 1880 :loc="loc" 1881 :company="company" 1882 :user="user" 1883 @navigate="navigate"/> 1884 <cart-inside 1885 :cart="cart" 1886 :address="address" 1887 :loc="loc" 1888 :company="company" 1889 @navigate="navigate"/> 1890 <cart-drive 1891 :cart="cart" 1892 :address="address" 1893 :loc="loc" 1894 :company="company" 1895 @navigate="navigate"/> 1896 <cart-stadium 1897 :cart="cart" 1898 :address="address" 1899 :loc="loc" 1900 @navigate="navigate"/> 1901 <cartComment 1902 :cart="cart" 1903 :loc="loc" 1904 :ui="ui" 1905 @navigate="navigate"/> 1906 <cart-callme 1907 :cart="cart" 1908 :company="company" 1909 :loc="loc" 1910 @navigate="navigate"/> 1911 <cartSummary 1912 :cart="cart" 1913 :loc="loc" 1914 :company="company" 1915 :address="address" 1916 :ui="ui" 1917 :user="user" 1918 @navigate="navigate"/> 1919 </div> 1920 1921 <cartFooter :text="submitText" 1922 :cart-loading="cartLoading" 1923 :cart="cart" 1924 :company="company" 1925 :loading="loading" 1926 @submit="submit()"/> 1927 1928 </div> 1929 1930 `};app.cartMerchantTypeComponent={props:['type','cart','loc','company'],computed:{isCard:function(){return!!this.type.info},brand:function(){return(this.type.info&&this.type.info.brand)||''},prefix:function(){const first6=this.type.info&&this.type.info.first6;return String(first6||'').substr(0,4)},last4:function(){const value=this.type.info&&this.type.info.last4;return/^\d{4}$/.test(value)?value:''}
1930,name:function(){if(this.type.name){return this.type.name} 1931return this.last4||this.loc['cart/onlinePayment/savedCard']},removeButtonVisible(){if(this.company.id===1068){return!1} 1932return this.type.info},selected:function(){return this.type.id===this.cart.merchant.activeType}},methods:{select:function(){this.cart.merchant.activeType=this.type.id;this.$emit('navigate',{type:'recalc'});this.$emit('navigate',{type:'screen',name:'form'})},remove:function(){if(!window.confirm(this.loc['cart/onlinePayment/deleteCard'])){return} 1933this.$parent.removeType(this.type)}},template:` 1934 <div class="cmtype" @click="select()"> 1935 1936 <div class="cmtype__radio" 1937 :class="{'cmtype__radio--selected': selected}"></div> 1938 1939 <div class="cmtype__wrap"> 1940 1941 <span v-if="isCard" 1942 class="cmtype__brand" 1943 :class="'cmtype__brand--'+brand"></span> 1944 1945 <span v-if="prefix" 1946 class="cmtype__prefix">{{prefix}}</span> 1947 1948 <span v-if="prefix" class="cmtype__dots">···</span> 1949 <span v-if="last4" class="cmtype__dots">···</span> 1950 1951 <span class="cmtype__name">{{name}}</span> 1952 </div> 1953 1954 <div class="cmtype__options"> 1955 <i v-if="removeButtonVisible" class="cmtype__button cmtype__button--remove" @click.stop="remove()"></i> 1956 </div> 1957 1958 </div> 1959 `};app.cartScreenMerchantComponent={components:{'cart-header':app.cartHeaderComponent,'cart-merchant-type':app.cartMerchantTypeComponent,'cart-spinner':app.commonSpinnerComponent},props:['cart','loc','company'],data:function(){return{loading:!1}},computed:{types:function(){return this.cart.merchant.types},locTitle:function(){return this.loc['cart/onlinePayment/cardTitle']}},methods:{removeType:function(type){var _this=this;var payload={id:type.id};this.loading=!0;app.fetch('/merchant/card/remove',payload,function(){_this.$emit('navigate',{type:'recalc',cb:function(){_this.loading=!1}})})},navigateBack:function(){this.$emit('navigate',{type:'screen',name:'form'})},onNavigate(params){this.$emit('navigate',params)}},template:` 1960 <div class="ctmerch"> 1961 1962 <cart-header :title="locTitle" 1963 @back="navigateBack()" 1964 back="true"></cart-header> 1965 1966 <cart-spinner v-if="loading"></cart-spinner> 1967 1968 <div v-else 1969 class="ctmerch__content"> 1970 1971 <cart-merchant-type v-for="type in types" 1972 :key="type.id" 1973 :type="type" 1974 :cart="cart" 1975 :loc="loc" 1976 :company="company" 1977 @navigate="onNavigate"> 1978 </cart-merchant-type> 1979 1980 </div> 1981 1982 </div> 1983 `};app.cartScreenLoadingComponent={components:{'cart-spinner':app.commonSpinnerComponent,},template:` 1984 <div class="cLoading"> 1985 <cart-spinner/> 1986 </div> 1987 `};app.cartIconsComponent={template:` 1988<svg style="position: fixed; visibility: hidden;"> 1989 <symbol id="cIcon__date" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 1990 <path d="M0 5.19981C0 4.97889 0.179086 4.7998 0.4 4.7998H11.6C11.8209 4.7998 12 4.97889 12 5.1998V8.7998C12 10.1253 10.9255 11.1998 9.6 11.1998H2.4C1.07452 11.1998 0 10.1253 0 8.7998V5.19981Z" fill="currentColor"/> 1991 <rect x="2.3999" width="0.8" height="2.4" rx="0.4" fill="currentColor"/> 1992 <path d="M8 2C8 2.66274 8.53745 3.2002 9.2002 3.2002C9.86285 3.20009 10.4004 2.66268 10.4004 2V1.65234C11.3161 1.8605 12 2.67848 12 3.65723C11.9997 3.84634 11.8464 3.99995 11.6572 4H0.342773C0.153615 3.99995 0.000256018 3.84634 0 3.65723C0 2.67848 0.683878 1.8605 1.59961 1.65234V2C1.59961 2.66271 2.13711 3.20014 2.7998 3.2002C3.46255 3.2002 4 2.66274 4 2V1.59961H8V2Z" fill="currentColor"/> 1993 <rect x="8.7998" width="0.8" height="2.4" rx="0.4" fill="currentColor"/> 1994 </symbol> 1995 <symbol id="cIcon__time" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 1996 <path d="M6 0C9.31371 0 12 2.68629 12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C3.22128e-08 2.68629 2.68629 3.22139e-08 6 0ZM6.42871 3.42871C6.19202 3.42871 6 3.62073 6 3.85742V6C6 6.47339 6.38403 6.85742 6.85742 6.85742H9.85742C10.0939 6.85727 10.2861 6.66525 10.2861 6.42871C10.2861 6.19211 10.094 6.00015 9.85742 6H7.71387C7.24067 5.99977 6.85742 5.61583 6.85742 5.14258V3.85742C6.85742 3.62077 6.66534 3.42879 6.42871 3.42871Z" fill="currentColor"/> 1997 </symbol> 1998</svg> 1999 `};app.cartMainComponent={components:{'cart-screen-loading':app.cartScreenLoadingComponent,'cart
1999-screen-empty':app.cartScreenEmptyComponent,'cart-screen-dishes':app.cartScreenDishesComponent,'cart-screen-form':app.cartScreenFormComponent,'cart-screen-merchant':app.cartScreenMerchantComponent,'cart-screen-gifts':app.cartScreenGiftsComponent,'cart-screen-clear':app.cartScreenClearComponent,'cart-screen-waiting':app.cartScreenWaitingComponent,cartScreenPinpad:app.cartScreenPinpadComponent,'cart-screen-kioskComplete':app.cartScreenKioskCompleteComponent,cartIcons:app.cartIconsComponent,},props:['ui','site','insets','credentials','cart','cartLoading','address','company','user','loc','mobile','isKiosk','restaurants','activeScreen','recalcEvent','recalcEventParams','orderEvent','orderEventParams','clearEvent','phoneMask',],provide(){return{store:this.store,ui:this.ui,}},data(){return{store:{activeScreen:this.activeScreen,activeScreenArgs:null,ordering:!1,pendingOrderId:null,},isDark:!1,pinpadError:null,}},watch:{recalcEvent:function(){this.recalc(this.recalcEventParams)},orderEvent:function(){this.order(this.orderEventParams)},clearEvent:function(){this.clear()},activeScreen:function(val){this.store.activeScreen=val}},computed:{activeScreenComputed(){const activeScreen=this.store.activeScreen||this.activeScreen;const isHaveScreen=['loading','empty','dishes','form','success','waiting','merchant','cdek','gifts','pinpad','clear','kioskComplete',].includes(activeScreen);if(!isHaveScreen){alert('Cart screen is missing')} 2000if(['success','loading','waiting'].includes(this.store.activeScreen)){return this.store.activeScreen} 2001let dishes=(this.cart&&this.cart.dishes)||[];dishes=dishes.filter((item)=>item.num>0);if(!dishes.length){if(this.cartLoading){return'loading'} 2002return'empty'} 2003return this.store.activeScreen},activeScreenComponent(){return'cart-screen-'+this.activeScreenComputed},classes(){return{['cart--'+this.activeScreenComputed]:!0,}},},methods:{openExternalUrl(url){if(window.Telegram?.WebApp?.openLink){window.Telegram.WebApp.openLink(url)}else{window.location.assign(url)}},closeCartBeforePayment(){this.store.ordering=!1;app.updateStore({cart:null});this.$emit('navigate',{type:'close'})},clear(){if(this.isKiosk){PubSub.publish('closeKioskSession');return} 2004this.store.activeScreen='loading';this.cart.dishes=[];this.recalc({clear:!0,cb:()=>{this.store.activeScreen='dishes'}});app.updateStore({cart:null})},navigate(screen,args){if(this.isKiosk){this.pinpadError=null} 2005this.store.activeScreenArgs=args||null;this.store.activeScreen=screen},onNavigateAction(params){if(params&&typeof params==='object'&¶ms.type){switch(params.type){case 'recalc':const{type,...recalcParams}=params;this.recalc(recalcParams);break;case 'order':const{type:orderType,...orderParams}=params;this.order(orderParams);break;case 'alert':app.alert(params.message,'danger');break;case 'clear':this.clear();break;case 'screen':this.navigate(params.name,params.args);break;case 'checkPayment':this.checkPayment(params.orderId||this.store.pendingOrderId);break;case 'showOrderDetails':this.store.pendingOrderId=null;this.$emit('navigate',params);break;case 'close':case 'AUTH_REQUIRED':default:this.$emit('navigate',params);break}}else{this.$emit('navigate',params)}},startWaitingForPayment(orderId){this.store.ordering=!1;this.store.pendingOrderId=orderId||null;this.navigate('waiting')},checkPayment(orderId){if(!orderId){return} 2006app.fetch('/cart/check-payment',{cart:orderId},(response)=>{if(!response){return} 2007if(response.error){this.store.pendingOrderId=null;app.alert(response.message,'danger');this.$emit('navigate',{type:'showOrderDetails',orderId,});return} 2008if(response.paid){this.store.pendingOrderId=null;this.$emit('navigate',{type:'showOrderDetails',orderId,})}})},getFormData(){if(!this.cart){return null} 2009var formData=JSON.parse(JSON.stringify(this.cart));delete formData.timeframe.daysPreorder;delete formData.timeframe.needPreorderMessage;delete formData.timeframe.types;return formData},recalc(params){PubSub.publish('recalcCart',{formData:this.getFormData(),clear:params&¶ms.clear,cb:params&¶ms.cb,noTimeout:params&¶ms.noTimeout,addCard:params&¶ms.addCard,checkCard:params&¶ms.checkCard})},getGaSessionCookies(){const result={};document.cookie.split(';').forEach((cookie)=>{const index=cookie.indexOf('=');const name=cookie.slice(0,index).trim();if(/^_ga_[A-Z0-9]+$/.test(name)){result[name]=decodeURIComponent(cookie.slice(index+1).trim())}});return result},order(params){this.store.ordering=!0;const payload={screen:this.store.activeScreen,cutleryVisible:this.company.cutleryVisible,eatInTableNumberHidden:this.company.cartEatInTableNumberHidden,cartEatInPreorderVisible:this.company.cartEatInPreorderVisible,cartHidePhoneInQr:this.company.cartHidePhoneInQr,activeTimeframeType:this.cart.timeframe.activeType,browserScreenHeight:window.outerHeight,browserScreenWidth:window.outerWidth,useCartAuth:this.cart&&this.cart.client&&this.cart.client.useCartAuth,pinpadTask:params&¶ms.pinpadTask,marketingTouches:app.marketingTouches?app.marketingTouches.get():[],gaClientId:app.cookie?(app.cookie.get('_ga')||''):'',gaSessionCookies:this.getGaSessionCookies(),};app.fetch('/cart/order2',payload,(response)=>{if(response.error){this.store.ordering=!1;if(response.kioskSubscriptionRequired){window.location.href='/kiosk';return} 2010if(response.message==='AUTH_REQUIRED'){this.onNavigateAction({type:'AUTH_REQUIRED',});return} 2011if(this.store.activeScreen==='pinpad'){this.pinpadError=response.message;return} 2012app.alert(response.message,'danger');return} 2013if(response.pinpadTask){app.pinpad(response.pinpadTask,(res)=>{params.pinpadTask={...response.pinpadTask,res};this.order(params)});this.navigate('pinpad');return} 2014PubSub.publish('gtmNotify',{event:'purchase',cart:this.cart});PubSub.publish('syncPreorderDays');if(response.waiting){this.startWaitingForPayment(response.id);return} 2015if(response.paymentUrl){this.startWaitingForPayment(response.id);setTimeout(()=>{this.openExternalUrl(response.paymentUrl)},1500);return} 2016if(response.kaspiUrl){this.startWaitingForPayment(response.id);setTimeout(()=>{this.openExternalUrl(response.kaspiUrl)},1500);return} 2017this.store.ordering=!1;if(this.isKiosk){console.log('Order complete');app.print.queue(response.shiftOrderNumber,()=>{console.log('Number printed')});app.print.dishes(this.cart,()=>{console.log('Receipt printed')});this.navigate('kioskComplete',{shiftOrderNumber:response.shiftOrderNumber});return} 2018this.$emit('navigate',{type:'showOrderDetails',orderId:response.id,})})},getRGB(hex){if(hex.length<=5){hex=hex[0]+hex[1]+hex[1]+hex[2]+hex[2]+hex[3]+hex[3]} 2019if(hex.length>9){const result=/.+(\d{3}).+(\d{3}).+(\d{3})/.exec(hex);return result&&{r:parseInt(result[1]),g:parseInt(result[2]),b:parseInt(result[3])}} 2020let result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result&&{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}},isDarkColor(color){if(!color){return!1} 2021const rgb=this.getRGB(color);return 0.299*rgb.r+0.587*rgb.g+0.114*rgb.b<127.5}},template:` 2022 <div class="cart" :class="classes"> 2023 <cartIcons/> 2024 <transition name="cart__transition" mode="out-in"> 2025 <component 2026 :is="activeScreenComponent" 2027 :cart="cart" 2028 :cartLoading="cartLoading" 2029 :loc="loc" 2030 :company="company" 2031 :address="address" 2032 :user="user" 2033 :mobile="mobile" 2034 :isKiosk="isKiosk" 2035 :pinpadError="pinpadError" 2036 :pendingOrderId="store.pendingOrderId" 2037 :phoneMask="phoneMask" 2038 :ui="ui" 2039 @navigate="onNavigateAction"/> 2040 </transition> 2041 </div> 2042 `};app.addModule(()=>{const show=()=>
2042{if(app.store.state.address&&app.store.state.address.warning){PubSub.publish('showUserAddress',{refScreen:'cart'});return} 2043const mainModule=app.store&&app.store.state&&app.store.state.mainModule;if(mainModule&&mainModule!=='company'){const cart=app.store.state.cart;const carts=cart&&cart.multiCarts&&cart.multiCarts.carts;if(carts){const active=carts.find(c=>c.active)||carts[0];if(active&&active.url){window.location.assign(active.url+'?showCart');return}}} 2044let addressChanged=!1;PubSub.subscribe('addressChanged',()=>{addressChanged=!0}) 2045let vr;let vm;const cartComponent={components:{cartMainComponent:app.cartMainComponent,},data(){return{activeScreen:'dishes',recalcEvent:'',recalcEventParams:null,orderEvent:'',orderEventParams:null,clearEvent:'',}},computed:{...Vuex.mapState(['cart','cartLoading','loc','company','ui','address','user','mobile','isKiosk','phoneMask']),},mounted(){document.documentElement.classList.add('html--cartOpened');PubSub.subscribe('closeCart',this.close)},destroyed(){PubSub.unsubscribe('closeCart',this.close)},methods:{recalc(params){this.recalcEvent=Math.random();this.recalcEventParams=params},order(params){this.orderEvent=Math.random();this.orderEventParams=params},clear(){this.clearEvent=Math.random()},navigate(params){if(typeof(params)==='object'){if(params.type==='close'){this.close()}else if(params.type==='showOrderDetails'){addressChanged=!1;const carts=this.cart&&this.cart.multiCarts&&this.cart.multiCarts.carts;const otherCarts=carts&&carts.filter(c=>!c.active);const nextCartUrl=otherCarts&&otherCarts.length&&otherCarts[0].url;app.updateStore({cart:null});this.close();setTimeout(()=>{PubSub.publish('showOrderDetails',{orderId:params.orderId,navigatePageOnClose:nextCartUrl?(nextCartUrl+'?showCart'):null,reloadPageOnClose:!nextCartUrl,})},1000)}else if(params.type==='AUTH_REQUIRED'){addressChanged=!0;PubSub.publish('showAuth',{returnTo:'cart',cb:(phone)=>{this.cart.client.phone=phone;this.recalc({})}})}else if(params.type==='recalc'){const{type,...recalcParams}=params;this.recalc(recalcParams)}else if(params.type==='order'){const{type,...orderParams}=params;this.order(orderParams)}else if(params.type==='multiCart'){if(params.cart.url){window.location.assign(params.cart.url+'?showCart')}}else if(params.type==='clear'){this.clear()}else if(params.type==='confirm'){if(window.confirm(params.message)){params.cb()}}else if(params.type==='screen'){this.activeScreen=params.name}}else{this.activeScreen=params}},close(){document.documentElement.classList.remove('html--cartOpened');if(vm){vm.$destroy() 2046const div=document.createElement('div');div.id='cart__module';vm.$el.parentElement.appendChild(div);setTimeout(()=>{vm.$el.parentElement.removeChild(vm.$el)},300)}else{this.$emit('close')}},},template:` 2047 <cartMainComponent 2048 :cart="cart" 2049 :cartLoading="cartLoading" 2050 :loc="loc" 2051 :company="company" 2052 :ui="ui" 2053 :address="address" 2054 :user="user" 2055 :mobile="mobile" 2056 :isKiosk="isKiosk" 2057 :phoneMask="phoneMask" 2058 :activeScreen="activeScreen" 2059 :recalcEvent="recalcEvent" 2060 :recalcEventParams="recalcEventParams" 2061 :orderEvent="orderEvent" 2062 :orderEventParams="orderEventParams" 2063 :clearEvent="clearEvent" 2064 @navigate="navigate" 2065 /> 2066 `,store:app.store};if(document.querySelector('#cart__module')){vm=new Vue(cartComponent);vm.$mount('#cart__module')}else{app.openViewer({desktop:{maxWidth:'400px',withClose:!1,disableAutogrow:!0,},mobile:{withTick:!0,withClose:!1,minHeight:'90dvh',maxHeight:'90dvh',backgroundColor:'transparent',},component:cartComponent})}};PubSub.subscribe('showCart',show);if(window.location.href.includes('showCart')){show()}});
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.