1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7722],{34444:(e,t,a)=>{a.d(t,{l:()=>n});var r=a(85664),l=a(8173),s=a(74348),i=a(96777);let n=e=>{var t,a;let{error:n,hideIcons:o,label:d,onChange:c,options:u,simple:m=!1,size:p="default",theme:x="beam",value:b,ref:h,...f}=e,v=null==(t=u.find(e=>e.value===b))?void 0:t.text,g=null==(a=u.find(e=>""===e.value))?void 0:a.text,y=null!=g?g:d;return(0,r.jsxs)("div",{className:(0,i.cn)("relative transition-all",n&&!m&&"mb-38",!(n||m)&&"mb-2"),children:[!m&&(0,r.jsx)("div",{className:(0,i.cn)("group absolute flex items-center justify-between border-warning/10 border-x border-b bg-warning/5 px-10 py-5 text-11 text-warning shadow-sm transition-all duration-300",n&&"visible top-full opacity-100",!n&&"invisible top-0 opacity-0","beam"===x||"duplex"===x?"left-10 rounded-b-6":"inset-x-0"),children:null==n?void 0:n.message}),(0,r.jsxs)(l.bL,{onValueChange:c,value:b,...f,children:[(0,r.jsxs)(l.l9,{"aria-label":y,className:(0,i.cn)("group relative flex w-full appearance-none items-center justify-between border-2 bg-absolute-white text-left text-black tracking-[0.4px] shadow-none outline-none transition-all duration-300 placeholder:text-placeholder focus:z-20 focus:shadow-input-focus focus:outline-none",!(n||m)&&"border-bordergray ring-0 ring-green-1/20 hover:border-green-1 hover:ring-2 focus:border-green-2 focus:ring-4 focus:ring-green-1/20 aria-[expanded=true]:border-green-2 aria-[expanded=true]:ring-4 aria-[expanded=true]:ring-green-1/20",n&&!m&&"border-warning/40 ring-2 ring-warning/20 focus:border-warning/60 focus:ring-4 focus:ring-warning/20",m&&"border-white ring-secondary/40 hover:z-30 hover:ring-1 aria-[expanded=true]:z-30 aria-[expanded=true]:ring-2","beam"===x&&"rounded-8 text-16 leading-[24px]",("apex"===x||"chalet"===x||"gable"===x)&&!m&&"default"===p&&"text-18 leading-[28px]","fascia"===x&&!m&&"default"===p&&"text-18 leading-[28px] lg:leading-[34px]",("apex"===x||"chalet"===x||"fascia"===x||"gable"===x)&&m&&"text-16 leading-[21px]","small"===p&&"text-14 leading-[24px]","duplex"!==x&&"default"===p&&"py-10","duplex"!==x&&"View"!==d&&"pr-10 pl-14","duplex"===x&&"rounded-10 pt-29 pb-7 text-15","duplex"===x&&"View"!==d&&"pr-12 pl-14"),ref:h,children:["duplex"===x&&(0,r.jsx)("span",{className:"pointer-events-none absolute inset-x-14 top-0 pt-8 font-semibold text-12 text-black tracking-[0.3px]",dangerouslySetInnerHTML:{__html:d}}),(0,r.jsxs)("span",{className:(0,i.cn)("flex w-full items-center justify-between truncate","duplex"===x?"font-medium text-black/60":""!==b?"text-black":"text-black/60"),children:[(0,r.jsx)(l.WT,{"aria-label":b,placeholder:y,children:v}),(0,r.jsx)(l.In,{className:(0,i.cn)("text-primary","beam"!==x&&"chalet"!==x&&"duplex"!==x&&"absolute inset-y-0 right-0 flex w-49 items-center justify-center bg-absolute-white","beam"!==x&&"chalet"!==x&&"duplex"!==x&&"fascia"!==x&&!m&&"border-bordergray border-l",m&&"!text-secondary"),children:(0,r.jsx)(s.I,{className:(0,i.cn)("beam"===x||"chalet"===x?"size-20":"size-15 lg:size-20","beam"!==x&&"transition-transform group-aria-[expanded=true]:rotate-180"),name:"lucide/chevron-down"})})]})]}),(0,r.jsx)(l.ZL,{children:(0,r.jsx)(l.UC,{className:(0,i.cn)("relative z-150","beam"!==x&&"w-[var(--radix-select-trigger-width)]"),position:"beam"===x?"item-aligned":"popper",children:(0,r.jsx)(l.LM,{className:(0,i.cn)("max-h-[420px] max-w-[96vw] border border-bordergray shadow-duplexselect","fascia"===x||"gable"===x?"bg-gray-1":"bg-tertiary","beam"===x?"rounded-15 p-8":"duplex"===x?"rounded-10 p-4":"p-2"),children:(0,r.jsx)(l.YJ,{children:u.filter(e=>""!==e.value).map(e=>(0,r.jsxs)(l.q7,{className:(0,i.cn)("hover:!text-white focus:!text-white relative cursor-pointer radix-disabled:cursor-not-allowed overflow-hidden border-b bg-white py-10 pr-20 pl-30 radix-disabled:text-black/40 text-16 leading-[1.33] last:border-b-0 hover:bg-secondary focus:bg-secondary focus:outline-none","beam"===x&&"first:rounded-t-10 last:rounded-b-10","duplex"===x&&"first:rounded-t-8 last:rounded-b-8",("apex"===x||"chalet"===x||"fascia"===x||"gable"===x)&&"radix-disabled:hidden","fascia"!==x?"border-tertiary":"border-gray","gable"===x&&"!border-bordergray","all-houses"===e.value&&"peer",("detached-house"===e.value||"semi-detached-house"===e.value||"terraced-house"===e.value)&&"peer-sibling"),disabled:""===e.value,value:e.value,children:[(0,r.jsx)(l.p4,{children:"Property Type"!==d||"0"===e.value||o?e.text:(0,r.jsxs)("div",{className:"flex w-full items-center justify-between font-body",children:[e.text,(0,r.jsxs)("div",{className:"relative flex w-26 items-center justify-center lg:w-30",children:["all-houses"===e.value&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.I,{className:"h-21 w-24",name:"custom/detached"}),(0,r.jsx)("span",{className:"-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2",children:(0,r.jsx)(s.I,{className:"h-13 w-16",name:"lucide/check"})})]}),"detached-house"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-24",name:"custom/detached"}),"semi-detached-house"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-24",name:"custom/semi-detached"}),"terraced-house"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-26",name:"custom/terraced"}),"flat"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-16",name:"custom/flat"}),"studio"===e.value&&(0,r.jsx)(s.I,{className:"h-28 w-22",name:"custom/studio"}),"bungalow"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-30",name:"custom/bungalow"}),"land"===e.value&&(0,r.jsx)(s.I,{className:"h-23 w-26",name:"custom/land"}),"commercial"===e.value&&(0,r.jsx)(s.I,{className:"h-21 w-26",name:"custom/commercial"}),"student-let"===e.value&&(0,r.jsx)(s.I,{className:"h-30 w-30",name:"custom/student-let"}),"park-homes"===e.value&&(0,r.jsx)(s.I,{className:"h-26 w-32",name:"custom/park-homes"})]})]})}),(0,r.jsx)(l.VF,{className:"absolute inset-y-0 left-8 inline-flex items-center",children:(0,r.jsx)(s.I,{className:"size-[1em]",name:"lucide/check"})}),"Property Type"===d&&(0,r.jsx)("div",{className:(0,i.cn)("-translate-x-full absolute inset-y-0 left-0 w-4 bg-secondary transition-transform",("detached-house"===e.value||"semi-detached-house"===e.value||"terraced-house"===e.value)&&"peer-hover-sibling:translate-x-0")})]},e.value))})})})})]})]})};n.displayName="Select"},57722:(e,t,a)=>{a.r(t),a.d(t,{SuperControlBooking:()=>v});var r=a(85664),l=a(89309),s=a(63276),i=a(81367),n=a(16172),o=a(72578),d=a(34444),c=a(54055),u=a(96777),m=a(46105),p=a(15179);function x(e){let t=e.getDate().toString().padStart(2,"0"),a=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return"".concat(t,"/").concat(a,"/").concat(r.toString())}function b(e,t){return Math.floor((t.getTime()-e.getTime())/864e5)}function h(e,t){if(-1===e.findIndex(e=>e===t))return -1;let a=e.findIndex((e,t)=>t>0&&0!==e),r=e.slice(a+1).findIndex(e=>e===t);return -1!==r?a+1+r:-1}function f(e){let{children:t,disabled:a,price:l}=e;return(0,r.jsxs)("div",{className:"relative size-full","data-price":l,children:[t,!!l&&!a&&(0,r.jsx)("div",{className:"-bottom-2 pointer-events-none absolute inset-x-0 p-4 text-center font-medium text-8",children:(0,p.$g)(l)})]})}function v(e){var t,a,v,g;let{holidayLetData:y,property:w,theme:N}=e,{availabilities:j,defaultDaysWithPrices:D,defaultDisabledDays:k,lastAvailable:I}=y,S=(0,l.useSearchParams)(),C=S.get("arrivalDate"),z=S.get("departureDate"),T=S.get("guests")||"2",_=c.U.use.listingsPathSet();(0,s.useEffect)(()=>{let e="/holiday-lets";(C||z||T)&&(e="/holiday-lets/?",C&&(e+="arrivalDate=".concat(C,"&")),z&&(e+="departureDate=".concat(z,"&")),T&&"2"!==T&&(e+="guests=".concat(T,"&")),e=e.slice(0,-1)),_(e)},[]);let F=D.map(e=>
1{let t=e.prices[Number(T)]||e.prices[Number(T)+1]||e.prices[Number(T)+2]||e.prices[Number(T)+3]||e.prices[Number(T)+4]||e.prices[Number(T)+5];return{date:e.date,price:(null==t?void 0:t.prices.find(e=>0!==e))||0}}),G=null;if(C){let e=new Date(C),t=j.find(t=>(0,m.Fn)(t.date,e));if(t){let a=null==(g=t.prices[Number(T)]||t.prices[Number(T)+1]||t.prices[Number(T)+2]||t.prices[Number(T)+3]||t.prices[Number(T)+4]||t.prices[Number(T)+5])?void 0:g.prices,r=(null==a?void 0:a.some(e=>e>0))&&a?h(a,0):null==a?void 0:a.findIndex(e=>0===e),l=r&&-1!==r?null==a?void 0:a.slice(0,r):a,s=(null==l?void 0:l.length)||0,i=new Date(t.date.getTime());i.setDate(i.getDate()+s-1),G=null==l?void 0:l.map((t,a)=>{let r=new Date(e.getTime());return r.setDate(r.getDate()+a+1),{date:r,price:t}})}}let[L,M]=(0,s.useState)({from:C?new Date(C):void 0,to:z?new Date(z):void 0}),[B,V]=(0,s.useState)(),[E,O]=(0,s.useState)(k),[P,$]=(0,s.useState)(G&&G.length>0?G:F),[U,Y]=(0,s.useState)(T||"2"),q=Array.from({length:w.capacity},(e,t)=>({text:(t+1).toString(),value:(t+1).toString()}));return(0,s.useEffect)(()=>{if(L.from instanceof Date){let t=new Date(L.from),a=j.find(e=>(0,m.Fn)(e.date,t));if(a){var e;let r=null==(e=a.prices[Number(U)]||a.prices[Number(U)+1]||a.prices[Number(U)+2]||a.prices[Number(U)+3]||a.prices[Number(U)+4]||a.prices[Number(U)+5])?void 0:e.prices,l=(null==r?void 0:r.some(e=>e>0))&&r?h(r,0):null==r?void 0:r.findIndex(e=>0===e),s=l&&-1!==l?null==r?void 0:r.slice(0,l):r,i=(null==s?void 0:s.length)||0,n=new Date(a.date.getTime());n.setDate(n.getDate()+i-1);let o=null==s?void 0:s.map((e,a)=>{let r=new Date(t.getTime());return r.setDate(r.getDate()+a+1),{date:r,price:e}}),d=[{before:t},{after:n},...((null==o?void 0:o.filter(e=>0===e.price))||[]).map(e=>e.date)];$(o||[]),O(d),V(n)}}},[U]),(0,r.jsx)("div",{className:(0,u.cn)("flex flex-wrap justify-center border border-bordergray bg-white p-24","duplex"===N?"rounded-20 shadow-testimonial ring-gray transition-all hover:shadow-none hover:ring-4 hover:ring-offset-2":"shadow-header","beam"===N&&"rounded-12 ring-gray transition-all hover:ring-4 hover:ring-offset-2"),children:(0,r.jsxs)("div",{className:"flex w-full flex-wrap justify-center",children:[(0,r.jsxs)("div",{className:"mb-10 flex w-full border-gray border-b text-center",children:[(0,r.jsxs)("div",{className:"w-1/3 px-5 pb-15",children:[(0,r.jsx)("p",{className:"font-bold text-12 uppercase",children:"Check in"}),(0,r.jsx)("div",{className:"pt-10 text-12 text-primary",children:(null==(t=L.from)?void 0:t.toLocaleDateString("en-GB",{day:"numeric",month:"short",weekday:"short",year:"numeric"}))||"Select a date"})]}),(0,r.jsxs)("div",{className:"w-1/3 border-bordergray border-x px-5 pb-15",children:[(0,r.jsx)("p",{className:"font-bold text-12 uppercase",children:"Check out"}),(0,r.jsx)("div",{className:"pt-10 text-12 text-primary",children:(null==(a=L.to)?void 0:a.toLocaleDateString("en-GB",{day:"numeric",month:"short",weekday:"short",year:"numeric"}))||"Select a date"})]}),(0,r.jsxs)("div",{className:"w-1/3 px-5 pb-15",children:[(0,r.jsx)("p",{className:"font-bold text-12 uppercase",children:"Guests"}),(0,r.jsx)("div",{className:"mx-auto max-w-70 pt-5",children:(0,r.jsx)(d.l,{label:"Guests",onChange:e=>{Y(e)},options:q,size:"small",theme:N,value:U})})]})]}),L.from&&L.to?(0,r.jsxs)("div",{className:"w-full pt-10 text-left",children:[(0,r.jsx)("h2",{className:"font-medium text-18 text-primary leading-snug tracking-[0.8px] md:text-20 xl:text-22",children:"Summary"}),(0,r.jsxs)("div",{className:"mt-3 text-18",children:[b(L.from,L.to)," Nights"]}),(0,r.jsxs)("div",{className:"mt-20 border-bordergray border-b pb-20 text-16",children:[(0,r.jsx)("div",{className:"font-bold text-primary",children:"From"}),(0,r.jsx)("div",{className:"",children:L.from.toLocaleDateString("en-GB",{day:"numeric",month:"short",weekday:"short",year:"numeric"})}),(0,r.jsx)("div",{className:"mt-15 font-bold text-primary",children:"To"}),(0,r.jsx)("div",{className:"",children:L.to.toLocaleDateString("en-GB",{day:"numeric",month:"short",weekday:"short",year:"numeric"})}),(0,r.jsx)("div",{className:"mt-15 font-bold text-primary",children:"For"}),(0,r.jsxs)("div",{className:"",children:[U," ","1"===U?"Guest":"Guests"]})]}),(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("div",{className:"pt-20 font-bold text-primary",children:"Total Costs"}),(0,r.jsx)("div",{className:"font-bold text-32 text-primary",children:(0,p.$g)((null==(v=P.find(e=>
1(0,m.Fn)(e.date,L.to)))?void 0:v.price)||0)}),(0,r.jsx)("div",{className:"mt-10 border-bordergray border-t pt-10",children:(0,r.jsx)(n.$,{className:"w-full",onClick:()=>{if(L.from&&L.to){let e={action:"cartOpen",arrivalDate:x(L.from),capacity:Number.parseInt(U,10),cottageID:w.referenceNumber,departureDate:x(L.to),numberNights:b(L.from,L.to)};window.postMessage(e,"*")}},theme:N,variant:"primary",children:(0,r.jsx)("span",{children:"Book Now"})})})]})]}):(0,r.jsx)(o.V,{components:{DayButton:e=>{var t;return(0,r.jsx)(f,{disabled:!!L.to&&!(0,m.Fn)(L.to,e.day.date)||!!e.modifiers.disabled,price:L.from?null==(t=P.find(t=>(0,m.Fn)(t.date,e.day.date)))?void 0:t.price:void 0,children:(0,r.jsx)(i.x,{...e})})}},disabled:E,endMonth:B||I,mode:"range",numberOfMonths:1,onDayClick:e=>{var t,a,r;if(t=L.from,a=L.to,!t||t&&e<t||t&&a){M({from:e,to:void 0});let t=j.find(t=>(0,m.Fn)(t.date,e));if(t){let a=null==(r=t.prices[Number(U)]||t.prices[Number(U)+1]||t.prices[Number(U)+2]||t.prices[Number(U)+3]||t.prices[Number(U)+4]||t.prices[Number(U)+5])?void 0:r.prices,l=(null==a?void 0:a[0])===0&&a.some(e=>e>0)?h(a,0):null==a?void 0:a.findIndex(e=>0===e),s=l&&-1!==l?null==a?void 0:a.slice(0,l):a,i=(null==s?void 0:s.length)||0,n=new Date(t.date.getTime());n.setDate(n.getDate()+i);let o=null==s?void 0:s.map((t,a)=>{let r=new Date(e.getTime());return r.setDate(r.getDate()+a+1),{date:r,price:t}}),d=[{before:e},{after:n},...((null==o?void 0:o.filter(e=>0===e.price))||[]).map(e=>e.date)];$(o||[]),O(d),V(n)}}else L.from&&!L.to&&e>L.from&&M({from:L.from,to:e})},selected:L,startMonth:L.from||new Date,theme:N}),(0,r.jsx)("div",{className:"mt-10 flex w-full items-center justify-center border-bordergray border-t pt-10",children:(0,r.jsxs)("button",{className:"rounded-4 border border-transparent px-10 py-1 transition-all hover:border-bordergray",onClick:()=>{M({from:void 0,to:void 0}),$(F),O(k),V(void 0)},type:"button",children:[L.from&&L.to?"Change":"Clear"," dates"]})})]})})}},72578:(e,t,a)=>{a.d(t,{V:()=>n});var r=a(85664),l=a(27588),s=a(74348),i=a(96777);function n(e){let{className:t,classNames:a,enableAllDates:n=!1,showOutsideDays:o=!0,theme:d,...c}=e;return(0,r.jsx)("div",{className:"relative p-15",children:(0,r.jsx)(l.h,{className:t,classNames:{button_next:(0,i.cn)("flex size-28 items-center justify-center border border-black/20 bg-transparent p-0 opacity-50 hover:opacity-100 disabled:invisible disabled:opacity-0",("beam"===d||"duplex"===d)&&"rounded-8","absolute top-1 right-4"),button_previous:(0,i.cn)("flex size-28 items-center justify-center border border-black/20 bg-transparent p-0 opacity-50 hover:opacity-100 disabled:invisible disabled:opacity-0",("beam"===d||"duplex"===d)&&"rounded-8","absolute top-1 left-4"),caption_label:"text-14 font-medium",day:(0,i.cn)("relative size-41 appearance-none overflow-hidden p-0 font-normal hover:bg-primary/10 aria-selected:opacity-100",("beam"===d||"duplex"===d)&&"rounded-8"),day_button:"w-full h-full absolute text-14",disabled:"!text-black/60 !bg-transparent !opacity-50 [&>button]:line-through [&>div>button]:line-through hover:!bg-transparent",hidden:"invisible",month:"space-y-16",month_caption:"flex justify-center items-center pt-4 relative",month_grid:"border-collapse space-y-4",months:"relative flex flex-col sm:flex-row sm:[&>nav+div+div]:ml-16",nav:"px-4 flex items-center justify-between absolute w-full z-10",outside:"!text-black/60 !opacity-50",range_middle:"aria-selected:bg-primary aria-selected:text-white",selected:"bg-primary text-white hover:!bg-primary hover:!text-white focus:bg-primary focus:text-white",today:"bg-primary/10 !text-black",week:"flex mt-8",weekday:"w-41 font-normal text-[0.8rem] text-black/60 flex items-center justify-center",weekdays:"flex",weeks:"",...a},components:{Chevron(e){let{className:t,disabled:a,orientation:l}=e;return(0,r.jsx)(s.I,{"aria-disabled":a,className:(0,i.cn)("size-16",t),name:"left"===l?"lucide/chevron-left":"right"===l?"lucide/chevron-right":"up"===l?"lucide/chevron-up":"lucide/chevron-down"})}},disabled:n?[]:[{before:new Date}],showOutsideDays:o,weekStartsOn:1,...c})})}
1n.displayName="Calendar"}}]);
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.