1"use strict";(self.webpackChunksmartfire=self.webpackChunksmartfire||[]).push([[805],{31108(e,t,r){var s,n=r(41594);const l=["title","titleId"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},o.apply(null,arguments)}function i(e,t){let r=e.title,i=e.titleId,a=function(e,t){if(null==e)return{};var r,s,n=function(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)r=l[s],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,l);return n.createElement("svg",o({width:801,height:801,viewBox:"0 0 801 801",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":i},a),r?n.createElement("title",{id:i},r):null,s||(s=n.createElement("path",{d:"M696.002 800.667H685.442C566.461 787.773 452.151 747.361 351.625 682.657C258.238 623.409 178.948 544.58 119.284 451.667C54.1812 351.267 13.6071 237.064 0.818241 118.22C-0.643758 104.045 0.799879 89.7214 5.06236 76.1191C9.32438 62.5168 16.3162 49.9185 25.6135 39.089C34.6564 28.1145 45.8179 19.0592 58.4377 12.4593C71.0571 5.8599 84.8777 1.84984 99.0807 0.666992H218.465C244.322 0.693064 269.317 9.92806 288.937 26.7043C308.557 43.4805 321.508 66.6924 325.452 92.1479C329.814 124.847 337.978 156.929 349.788 187.745C356.969 207.111 358.452 228.117 354.063 248.294C349.668 268.47 339.585 286.977 324.993 301.639L296.983 329.54C341.082 398.892 400.237 457.508 470.091 501.067L498.1 473.623C512.816 459.086 531.399 449.042 551.653 444.664C571.907 440.292 592.992 441.769 612.433 448.923C643.404 460.578 675.597 468.71 708.4 473.165C734.389 477.058 758.059 490.263 774.971 510.307C791.877 530.355 800.863 555.855 800.234 582.028V691.805C800.234 720.356 788.879 747.745 768.657 767.976C748.435 788.207 720.991 799.633 692.329 799.752L696.002 800.667ZM218.465 68.8203H108.723C103.335 69.1752 98.0747 70.6147 93.2608 73.0517C88.4464 75.4888 84.1784 78.8731 80.7139 82.9998C77.3427 86.8653 74.7906 91.3707 73.2124 96.2444C71.6343 101.118 71.0622 106.259 71.5305 111.359C82.6649 219.159 118.991 322.862 177.599 414.16C231.627 498.629 303.564 570.291 388.358 624.109C480.068 683.105 584.286 720.063 692.788 732.056C698.431 732.372 704.079 731.521 709.374 729.554C714.668 727.583 719.498 724.541 723.553 720.621C730.863 713.156 734.982 703.153 735.032 692.719V583.4C735.239 573.776 731.896 564.408 725.633 557.072C719.37 549.739 710.622 544.946 701.053 543.606C663.121 538.524 625.86 529.321 589.934 516.161C582.858 513.527 575.176 512.941 567.779 514.483C560.382 516.02 553.577 519.615 548.15 524.852L502.233 570.593C496.856 575.816 489.927 579.173 482.484 580.161C475.036 581.149 467.473 579.718 460.907 576.081C362.929 520.928 281.829 440.301 226.271 342.805C222.468 336.31 220.946 328.735 221.943 321.28C222.941 313.829 226.402 306.916 231.781 301.639L277.698 255.899C282.964 250.594 286.586 243.892 288.133 236.593C289.68 229.293 289.086 221.705 286.422 214.732C273.161 178.962 263.922 141.838 258.872 104.04C257.733 94.2186 252.964 85.1706 245.494 78.6599C238.024 72.1488 228.389 68.6414 218.465 68.8203Z",fill:"black"})))}const a=n.forwardRef(i);r.p;r.d(t,["h",0,a])},9447(e,t,r){var s,n=r(41594);const l=["title","titleId"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}
1).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},o.apply(null,arguments)}function i(e,t){let r=e.title,i=e.titleId,a=function(e,t){if(null==e)return{};var r,s,n=function(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)r=l[s],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,l);return n.createElement("svg",o({width:800,height:800,viewBox:"0 0 800 800",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":i},a),r?n.createElement("title",{id:i},r):null,s||(s=n.createElement("path",{d:"M400 0C179.094 0 0 179.094 0 400C0 620.906 179.094 800 400 800C620.906 800 800 620.906 800 400C800 179.094 620.906 0 400 0ZM269.08 65.0141C230.12 107.388 199.267 168.334 180.4 240.002H77.7328C117.467 160.533 185.733 97.6938 269.08 65.0141ZM40 400C40 357.814 47.9328 317.614 61.3469 280H171.494C164.294 317.959 160 358.067 160 400C160 441.933 164.294 482.041 171.48 520H61.3469C47.9328 482.386 40 442.188 40 400ZM77.7328 560H180.4C199.28 631.667 230.12 692.612 269.08 734.986C185.733 702.306 117.467 639.467 77.7328 560ZM380 758.106C311.547 745.212 252.067 667.106 221.627 560H380V758.106ZM380 520H212.094C204.4 482.241 200 441.88 200 400C200 358.12 204.4 317.759 212.094 280H380V520ZM380 240H221.627C252.067 132.894 311.547 54.7859 380 41.8938V240ZM722.267 240H619.6C600.72 168.333 569.88 107.386 530.92 65.0125C614.267 97.6938 682.533 160.533 722.267 240ZM420 41.8938C488.453 54.7875 547.933 132.894 578.373 240H420V41.8938ZM420 280H587.906C595.6 317.759 600 358.12 600 400C600 441.88 595.6 482.241 587.906 520H420V280ZM420 758.106V560H578.373C547.933 667.106 488.453 745.214 420 758.106ZM530.92 734.986C569.88 692.6 600.72 631.666 619.6 560H722.267C682.533 639.467 614.267 702.306 530.92 734.986ZM628.506 520C635.706 482.041 640 441.933 640 400C640 358.067 635.706 317.959 628.52 280H738.667C752.067 317.614 760 357.814 760 400C760 442.188 752.067 482.386 738.653 520H628.506Z",fill:"black"})))}const a=n.forwardRef(i);r.p;r.d(t,["h",0,a])},27611(e,t,r){r.r(t),r.d(t,{default:()=>ee});var s=r(5544),n=r(74888),l=r(879),o=r.n(l),i=r(41594);const a="block_storeLocator__8Mkd3",c="block_skeleton__FBL4A",d="block_storeLocatorContainer__ZGzD3",u="block_isEditing__9OuT8";var f=r(84066),p=r.n(f),m=r(74117),g=r(31083);const h="style_searchResellerContainer__zjOi6",C="style_searchResellerGeocoder__snz6k",y="style_clearButton__fxwhL",v="style_searchResellerGeoloc__UH0uM";r(84189);const _=r.p+"static/media/cross-icon.9e3f329bea7f4a0b9be068a9d000a43b.svg",x="style_filters__UeQw7",b="style_rangeContainer__-WGh+",w="style_data__cPSs-",L="style_radius__KLCOV",j="style_value__fOLa8",M="style_range__xkCbu";var k=r(89379),E=r(80045),S=r(70579);const B=["value","setValue"],R=e=>{let t=e.value,r=e.setValue,s=(0,E.A)(e,B);const n=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(n.current)if(0===t)n.current.style.backgroundSize="0, 100%";else{const e=n.current.min,t=n.current.max,r=n.current.value;n.current.style.backgroundSize=100*(r-e)/(t-e)+"% 100%"}},[n,t]),(0,S.jsx)("input",(0,k.A)({type:"range",value:t,onChange:e=>r(parseInt(e.target.value)),ref:n},s))},T=e=>{let t=e.map,r=e.featureGeocoder,s=e.radius,n=e.setRadius;const l=(0,m.Bd)().t;return(0,i.useEffect)(()=>{if(!r||!t)return;const e=r.geometry.coordinates,n=0===s?12:12-Math.log(s+1)/Math.log(31)*3;t.easeTo({center:e,zoom:n,duration:1e3})},[r,s,t]),(0,S.jsx)("div",{className:x,id:"map-refocus-point",children:(0,S.jsxs)("div",{className:b,children:[(0,S.jsxs)("div",{className:w,children:[(0,S.jsx)("div",{className:L,children:l("Radius")}),(0,S.jsxs)("div",{className:j,children:[s," km"]})]}),(0,S.jsx)("div",{className:M,children:(0,S.jsx)(R,{value:s,setValue:n,min:0,max:30,step:5})})]})})},O=e=>{let t=e.map,r=e.centerAndResize,n=e.countryCode;const l=(0,i.useRef)(null),a=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useState)(!1),u=(0,s.A)(d,2),f=u[0],x=u[1],b=(0,m.Bd)().t,w=(0,g.Xo)(),L=(0,i.useState)(null),j=(0,s.A)(L,2),M=j[0],k=j[1],E=(0,i.useState)(0),B=(0,s.A)(E,2),R=B[0],O=B[1],H=(0,i.useMemo)(()=>{var e;return new(p())({accessToken:null!==(e=o().accessToken)&&void 0!==e?e:"",placeholder:b("Address, postal code, city")+"...",flyTo:{maxZoom:12},marker:!1,language:w,countries:null!==n&&void 0!==n?n:void 0})},[w,b,n]),P=(0,i.useMemo)(()=>new(o().GeolocateControl)({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!1,showUserHeading:!1,fitBoundsOptions:{maxZoom:12,duration:3e3}}),[]);(0,i.useEffect)(()=>
1{if(!(l.current&&l.current.children.length>0)&&H&&l.current&&t){const e=()=>{c.current&&""!==c.current.value?x(!0):x(!1)};H.on("result",e=>{var t;const s=(null===(t=e.result)||void 0===t?void 0:t.place_name)||"";c.current&&(c.current.value=s),x(!0),r(e),k(e.result)}),P.on("geolocate",r);const s=H.onAdd(t);return l.current.textContent="",l.current.appendChild(s),c.current=l.current.querySelector(".mapboxgl-ctrl-geocoder--input"),c.current.addEventListener("input",e),a.current.appendChild(P.onAdd(t)),()=>{c.current&&c.current.removeEventListener("input",e)}}},[H,l,t,r,a,P]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:h,children:[(0,S.jsx)("div",{className:C,ref:l,children:f&&(0,S.jsx)("button",{className:y,onClick:()=>{c.current&&(c.current.value="",x(!1),H.clear())},children:(0,S.jsx)("img",{src:_,alt:"","aria-hidden":"true"})})}),(0,S.jsx)("div",{className:v,ref:a})]}),(0,S.jsx)(T,{map:t,featureGeocoder:M,radius:R,setRadius:O})]})};var H,P;const N=["title","titleId"];function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}
1).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},A.apply(null,arguments)}function I(e,t){let r=e.title,s=e.titleId,n=function(e,t){if(null==e)return{};var r,s,n=function(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)r=l[s],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,N);return i.createElement("svg",A({width:38,height:39,viewBox:"0 0 38 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},n),r?i.createElement("title",{id:s},r):null,H||(H=i.createElement("g",{clipPath:"url(#clip0_biogents)"},i.createElement("path",{d:"M18.8877 39C29.3191 39 37.7754 30.2696 37.7754 19.5C37.7754 8.73045 29.3191 0 18.8877 0C8.45631 0 0 8.73045 0 19.5C0 30.2696 8.45631 39 18.8877 39Z",fill:"#0080be"}),i.createElement("path",{d:"M10.6533 19.7256C10.6533 19.3459 10.9266 19.0321 11.2812 18.9824L11.3798 18.9756H25.9088C26.31 18.9756 26.6352 19.3114 26.6352 19.7256C26.6352 20.1053 26.3619 20.4191 26.0074 20.4687L25.9088 20.4756H11.3798C10.9786 20.4756 10.6533 20.1398 10.6533 19.7256Z",fill:"#F5F4EF"}),i.createElement("path",{d:"M19.5362 14.2326C19.2519 13.9404 19.2509 13.4655 19.534 13.172C19.7913 12.9051 20.1949 12.88 20.4797 13.0972L20.5613 13.1697L26.4214 19.1937C26.6806 19.4602 26.7042 19.8783 26.4921 20.1723L26.4214 20.2566L20.5614 26.2816C20.2771 26.5739 19.8171 26.5729 19.534 26.2794C19.2766 26.0126 19.254 25.5958 19.4656 25.3027L19.5361 25.2187L24.879 19.7248L19.5362 14.2326Z",fill:"#F5F4EF"}))),P||(P=i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_biogents"},i.createElement("rect",{width:38,height:39,fill:"white"})))))}const Z=i.forwardRef(I);r.p;var z=r(31108),F=r(9447);const V=(e,t)=>{var r;if(!e)return;const s=null===(r=e.getSource("resellers"))||void 0===r?void 0:r._data;s&&(s.features.forEach(e=>{e.properties.selectedId=e.properties.id===t.properties.id?e.properties.id:void 0}),e.getSource("resellers").setData(s))},G=e=>{document.activeElement&&document.activeElement.blur();const t=document.getElementById(e).getBoundingClientRect().top+window.pageYOffset;window.scroll({top:t-68,behavior:"smooth"})};var q=r(95237),W=r(43024);const D={desktopBreakpoint:"1200px",tabletBreakpoint:"992px",mobileBreakpoint:"767px",darkerGreen:"#11391c",darkGreen0:"#146432",darkGreen:"#165227",green:"#06ae5c",green1:"#09a255",lightGreen:"#afc620",darkBrown:"#895f4e",brown:"#996b59",darkBeige:"#e0c6a2",beige:"#eddeca",mediumBeige:"#f4efe9",lightBeige:"#f5f4ef",winter:"#7091ca",spring:"#f0858d",springHover:"#ea6c75",summer:"#ffb100",summerHover:"#ffa700",autumn:"#f75013",autumnHover:"#e0360e",winterHover:"#4f70a8",seasonColor:"var(--seasonColorRoot, #f0858d)",seasonColorHover:"var(--seasonColorHoverRoot, #ea6c75)",biogentsBlue:"#208bec","content-width":"style_content-width__mejZ9","sbm-list":"style_sbm-list__Jm31V","overflow-without-scrollbar":"style_overflow-without-scrollbar__GvXJ8","exceeding-overflow-list":"style_exceeding-overflow-list__4bapV","full-width":"style_full-width__wG3XS",productBuyStickyButtonArea:"style_productBuyStickyButtonArea__NMvjd",storeTileContainer:"style_storeTileContainer__KWpjP",isSelected:"style_isSelected__SeBKe",direction:"style_direction__6fHO4",storeTileImage:"style_storeTileImage__DtX2X",storeTileContent:"style_storeTileContent__4HR1V",storeTileTitle:"style_storeTileTitle__tsJ9E",storeTileAddress:"style_storeTileAddress__SCw2V",storeTileCity:"style_storeTileCity__PWYqo",storeTilePhone:"style_storeTilePhone__V6acl",storeTileWebsite:"style_storeTileWebsite__hDXvG",phoneLogo:"style_phoneLogo__6K4Cr",websiteLogo:"style_websiteLogo__T08m6",rightPart:"style_rightPart__UwiOf"},U=e=>{let t=e.store,r=e.isMain,s=e.setSelectedReseller,n=e.map,l=e.userLocation;const o=(0,m.Bd)().t,i=(0,q.useMediaQuery)({query:"(max-width: 992px)"}),a=(0,q.useMediaQuery)({query:"(max-width: 767px)"});return(0,S.jsxs)("div",{className:(0,W.A)(D.storeTileContainer,r&&D.isSelected),onClick:()=>!r&&(()=>{if(!n)return;V(n,t);const e=i&&!a?t.geometry.coordinates[0]-.15:t.geometry.coordinates[0];n.flyTo({center:[e,t.geometry.coordinates[1]],zoom:12,speed:1}),s(t)})(),children:[(0,S.jsxs)("div",{className:D.storeTileContent,children:[t.properties.title&&(0,S.jsx)("h2",{className:D.storeTileTitle,children:t.properties.title}),t.properties.address&&(0,S.jsx)("p",{className:D.storeTileAddress,children:t.properties.address}),(0,S.jsxs)("p",{className:D.storeTileCity,children:[t.properties.zipcode&&t.properties.zipcode," ",t.properties.city&&t.properties.city]}),t.properties.phone&&(0,S.jsxs)("a",{href:"tel:"+t.properties.phone,className:D.storeTilePhone,children:[(0,S.jsx)(z.h,{className:D.phoneLogo}),(0,S.jsx)("span",{children:t.properties.phone})]}),t.properties.url&&(0,S.jsxs)("a",{href:t.properties.url.startsWith("http")?t.properties.url:"https://".concat(t.properties.url),className:D.storeTileWebsite,children:[(0,S.jsx)(F.h,{className:D.websiteLogo}),(0,S.jsx)("span",{children:o("Website")})]})]}),(0,S.jsxs)("div",{className:D.rightPart,children:[(0,S.jsx)("a",{href:"https://www.google.com/maps?q=".concat(t.geometry.coordinates[1],",").concat(t.geometry.coordinates[0]),target:"_blank",rel:"noreferrer",children:(0,S.jsx)(Z,{className:D.direction})}),l&&(0,S.jsx)("p",{className:D.distance,children:(()=>
1{if(!l)return null;const e=l.latitude*Math.PI/180,r=l.longitude*Math.PI/180,s=t.geometry.coordinates[1]*Math.PI/180,n=s-e,o=t.geometry.coordinates[0]*Math.PI/180-r,i=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e)*Math.cos(s)*Math.sin(o/2)*Math.sin(o/2),a=6371*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)));return a<1?"".concat(Math.round(1e3*a),"m"):"".concat(a.toFixed(1),"km")})()})]})]})},K="style_mapHeader__l6i-m",Q="style_closestResellerList__I7S4A",X="style_loadingResellersList__Yh0cr",J=e=>{let t=e.map,r=e.resellerList,n=e.selectedReseller,l=e.setSelectedReseller,o=e.setPendingCenter,a=e.isLoading,c=e.setIsLoading,d=e.countryCode;const u=(0,i.useState)(!1),f=(0,s.A)(u,2),p=f[0],m=f[1],g=(0,i.useState)(null),h=(0,s.A)(g,2),C=h[0],y=h[1];(0,i.useEffect)(()=>{"geolocation"in navigator&&navigator.geolocation.getCurrentPosition(e=>{y({latitude:e.coords.latitude,longitude:e.coords.longitude})},e=>{console.log("G\xe9olocalisation refus\xe9e ou erreur:",e)})},[]);const v=(0,i.useCallback)(()=>{const e=document.getElementById("closestBiogentsResellerListScroll");if(!e)return;const t=e.scrollHeight>e.clientHeight;m(t)},[]);(0,i.useEffect)(()=>(v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)),[v,r,n,a]);const _=(0,i.useCallback)(e=>{if(t){let r=e.result?e.result.center:[e.coords.longitude,e.coords.latitude];t.flyTo({center:r,zoom:10,speed:1}),o(r),c(!0)}},[t,o,c]);return(0,i.useEffect)(()=>{const e=document.getElementById("closestBiogentsResellerListScroll");e&&e.scrollTo(0,0)},[n]),(0,S.jsxs)("div",{className:K,id:"biogents-resellers-filters",children:[(0,S.jsx)(O,{map:t,centerAndResize:_,countryCode:d}),(0,S.jsx)("div",{className:Q,id:"closestBiogentsResellerListScroll",children:a?(0,S.jsx)("div",{className:X,children:(0,S.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",viewBox:"0 0 38 38",children:(0,S.jsxs)("g",{fill:"none",transform:"translate(1 1)",children:[(0,S.jsx)("circle",{cx:"18",cy:"18",r:"18",stroke:"#0080be"}),(0,S.jsx)("path",{stroke:"#ffffff",d:"M36 18c0-9.94-8.06-18-18-18",children:(0,S.jsx)("animateTransform",{attributeName:"transform",dur:"1s",from:"0 18 18",repeatCount:"indefinite",to:"360 18 18",type:"rotate"})})]})})}):(0,S.jsx)(S.Fragment,{children:(null===r||void 0===r?void 0:r.length)<=0&&null!==n?(0,S.jsx)(U,{isMain:!0,store:n,userLocation:C,withoutPadding:!p}):r.map((e,r)=>(0,S.jsx)(U,{isMain:(null===e||void 0===e?void 0:e.properties.id)===(null===n||void 0===n?void 0:n.properties.id),store:e,setSelectedReseller:l,map:t,userLocation:C}
1,r))})})]})},Y="style_map__HDKuQ",$=e=>{let t=e.setMap,r=e.setResellerList,s=e.setSelectedReseller,n=e.selectedReseller,a=e.geojson,c=e.pendingCenter,d=e.setPendingCenter,u=e.setIsLoading,f=e.seasonColor;const p=(0,m.Bd)().t,h=(0,i.useRef)(null),C=(0,i.useRef)(null),y=(0,q.useMediaQuery)({query:"(max-width: 992px)"}),v=(0,q.useMediaQuery)({query:"(max-width: 767px)"}),_=(0,i.useCallback)(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=document.getElementsByClassName("selectedMarker");for(;n.length>0;)n[0].classList.remove("selectedMarker");if(r){const e=document.getElementById("marker_"+t.id);e&&e.classList.add("selectedMarker")}else e.target.classList.add("selectedMarker");s(t)},[s]),x=(0,i.useCallback)(()=>{if(!a||!a.features||!Array.isArray(a.features)||0===a.features.length)return{minLong:0,minLat:0,maxLong:10,maxLat:10};let e=[],t=[];a.features.forEach(r=>{const s=r.geometry.coordinates;e.push(s[1]),t.push(s[0])});const r=(0,g.qi)(e,.01),s=(0,g.qi)(e,.99),n=(0,g.qi)(t,.01),l=(0,g.qi)(t,.99);let o=0,i=0;return y?(o=Math.abs(s-r)/5,i=Math.abs(l-n)/5):(o=Math.abs(s-r)/3,i=Math.abs(l-n)/3),{minLong:n+i,minLat:r+o,maxLong:l-i,maxLat:s-o}},[a,y]);(0,i.useEffect)(()=>{const e=document.getElementsByClassName("selectedMarker");for(;e.length>0;)e[0].classList.remove("selectedMarker");if(n){const e=document.getElementById("marker_"+n.id);e&&e.classList.add("selectedMarker")}},[n]);const b=(0,i.useCallback)(e=>{if(!a||!a.features||!Array.isArray(a.features))return void r([]);const t=a;if(!Array.isArray(e)||e.length<2||"number"!==typeof e[0]||"number"!==typeof e[1])return void console.error("Invalid coordinates:",e);let s=new l.LngLat(e[0],e[1]),n=t.features.map(e=>({element:e,dist:new l.LngLat(e.geometry.coordinates[0],e.geometry.coordinates[1]).distanceTo(s)})).filter(e=>e.dist<=2e4).sort((e,t)=>e.dist-t.dist);r(n.map(e=>e.element)),G("biogents-resellers-map")},[r,a]);return(0,i.useEffect)(()=>{if(!h.current)return;const e=h.current.getSource("resellers");e&&a&&a.features&&e.setData(a)},[a]),(0,i.useEffect)(()=>{if(!h.current)return;const e=()=>{c&&(b(c),d(null)),u(!1)};return h.current.on("moveend",e),()=>{h.current.off("moveend",e)}},[c,b,d,u]),(0,i.useEffect)(()=>{if(!a||h.current)return;const e=document.createElement("div"),s=x();h.current=new(o().Map)({container:e,accessToken:o().accessToken,cooperativeGestures:!0,bounds:[[s.minLong,s.minLat],[s.maxLong,s.maxLat]],style:"mapbox://styles/margauxmassonnat/clbowth0o001814qrf70ppnfr",locale:{"ScrollZoomBlocker.CtrlMessage":p("Use ctrl + scroll to zoom in on the map"),"ScrollZoomBlocker.CmdMessage":p("Use \u2318 + scroll to zoom in on the map")}}),e.style.width="100%",e.style.height="100%",h.current.on("load",()=>{h.current.resize()}),C.current.appendChild(h.current.getContainer()),h.current.dragRotate.disable(),h.current.touchZoomRotate.disableRotation();const n=a;h.current.on("load",()=>{h.current.addSource("resellers",{type:"geojson",data:n,cluster:!0,clusterMaxZoom:11,clusterRadius:67}),h.current.addLayer({id:"cluster",type:"circle",source:"resellers",filter:["has","point_count"],paint:{"circle-color":"#0080be","circle-radius":32}}),h.current.on("click","cluster",function(e){h.current.flyTo({center:e.lngLat,zoom:h.current.getZoom()+2})}),h.current.addLayer({id:"cluster-count",type:"symbol",source:"resellers",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-size":18},paint:{"text-color":"white"}}),h.current.addLayer({id:"resellers-unclustered-points",type:"circle",source:"resellers",filter:["!",["has","point_count"]],paint:{"circle-color":["case",["==",["get","id"],["coalesce",["get","selectedId"],-1]],"#0080be","#ffffff"],"circle-radius":5,"circle-stroke-color":["case",["==",["get","id"],["coalesce",["get","selectedId"],-1]],"#ffffff","#0080be"],"circle-stroke-width":10}}),h.current.on("click","resellers-unclustered-points",e=>{const t=e.features[0].geometry.coordinates,s=e.features[0];V(h.current,s),r(e=>e.some(e=>e.properties.id===s.properties.id)?e:[s]),_(e,s,!0);const n=y&&!v?parseFloat(t[0].toFixed(2))-.15:parseFloat(t[0].toFixed(2));h.current.easeTo({center:[n,parseFloat(t[1].toFixed(2))],curve:.1}),G("biogents-resellers-filters")})}),t(h.current)},[h,t,a,_,x,p,y,f,v,r]),(0,S.jsx)("div",{className:Y,id:"biogents-resellers-map",ref:C})},ee=(0,n.defineBlock)({Block:e=>
1{let t=e.mapboxKey,r=e.geojson,l=e.countryCode,f=e.seasonColor,p=e.pluginBiogentsResellerActive;const m=(0,n.useEditor)().isEditing;o().accessToken=t;const g=(0,i.useState)(null),h=(0,s.A)(g,2),C=h[0],y=h[1],v=(0,i.useState)(null),_=(0,s.A)(v,2),x=_[0],b=_[1],w=(0,i.useState)([]),L=(0,s.A)(w,2),j=L[0],M=L[1],k=(0,i.useState)(null),E=(0,s.A)(k,2),B=E[0],R=E[1],T=(0,i.useState)(!1),O=(0,s.A)(T,2),H=O[0],P=O[1];return(0,S.jsx)(n.BlockWrapper.Div,{className:a,children:m?(0,S.jsxs)("div",{className:u,children:[(0,S.jsx)("p",{children:"Store locator map will be here."}),(0,S.jsx)("p",{children:'Please activate "SBM - Biogents Reseller" and import your resellers to see the map on front.'})]}):p?t&&r?(0,S.jsxs)("div",{className:d,children:[(0,S.jsx)(J,{map:x,resellerList:j,selectedReseller:C,setSelectedReseller:y,setPendingCenter:R,isLoading:H,setIsLoading:P,countryCode:l}),(0,S.jsx)($,{setMap:b,setResellerList:M,setSelectedReseller:y,selectedReseller:C,geojson:r,pendingCenter:B,setPendingCenter:R,setIsLoading:P,seasonColor:f})]}):(0,S.jsx)("div",{className:c}):(0,S.jsx)(S.Fragment,{})})},smartProps:{},setup:{title:"Biogents Store locator"}})}}]); 2//# sourceMappingURL=block-biogents-store-locator.5cff735b.chunk.js.map
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.