PageSourceSearch

https://www.vivaldisinterim.be/_next/static/chunks/6213.c1ee8fe2f2393caf.js

js vivaldisinterim.be collected 2026-10-09 00:26:18 UTC 6,665 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6213],{8594:(e,t,n)=>{n.r(t),n.d(t,{NewLocationInput:()=>g});var o=n(29227),a=n(63035),r=n(31980),i=n(70027),l=n(57383),s=n(95268),c=n(95682),u=n(48688),d=n(34383),p=n(82399);let g=({allowCurrentLocation:e=!0,i18n:t,className:n,inputClassName:g,inputName:m,locale:f,onSelectValue:h,...v})=>{let{t:x}=(0,p.B)(f),[b,y]=(0,a.useState)(!1),[w,_]=(0,a.useState)(""),[j,N]=(0,a.useState)(!1),{gmapsApiIsLoaded:S}=(0,d.a)(),{watch:O,setValue:k,register:C}=(0,i.xW)(),A=C(m),I=v.id??m,{init:P,suggestions:{data:G},setValue:E,clearSuggestions:K}=(0,l.Ay)({initOnMount:!1,requestOptions:{language:f,region:"be",componentRestrictions:{country:"be"},types:["neighborhood","locality","postal_code","sublocality"]},debounce:300}),M=O(m);(0,a.useEffect)(()=>{_(M)},[M]),(0,a.useEffect)(()=>{S&&P()},[S,P]);let R=G.map(e=>{let{place_id:t,structured_formatting:{main_text:n,secondary_text:o}}=e;return{place_id:t,main_text:n,secondary_text:o}});return(0,o.jsx)("div",{className:(0,u.cn)("flex items-center",n),children:(0,o.jsxs)(r.G3,{as:"div",className:"relative flex w-full",onChange:e=>{y(!0);let t=R.find(t=>t.main_text===e);if(!t?.place_id)return!1;let n=(parseInt(t.main_text)?t.secondary_text:t.main_text)??e;E(n,!1),k(m,n),_(n),(0,l.fx)({placeId:t?.place_id}).then(e=>{let{lat:t,lng:o}=(0,l.rg)(e[0]);h&&h({latitude:t,longitude:o,location:n}),y(!1)}).catch(e=>{console.error(e),y(!1)}),K()},value:w??"",immediate:e,children:[(0,o.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-[2] flex items-center pl-4",children:(0,o.jsx)(s.A,{name:b?"loader":"map-pin",className:(0,u.cn)("h-5 w-5 text-gray-400",b&&"animate-spin"),"aria-hidden":"true"})}),(0,o.jsx)(r.G3.Input,{placeholder:t.placeholder,className:(0,u.cn)("form-input pl-12",g),autoComplete:"off",onChange:e=>{let t=e.target.value.toString()||"";E(t),k(m,t)},id:I}),(0,o.jsx)("input",{type:"hidden",...A}),(0,o.jsxs)(r.G3.Options,{className:(0,u.cn)("absolute inset-x-0 top-full z-20 max-h-72 min-w-[300px] scroll-py-2 overflow-y-auto border bg-white px-6 pb-2 pt-4 text-sm text-gray-800 shadow-lg",!R.length&&"pb-4"),children:[e&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("li",{className:(0,u.cn)("flex items-center gap-2",R.length&&"mb-3"),children:[(0,o.jsx)(s.A,{name:"location",className:"h-4 w-4 flex-shrink-0 text-gray-400","aria-hidden":"true"}),(0,o.jsx)("button",{type:"button",className:"link text-left text-sm",onClick:()=>{y(!0),navigator.permissions.query({name:"geolocation"}).then(e=>{"denied"===e.state?(N(!0),y(!1)):(N(!1),navigator.geolocation.getCurrentPosition(e=>{let t=e.coords.latitude,n=e.coords.longitude;(0,l.fx)({location:{lat:t,lng:n}}).then(e=>{let o=e[0].address_components[2].long_name;E(o,!1),k(m,o),_(o),h&&h({latitude:t,longitude:n,location:o}),y(!1)}).catch(e=>{console.error(e),E(""),_(""),k(m,""),h&&h({latitude:t,longitude:n,location:""}),y(!1)})},e=>{console.error(e),1===e.code&&N(!0),y(!1)}))})},children:t.use_current_location})]}),j&&(0,o.jsx)("li",{className:"mt-2",children:(0,o.jsx)(c.F,{type:"warning",title:x("components.new_location_input.geolocation_denied_title"),message:x("components.new_location_input.geolocation_permission_denied")})})]}),R.map(({main_text:e,secondary_text:t,place_id:n})=>(0,o.jsxs)(r.G3.Option,{value:`${e}`,className:({active:e})=>(0,u.cn)("cursor-pointer select-none border-b py-2 transition-colors last:border-b-0",e&&"text-green"),children:[(0,o.jsx)("strong",{children:e})," ",(0,o.jsx)("span",{children:t})]},n))]})]})})}},34383:(e,t,n)=>{n.d(t,{a:()=>i});var o=n(4690);let a=n(40978)._.NEXT_PUBLIC_GMAPS_API_KEY,r=["places","geocoding"],i=()=>{let{isLoaded:e}=(0,o.KD)({id:"google-map-script",googleMapsApiKey:a,libraries:r});return{gmapsApiIsLoaded:e}}},57383:(e,t,n)=>{n.d(t,{Ay:()=>l,fx:()=>s,rg:()=>c});var o=n(63035);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}var r=function(e){var t=(0,o.useRef)(e);return t.current=e,t},i=function(e,t){var n;return function(){for(var o=this,a=arguments.length,r=Array(a),i=0;i<a;i++)r[i]=arguments[i];null!==n&&(clearTimeout(n),n=null),n=setTimeout(function(){return e.apply(o,r)},t)}},l=function(e){var t=void 0===e?{}:e,n=t.requestOptions,l=t.debounce,s=t.cache,c=void 0===s?86400:s,u=t.cacheKey,d=void 0===u?"upa":u,p=t.googleMaps,g=t.callbackName,m=t.defaultValue,f=t.initOnMount,h=void 0===f||f,v=(0,o.useState)(!1),x=v[0],b=v[1],y=(0,o.useState)(void 0===m?"":m),w=y[0],_=y[1],j=(0,o.useState)({loading:!1,status:"",data:[]}),N=j[0],S=j[1],O=(0,o.useRef)(),k=r(n),C=r(p),A=(0,o.useCallback)(function(){if(!O.current){var e,t=window.google,n=C.current,o=(null==n?void 0:n.places)||(null==t||null==(e=t.maps)?void 0:e.places);if(!o)return void console.error("\uD83D\uDCA1 use-places-autocomplete: Google Maps Places API library must be loaded. See: https://github.com/wellyshen/use-places-autocomplete#load-the-library");
1O.current=new o.AutocompleteService,b(!0)}},[C]),I=(0,o.useCallback)(function(){S({loading:!1,status:"",data:[]})},[]),P=(0,o.useCallback)(function(e){void 0===e&&(e=d);try{sessionStorage.removeItem(e)}catch(e){}},[d]),G=(0,o.useCallback)(i(function(e){if(!e)return void I();S(function(e){return a({},e,{loading:!0})});var t,n={};try{n=JSON.parse(sessionStorage.getItem(d)||"{}")}catch(e){}c&&(n=Object.keys(n).reduce(function(e,t){return n[t].maxAge-Date.now()>=0&&(e[t]=n[t]),e},{}))[e]?S({loading:!1,status:"OK",data:n[e].data}):null==(t=O.current)||t.getPlacePredictions(a({},k.current,{input:e}),function(t,o){if(S({loading:!1,status:o,data:t||[]}),c&&"OK"===o){n[e]={data:t,maxAge:Date.now()+1e3*c};try{sessionStorage.setItem(d,JSON.stringify(n))}catch(e){}}})},void 0===l?200:l),[c,d,I,k]),E=(0,o.useCallback)(function(e,t){void 0===t&&(t=!0),_(e),O.current&&t&&G(e)},[G]);return(0,o.useEffect)(function(){if(!h)return function(){return null};var e=window.google;return C.current||null!=e&&e.maps||!g?A():window[g]=A,function(){window[g]&&delete window[g]}},[g,C,A,h]),{ready:x,value:w,suggestions:N,setValue:E,clearSuggestions:I,clearCache:P,init:A}},s=function(e){var t=new window.google.maps.Geocoder;return new Promise(function(n,o){t.geocode(e,function(t,a){"OK"!==a&&o(a),!e.address&&e.componentRestrictions&&(console.error("\uD83D\uDCA1 use-places-autocomplete: Please provide an address when using getGeocode() with the componentRestrictions."),n(t)),n(t)})})},c=function(e){var t=e.geometry.location,n=t.lat,o=t.lng;return{lat:n(),lng:o()}}}}]);
2//# sourceMappingURL=6213.c1ee8fe2f2393caf.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.