https://m-immo-omnicasa.vercel.app/_next/static/chunks/organimmo-periods-section.e0c7fbcfe2ca3e5c.js
1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="659e1fe0-342f-4bc1-8469-a9d0e893a832",e._sentryDebugIdIdentifier="sentry-dbid-659e1fe0-342f-4bc1-8469-a9d0e893a832")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9911],{71435:(e,s,a)=>{a.r(s),a.d(s,{default:()=>v});var i=a(95155),l=a(12115),r=a(10412),d=a(78285),t=a(47694),n=a(74033),c=a(9339);let o=(0,c.createServerReference)("70b408e681a0f8cbc332382408cf3956e83b4a2a04",c.callServer,void 0,c.findSourceMapURL,"bookingRequest");var m=a(4948),h=a(51287),x=a(91993),g=a(92477),j=a(91279),u=a(26897);let N=e=>{let{periods:s,module:a,property:c,dictionary:N,tenantId:b}=e,[v,y]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),[T,E]=(0,l.useState)(null),w=N.LANG,D=a.numberOfMonths?a.numberOfMonths:0,A=e=>(0,h.GP)(e,"HH:mm",{locale:"fr"===w?j.fr:u.nl}),I=e=>(0,h.GP)(e,"EEEE d MMMM yyyy",{locale:"fr"===w?j.fr:u.nl});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-xl font-bold mb-3",children:N.AVAILABLE_PERIODS}),(0,i.jsx)("hr",{className:"inline-block border-0 clear-both h-px bg-secondary mb-6 w-32"}),(0,i.jsx)("div",{className:"grid grid-cols-1 gap-12 lg:grid-cols-2",children:s.filter(e=>{if(!(D>0))return!0;{var s;let a=function(e,s){let a=(0,g.a)(e,void 0);if(isNaN(s))return(0,x.w)(e,NaN);if(!s)return a;let i=a.getDate(),l=(0,x.w)(e,a.getTime());return(l.setMonth(a.getMonth()+s+1,0),i>=l.getDate())?l:(a.setFullYear(l.getFullYear(),l.getMonth(),i),a)}(new Date,D);return s=e.beginDateTime,+(0,g.a)(s)<+(0,g.a)(a)}}).map(e=>{let s=I(e.beginDateTime),a=I(e.endDateTime),l=A(e.beginDateTime),d=A(e.endDateTime),t=(0,m.vv)(e.totalPrice);return(0,i.jsxs)("div",{className:"bg-white border rounded-lg shadow-lg p-6",children:[(0,i.jsxs)("div",{className:"flex justify-between",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"font-semibold",children:N.FROM}),(0,i.jsxs)("div",{className:" text-gray-600",children:[s," ",N.AT," ",l]}),(0,i.jsx)("div",{className:"font-semibold mt-2",children:N.UNTILL}),(0,i.jsxs)("div",{className:" text-gray-600",children:[a," ",N.AT," ",d]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"font-semibold",children:N.NUMBER_OF_PEOPLE}
1),(0,i.jsx)("div",{className:"text-gray-600",children:c.maxPerson})]})]}),(0,i.jsx)("hr",{className:"my-6"}),(0,i.jsxs)("div",{className:"flex justify-between items-center",children:[(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"font-bold text-xl",children:t})}),(0,i.jsx)("div",{children:(0,i.jsx)(r.default,{type:"secondary",onClick:()=>{p(e),y(!0)},children:N.BOOK_NOW})})]})]},e.id)})})]}),(0,i.jsx)(t.D,{isVisible:v,onClose:()=>{y(!1)},title:N.BOOK_NOW,children:(0,i.jsxs)("div",{className:"max-w-3xl",children:[(0,i.jsx)("div",{className:"col-span-2",dangerouslySetInnerHTML:{__html:N.ORGANIMMO_FORM_TEXT}}),(0,i.jsx)("hr",{className:"my-6"}),f&&(0,i.jsxs)("div",{className:"mb-6 grid grid-cols-2 gap-6",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"font-semibold mt-2",children:N.FROM}),(0,i.jsxs)("div",{className:" text-gray-600",children:[I(f.beginDateTime)," ",N.AT," ",A(f.beginDateTime)," "]}),(0,i.jsx)("div",{className:"font-semibold mt-2",children:N.UNTILL}),(0,i.jsxs)("div",{className:" text-gray-600",children:[I(f.endDateTime)," ",N.AT," ",A(f.endD
1ateTime)]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"font-semibold mt-2",children:N.NUMBER_OF_PEOPLE}),(0,i.jsx)("div",{className:"text-gray-600",children:c.maxPerson})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"font-semibold mt-2",children:N.TOTAL_PRICE}),(0,i.jsx)("div",{className:"text-gray-600",children:(0,m.vv)(f.totalPrice)})]})]})]}),(0,i.jsx)("hr",{className:"my-6"}),(0,i.jsxs)("form",{action:async e=>{E(null);let s={BookingDateTime:new Date().toISOString(),RentalUnitID:c.unitId,RentalUnitPeriodID:f.periodId,TotalRentalUnitPeriod:f.totalPrice,BookerName:e.get("FirstName")+" "+e.get("Name"),BookerAdress:e.get("Address"),BookerPostalcode:e.get("Zip"),BookerCity:e.get("City"),BookerCountry:"Belgium",BookerLanguage:w.slice(0,1),BookerPhone:e.get("PhoneNumber"),BookerEmail:e.get("Email")},a=await o(b,s,w);(null==a?void 0:a.status)==="failed"&&E("bot_rejected"===a.errorCode?N.BOT_BLOCKED||"We could not verify this request. Please try another browser or disable your VPN.":N.FORM_FAILED||"The form could not be sent. Please try again or contact us.")},children:[(0,i.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,i.jsx)("div",{className:"",children:(0,i.jsx)(d.A,{placeholder:N.FIRST_NAME,id:"firstname",name:"FirstName",required:!0})}),(0,i.jsx)("div",{className:"",children:(0,i.jsx)(d.A,{placeholder:N.NAME,id:"name",name:"Name",required:!0})}),(0,i.jsx)("div",{className:"",children:(0,i.jsx)(d.A,{placeholder:N.EMAIL,id:"email",name:"Email",required:!0})}),(0,i.jsx)("div",{className:"",children:(0,i.jsx)(d.A,{placeholder:N.PHONE_NUMBER,id:"phone",name:"PhoneNumber",type:"tel",required:!0})}),(0,i.jsx)("div",{className:"md:col-span-2",children:(0,i.jsx)(d.A,{placeholder:N.ADDRESS,id:"address",name:"Address",required:!0})}),(0,i.jsx)("div",{children:(0,i.jsx)(d.A,{placeholder:N.ZIP,id:"zip",name:"Zip",required:!0})}),(0,i.jsx)("div",{children:(0,i.jsx)(d.A,{placeholder:N.CITY,id:"city",name:"City",required:!0})})]}),(0,i.jsx)("div",{className:"mt-6",children:(0,i.jsxs)("p",{children:[N.PRIVACY_STATEMENT_TEXT," ",(0,i.jsx)("a",{href:"",children:N.PRIVACY_STATEMENT})]})}),(0,i.jsxs)("div",{className:"mt-6 mx-auto max-w-sm",children:[T&&(0,i.jsx)("p",{role:"alert",className:"text-red-500 text-sm mb-3 text-center",children:T}),(0,i.jsx)(n.A,{type:"primary",isBlock:!0,label:N.SUBMIT,children:N.SUBMIT})]})]})]})},"mainmodel"+c.ID)]})},b=()=>(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"mb-3 h-7 w-48 animate-pulse rounded bg-gray-200"}),(0,i.jsx)("hr",{className:"inline-block mb-6 h-px w-32 border-0 bg-gray-200"}),(0,i.jsx)("div",{className:"grid grid-cols-1 gap-12 lg:grid-cols-2",children:[void 0,void 0].map((e,s)=>(0,i.jsxs)("div",{className:"animate-pulse rounded-lg border bg-white p-6 shadow-lg",children:[(0,i.jsx)("div",{className:"mb-4 h-5 w-24 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"mb-2 h-4 w-full rounded bg-gray-200"}),(0,i.jsx)("div",{className:"mb-4 h-4 w-3/4 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"my-6 h-px bg-gray-200"}),(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("div",{className:"h-7 w-24 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-10 w-32 rounded-full bg-gray-200"})]})]},s))})]}),v=e=>{let{module:s,property:a,dictionary:r,tenantId:d,lang:t}=e,[n,c]=(0,l.useState)(null),[o,m]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{let e=!1;return(async()=>{m(!1),c(null);try{let s=new URLSearchParams({tenantId:d,rentalUnitId:String(a.id),lang:t}),i=await fetch(`/api/organimmo/periods?${s}`,{cache:"no-store"});if(!i.ok)throw Error("Failed to load periods");let l=await i.json();e||c((l.periods||[]).map(e=>({...e,beginDateTime:new Date(e.beginDateTime),endDateTime:new Date(e.endDateTime)})))}catch{e||(m(!0),c([]))}})(),()=>{e=!0}},[d,a.id,t]),null===n)?(0,i.jsx)(b,{}):o?(0,i.jsx)("div",{className:"text-center text-gray-500 py-8",children:r.NO_PROPERTIES||"Unable to load available periods."}):(0,i.jsx)(N,{module:s,property:a,periods:n,dictionary:r,tenantId:d})}}}]);
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.