1app.mapBarComponent={inject:['getMap'],props:['defaultZoom'],methods:{changeZoom(action,zoom){this.getMap()[action](zoom)}},template:` 2 <div class="mapBar"> 3 4 <div class="mapBar__box mapBar__box--zoom"> 5 <div class="mapBar__button mapBar__zoom mapBar__zoom--plus" 6 @click="changeZoom('zoomIn')"> 7 </div> 8 <div class="mapBar__button mapBar__zoom mapBar__zoom--minus" 9 @click="changeZoom('zoomOut')"> 10 </div> 11 <div class="mapBar__button mapBar__zoom" 12 @click="changeZoom('setZoom', defaultZoom)"> 13 <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"> 14 <path d="M6.80628 0.603676C6.4072 0.621282 5.88291 0.683883 5.61295 0.750396C4.85195 0.93233 4.23964 1.18077 3.6371 1.55051C3.11086 1.8733 2.60027 2.29781 2.17772 2.76536C1.95079 3.01381 1.60061 3.49114 1.46563 3.73567C1.4402 3.78263 1.41086 3.81979 1.39912 3.81979C1.38738 3.81979 1.28957 3.77089 1.18197 3.7122C1.07633 3.65351 0.984386 3.6046 0.98243 3.6046C0.978517 3.6046 0.884616 3.54591 0.775064 3.47353C0.57748 3.34246 0.575524 3.34246 0.438584 3.34246C0.115798 3.34051 -0.0622239 3.59873 0.0199399 3.95282C0.0316776 4.00368 0.0571092 4.11519 0.076672 4.20127C0.123623 4.39885 0.205787 4.75685 0.254694 4.974C0.276213 5.06595 0.301644 5.17158 0.311426 5.20875C0.321207 5.24592 0.346639 5.35156 0.368158 5.44351C0.422934 5.68804 0.503141 6.03822 0.546179 6.21624C0.600955 6.44317 0.636168 6.59771 0.692901 6.85203C0.720288 6.97528 0.765283 7.16503 0.790715 7.27263C0.816146 7.38023 0.857228 7.55238 0.880703 7.65411C0.986343 8.11579 1.01764 8.20578 1.11154 8.30555C1.1898 8.39162 1.26805 8.42292 1.38934 8.42292C1.52432 8.42097 1.62213 8.37402 1.77472 8.23708C1.89014 8.13339 2.42225 7.63846 2.87415 7.21199C3.03653 7.0594 3.85229 6.29645 4.26311 5.91497C4.73653 5.4709 4.92629 5.27918 4.95759 5.20484C4.99672 5.11094 4.99476 4.94857 4.95564 4.8664C4.91651 4.78424 4.83043 4.69034 4.75805 4.65513C4.71893 4.63556 4.59177 4.62383 4.3218 4.616C4.11248 4.60818 3.85229 4.59057 3.7447 4.57492C3.6371 4.55927 3.50603 4.53971 3.45126 4.53188C3.2791 4.50841 3.27128 4.49862 3.3554 4.38125C3.67427 3.93717 4.21616 3.44615 4.69545 3.1664C5.05736 2.95316 5.55817 2.74971 5.92595 2.66559C6.30938 2.57756 6.57739 2.54821 6.98039 2.54821C7.49098 2.54821 7.80398 2.59321 8.31261 2.73797C8.61193 2.82209 9.13034 3.0588 9.41791 3.24269C9.98328 3.6046 10.5428 4.17584 10.8636 4.71968C11.0534 5.03856 11.3038 5.63914 11.3683 5.91693C11.3762 5.95801 11.3918 6.02844 11.4035 6.07343C11.4818 6.42947 11.4916 6.5312 11.4916 7.04766C11.4916 7.46043 11.4837 7.60324 11.4564 7.75192C11.337 8.38967 11.1942 8.78875 10.889 9.33651C10.8343 9.43628 10.6112 9.75515 10.488 9.91361C10.3295 10.1151 9.97154 10.4594 9.7407 10.6355C9.15968 11.0776 8.48477 11.3691 7.77464 11.4884C7.7003 11.5002 7.59075 11.5197 7.53206 11.5295C7.39512 11.553 6.63217 11.553 6.49132 11.5295C6.43263 11.5197 6.31916 11.5021 6.23896 11.4884C5.69315 11.4004 5.09845 11.1715 4.61524 10.8644C4.38832 10.7196 4.32963 10.6981 4.23377 10.7255C4.18682 10.7392 4.1203 10.7724 4.08509 10.8037C3.96967 10.8976 3.38866 11.3495 3.11673 11.5588C3.03848 11.6175 2.96219 11.688 2.94262 11.7153C2.89959 11.7819 2.89763 11.9599 2.94067 12.0244C2.98762 12.0988 3.69188 12.6035 3.74665 12.6035C3.75252 12.6035 3.78187 12.6191 3.80926 12.6407C3.92663 12.7209 4.4294 12.9615 4.67393 13.0534C5.05541 13.1962 5.16692 13.2315 5.4721 13.3078C5.74989 13.3762 5.91421 13.4056 6.30743 13.4545C6.57544 13.4877 7.41859 13.4936 7.624 13.4662C7.69639 13.4545 7.82941 13.4369 7.92136 13.4251C8.8545 13.2999 9.69766 12.985 10.5154 12.4568L10.992 12.0537L11.4009 12.4567C11.6259 12.6778 12.2812 13.3214 12.8564 13.8867C13.4315 14.4501 14.0966 15.1035 14.3334 15.3363C14.8616 15.8548 14.9398 15.9115 15.2293 15.9741C15.5228 16.0367 15.9082 15.9839 16.2212 15.8371C16.4481 15.7308 16.9671 15.2362 16.8647 14.6968C16.8139 14.4288 16.7258 14.2704 16.5146 14.061C16.3072 13.8537 15.2723 12.8364 14.5524 12.1282C12.7898 10.3989 12.6568 10.2052 12.6568 10.2052C12.6646 10.1817 12.9157 9.59474 12.9412 9.54192C13.037 9.33064 13.1564 8.97264 13.2444 8.63225C13.485 7.70692 13.5046 6.61532 13.2992 5.67826C13.0214 4.4145 12.3934 3.29747 11.4505 2.39171C11.3331 2.27825 11.1668 2.12957 11.0808 2.06305C10.9947 1.99458 10.9066 1.92416 10.8851 1.9046C10.8284 1.85765 10.4645 1.6092 10.4528 1.6092C10.4469 1.6092 10.4058 1.58377 10.3608 1.55442C10.0576 1.35097 9.46682 1.07709 8.99731 0.924505C8.78017 0.854
14079 8.39478 0.754309 8.17567 0.711271C7.81376 0.640845 7.15645 0.589982 6.80628 0.603676Z" fill="currentColor"/> 15 </svg> 16 </div> 17 </div> 18 19 </div> 20 `};app.addModule(()=>{let map;let companyLayer;const companyMarkers={};let zoneLayer;let deliveryBounds;app.contactMapComponent={components:{'map-bar':app.mapBarComponent},props:['value','mapTiles','initCoordinates','companies','zones','isDark','settings'],provide(){return{getMap:()=>map,}},data(){return{isReady:!1,error:!1,defaultZoom:12,}},computed:{loc(){return app.store.state.loc},popup:{get(){return this.value},set(value){this.$emit('input',value)}},tilesParams(){return{osm:['https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{subdomains:['a','b','c']}],google:['https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{subdomains:['mt0','mt1','mt2','mt3']}],yandex:[`https://core-renderer-tiles.maps.yandex.net/tiles?${ this.isDark ? 'theme=dark&' : ''}l=map&x={x}&y={y}&z={z}&scale=2&lang=ru_RU`],mapy:['https://api.mapy.cz/v1/maptiles/basic/256/{z}/{x}/{y}?apikey='+((this.settings&&this.settings.mapyKey)||'')]}},zonePalette(){return{green:'rgba(7, 157, 4, 0.9)',blue:'rgba(0, 163, 255, 0.9)',grey:'#989898',orange:'#FF8C61',violet:'#944BBB',lightBlue:'#51E5FF',yellow:'#FFD447',pink:'#F497DA',aqua:'#00FFFF'}}},watch:{mapTiles(){!this.isReady&&this.initMap()},popup(id){if(!id||!companyMarkers[id]){return} 21companyMarkers[id].openPopup();this.popup=null}},methods:{initMap(){if(!this.tilesParams[this.mapTiles]||!this.initCoordinates){this.error=this.loc['site/map/error/init'];this.isReady=!0;return} 22companyLayer=L.layerGroup();zoneLayer=L.layerGroup();map=new L.Map(this.$refs.map,{crs:['google','osm','mapy'].includes(this.mapTiles)?L.CRS.EPSG3857:L.CRS.EPSG3395,minZoom:8,zoomControl:!1,attributionControl:!1,layers:[L.tileLayer(...this.tilesParams[this.mapTiles]),zoneLayer,companyLayer],});map.on('load',()=>{this.isReady=!0});this.showCompanies();this.showZones();if(deliveryBounds){this.defaultZoom=map.getBoundsZoom(deliveryBounds)} 23const coordinates=deliveryBounds?deliveryBounds.getCenter():this.initCoordinates;map.setView(coordinates,this.defaultZoom)},showCompanies(){companyLayer.clearLayers();this.companies.filter((company)=>company.coordinates).forEach((company)=>{this.addCompany(company.coordinates,company.name,company.worktime&&company.worktime.today,company.id)})},addCompany(coordinates,address,time,id){const marker=L.marker(coordinates,{icon:L.divIcon({iconSize:[18,31],iconAnchor:[9,31],className:'cMap__marker',html:'<svg width="18" height="31" viewBox="0 0 18 31" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="9" cy="9" r="9" fill="currentColor"/> <rect x="8" y="17" width="2" height="14" fill="currentColor"/> <circle cx="9" cy="9" r="4" fill="var(--contact-bg, var(--topping-bg, #fff))"/> </svg>'})});const content=`<div class="cMap__address">${address}</div><div class="cMap__time">${time}</div>`;marker.bindPopup(content,{className:'cMap__popUp',closeButton:!1,});companyLayer.addLayer(marker);companyMarkers[id]=marker},showZones(){if(!this.zones){return} 24this.zones.forEach((zone)=>{const color=this.zonePalette[zone.color]||this.zonePalette.green;const options={onEachFeature(feature,l){if(!deliveryBounds){deliveryBounds=l.getBounds()}else{deliveryBounds.extend(l.getBounds())} 25l.setStyle({color,fillColor:color,weight:1})}};const geoJSON=L.geoJSON(zone.poly,options);if(zone.hint){const content=zone.hint.map((text)=>`<div>${text}</div>`).join('');const popup=L.popup({className:'cMap__popUp cMap__popUp--zone',closeButton:!1,}).setContent(content);geoJSON.on('mousedown',()=>{popup.isOpen()?geoJSON.unbindPopup(popup):geoJSON.bindPopup(popup)})} 26zoneLayer.addLayer(geoJSON)})},},template:` 27 <div class="cMap" data-no-drag> 28 29 <div ref="map" class="cMap__leaflet"></div> 30 <map-bar :default-zoom="defaultZoom"></map-bar> 31 32 <transition name="contact__fade"> 33 <div v-if="!isReady" class="cMap__loading"> 34 35 <transition name="contact__fade" mode="out-in"> 36 <div v-if="error" key="1" class="cMap__error">{{ error }}</div> 37 <div v-else key="2" class="spinner__item"></div> 38 </transition> 39 40 </div> 41 </transition> 42 43 </div> 44 `}});app.addModule(()=>{const showWindow=(event,params)=>{const companyId=params&¶ms.companyId;const cityId=params&¶ms.cityId;const contactComponent={components:{'contact-map':app.contactMapComponent,},props:{companyId:{default:null},cityId:{default:null},},data(){return{mapTiles:null,addresses:null,zones:null,cityCoordinates:null,settings:null,spoiler:{},popup:null,isDark:null,}},computed:{isDisplayRestaurantPhoto(){return this.settings.isDisplayRestaurantPhoto},isEmpty(){return this.addresses&&!this.addresses.length},loc(){return app.store.state.loc}},created(){const bgColor=getComputedStyle(document.documentElement).getPropertyValue('--topping-bg');this.isDark=this.isDarkColor(bgColor);this.getData()},methods:{getData(){const payload={params:{companyId:this.companyId,cityId:this.cityId,}};app.fetch('/contact/get',payload,(response)=>{if(response.error){app.growl(response.message,'danger');this.$emit('close');return} 45this.addresses=response.addresses||[];this.zones=response.zones||[];this.cityCoordinates=response.cityCoordinates;this.settings=response.settings;this.mapTiles=response.mapTiles;this.$emit('loading',!1)})},toggleSpoiler(key){this.$set(this.spoiler,key,!this.spoiler[key])},showPopup(id){this.popup=id},getRGB(hex){if(hex.length<=5){hex=hex[0]+hex[1]+hex[1]+hex[2]+hex[2]+hex[3]+hex[3]} 46if(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])}} 47let 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} 48let rgb=this.getRGB(color);let luminance=(0.2126*rgb.r+0.7152*rgb.g+0.0722*rgb.b);return luminance<140}},directives:{spoiler:{inserted(el){el.style.height=el.scrollHeight+'px'},},},template:` 49 <div class="contact" :class="{'contact--dark': isDark}"> 50 51 <contact-map v-model="popup" 52 :map-tiles="mapTiles" 53 :settings="settings" 54 :init-coordinates="cityCoordinates" 55 :companies="addresses" 56 :zones="zones" 57 :is-dark="isDark" 58 class="contact__map" 59 :class="{'contact__map--full': isEmpty}"></contact-map> 60 61 <div v-if="!isEmpty" class="contact__content"> 62 63 <div class="contact__title">{{ loc['site/contact/title'] }}</div> 64 65 <ul v-if="addresses" class="contact__list"> 66 67 <li v-if="isEmpty" 68 class="contact__item"> 69 <div class="contact__address">{{ loc['site/contact/empty'] }}</div> 70 </li> 71 72 <li v-for="(item, idx) of addresses" 73 :key="idx" 74 class="contact__item"> 75 76 <button v-if="item.name" 77 type="button" 78 class="contact__address" @click="showPopup(item.id)">{{ item.name }}</button> 79 80 <a v-if="item.phone" 81 :href="'tel:' + item.phone" 82 class="contact__phone">{{ item.phone }}</a> 83 84 <button v-if="item.worktime.todayFormatted" 85 type="button" 86 class="contact__worktime" 87 :disabled="!item.worktime.list" 88 @click="toggleSpoiler(idx)"> 89 {{ item.worktime.todayFormatted }} 90 <svg class="contact__arrow" :class="{'contact__arrow--rotate': spoiler[idx]}
90" width="7" height="5" viewBox="0 0 7 5" fill="none" xmlns="http://www.w3.org/2000/svg"> 91 <path d="M6.29289 1L3.64645 3.64645M3.64645 3.64645L3.29289 4M3.64645 3.64645L1 1M3.64645 3.64645L4 4" stroke="currentColor"/> 92 </svg> 93 </button> 94 95 <transition name="spoiler"> 96 <div v-if="item.worktime.list && spoiler[idx]" 97 class="contact__spoiler" 98 v-spoiler> 99 <div class="contact__container"> 100 <table> 101 <tr v-for="(time, idx) of item.worktime.list" 102 :key="idx" 103 class="contact__day"> 104 <td v-for="(cell, idx) of time.split(' ')" 105 :key="idx" 106 :colspan="idx && time.split(' ').length === 2 && 3" 107 :style="idx && time.split(' ').length === 2 && 'text-align: left'" 108 > 109 {{ cell }} 110 </td> 111 </tr> 112 </table> 113 </div> 114 </div> 115 </transition> 116 117 <div v-if="isDisplayRestaurantPhoto && item.photo.high" 118 class="contact__imgWrap lazyload__wrap"> 119 <img class="contact__img lazyload" 120 :data-lowsrc="item.photo.low" 121 :data-src="item.photo.high"> 122 </div> 123 124 125 </li> 126 127 </ul> 128 129 </div> 130 131 </div> 132 `,};app.openViewer({startInLoadingState:!0,desktop:{maxWidth:'900px',disableAutogrow:!0,withClose:!0,overflow:'hidden',},mobile:{withTick:!0,minHeight:'90dvh',maxHeight:'90dvh',},component:contactComponent,props:{companyId,cityId},})};PubSub.subscribe('showContactModalWindow',showWindow)});
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.