1import{R as e}from"./client-CiugsGCo.js";import{F as _,q as N,p as w}from"./index-CJi6Bj-9.js";import{A as k}from"./AddToWishlist-B-15ODS-.js";import{A as b}from"./Amount-CYpAD8CH.js";import{S as x,a as A}from"./swiper-react-DQM-3bTN.js";import{t as E}from"./translation-DmbMrMOf.js";import{d as s}from"./dayjs.min-DPMlDB9H.js";const l=(r,t)=>s(r).format(t),h=function(r,t,i){localStorage.setItem("item_list_name","Homepage"),localStorage.setItem("item_list_id","{{ forloop.counter }}"),window.dataLayer.push({ecommerce:null});const c=(s(r.suggested_dates[0].end)-s(r.suggested_dates[0].start))/1e3/60/60/24,a={event:"select_item",ecommerce:{items:[{item_name:r.name_en,item_id:r.id,price:r.suggested_dates[0].net_price_usd,item_category:r.category_en,item_category2:r.location.city_en,item_category3:r.location.county_en,item_category4:r.location.state_en,item_category5:r.location.country_en,item_category6:"2",item_category7:String(c),item_list_name:i,item_list_id:String(t),index:1,quantity:1}]}};window.dataLayer.push(a)},T=({className:r="",accommodation:t,referrer:i,index:c})=>{let a=null;try{a=t.suggested_dates[0]}catch(n){console.error("Error accessing suggested_dates for accommodation:",n)}let d=t.absolute_url_en;a&&(d+=`?dates=${l(a.start,"MM/DD/YYYY")} - ${l(a.end,"MM/DD/YYYY")}&referrer=${i}`);let o=`${t.category} in ${t.location.city_en}`;t.location.country_en==="United States of America"&&(o+=`, ${t.location.state_iso_code}`);let g=!1;a&&(g=s(a.start).month()===s(a.end).month());let m=0;a&&(m=a.price,a.net_price&&(m=a.net_price));const u=window.matchMedia("(min-width: 768px)").matches,v=window.GH.swiperErrorFallbackImg,y=()=>{try{h(t,c)}catch(n){console.error("Error sending click on accommodation event to GA4:",n)}};return e.createElement("div",{className:`listing-card listing-card--not-result pb-1x h-100 ${r}`},e.createElement("div",{className:"listing-card-media"},e.createElement(x,{navigation:!0,pagination:{clickable:!0,dynamicBullets:!0,dynamicMainBullets:5},onClick:()=>{try{h(t,c)}catch(n){console.error("Error sending click on accommodation event to GA4:",n)}u?window.open(d,"_blank"):window.location=d}},t.images.map((n,f)=>e.createElement(A,{key:f,lazy:!1},e.createElement("a",{href:"#",className:"ratio-container"},e.createElement("img",{src:n.url,loading:"lazy",className:"img-fit-cover",alt:t.name_en,onError:p=>{p.currentTarget.onerror=null,p.currentTarget.src=v}})),e.createElement("div",{className:"swiper-lazy-preloader",style:{border:"4px solid white",borderTopColor:"transparent"}}),e.createElement("div",{style:{position:"absolute",zIndex:"2",display:"block",left:"0",top:"0",width:"100%",height:"100%",background:"linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 20%)"}}))))),e.createElement("div",{className:"listing-card-media__overlay-top"},e.createElement(k,{id:t.id,name:t.name_en,slug:t.slug_en,url:t.absolute_url_en,inverse:!0})),e.createElement("div",{className:"listing-card-content"},e.createElement("div",{className:"listing-card-header"},e.createElement("div",{className:"h2 listing-card-title"},e.createElement("a",{className:"stretched-link",title:t.name_en,href:d,target:u?"_blank":"",onClick:y},o)),e.createElement("div",{className:"listing-card-rating"},t.average_rate?e.createElement("div",{className:"rating-score icon-text-aligner align-items-baseline"},e.createElement(_,{icon:N,className:"gh-icon-medium fill-highlight align-self-center"}),e.createElement("span",{className:"d-inline-block"},t.average_rate)):e.createElement(e.Fragment,null,t.is_new_labeled?e.createElement("div",{className:"icon-text-aligner align-items-baseline"},e.createElement(_,{icon:w,className:"rating-score__icon gh-icon-medium align-self-center"}),e.createElement("span",{className:"d-inline-block"},E("New"))):""))),e.createElement("div",{className:"listing-card-description-group"},t.upper_help_area?e.createElement("div",{className:"listing-card-description-item text-truncate"},t.upper_help_area):""),e.createElement("div",{className:"listing-card-footer"},a!==null?e.createElement("div",{className:"listing-card-description-item listing-card-description-item--suggested-dates"},l(a.start,"MMM D")," -"," ",g?l(a.end,"D"):l(a.end,"MMM D")):"",e.createElement("div",{className:"listing-card-price"},e.createElement(b,{className:"listing-card-price-value",currency:t.original_currency,amount:m,decimalPlaces:0}),E("/night")))))},z=()=>e.createElement("div",{className:"listing-card-skeleton"},e.createElement("div",{className:"ratio-6 skeleton-card-img listing-card-media"}),e.createElement("div",{className:"listing-card-header mt-1x5"},e.createElement("div",{className:"skeleton-card-content hide-pseudo"}),e.createElement("div",{className:"skeleton-card-content hide-pseudo mw-3x5 ml-1x"})),e.createElement("div",{className:"mt-0x75 pr-4x"},e.createElement("div",{className:"skeleton-card-content hide-pseudo"}),e.createElement("div",{className:"skeleton-card-content hide-pseudo mw-3x5 mt-1x5"}),e.createElement("div",{className:"skeleton-card-content hide-pseudo w-50 mt-0x75"})));export{T as A,z as a};
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.