import{_ as v}from"./Df-KDzNL.js";import{_ as x}from"./C7M176Nc.js";import{_ as N}from"./0P9jqoAy.js";import k from"./ClYGtaoC.js";import{u as M}from"./DoD9pQpq.js";import{u as P}from"./DwkzckiZ.js";import B from"./BJly4fYj.js";import{h as H,r as g,N as w,f as D,d as o,e as d,E as _,i as c,j as a,t as T,k as m,G as q,H as A,u as y,F as E,p as F,D as G,m as R}from"./BNe23PLs.js";const U={key:0,class:"apartments-list__promo-wrapper"},V=a("div",{class:"apartments-list__promo-base bottom-div"},null,-1),I={class:"container apartments-list__promo-container"},j={class:"top-div apartments-list__promo-top"},$={class:"apartments-list__copy copy copy--is-small"},z={class:"container apartments-list__outer-container"},O=["innerHTML"],J={class:"apartments-list__container"},K={class:"apartments-list__apartment-item"},Q=["innerHTML"],W={class:"apartments-list__button-container has-text-centered"},st=H({__name:"ApartmentsList",props:{...B,communityId:{type:String,default:"",required:!0},promo:{type:String,default:""},title:{type:String,default:""},titleTag:{type:String,default:"h2"},styleLevel:{type:String,default:"2"},copy:{type:String,default:""},cardLimit:{type:Number,default:-1},apartmentCardTitleTag:{type:String,default:"h2"},apartmentCardTitleStyleLevel:{type:String,default:"4"},ctaText:{type:String,default:"Schedule my Tour"},ctaLocation:{type:String,default:"#smt"},opensNewTab:{type:Boolean,default:!1},ctaTextList:{type:String,default:""},ctaLinkList:{type:String,default:""},disclaimer:{type:String,default:""},priceLeadCopy:{type:String,default:""},pageMeta:{type:Object,default:()=>({})},subBrand:{type:String,default:""}},setup(t){const L=M(),f=g(""),p=g([]),h=P(),s=t;w(async()=>{var u;if(s.communityId)try{let r=[];const n=await L.getCommunityDetails(s.communityId,{roomGrouping:"RoomTypeCategory"});f.value=n==null?void 0:n.communityPhoneNumber,(u=n==null?void 0:n.careTypes)==null||u.forEach(i=>{var l;(l=i.roomTypes)==null||l.forEach(e=>{r.push({careType:i.careType,apartmentType:e.roomType,quantity:e.vacantRoomCount,bathrooms:e.bathroomCount,sqFtRange:e.unitSquareFootageRange,floorPlanUrl:e.floorPlanUrl,startingAtPrice:e==null?void 0:e.pricing.startingAtPrice})})}),s.cardLimit===-1?p.value=r:p.value=r.slice(0,s.cardLimit)}catch(r){console.error("Could not fetch community details ",r)}});const b={subTypes:{signature:"button--is-secondary","enhanced-care":"button--is-secondary"},default:"button--is-utility"},C=D(()=>h.mapGetCtaHelpers(b,s.pageMeta.pageSubtype));return(u,r)=>{const n=v,i=x,l=N,e=k;return o(),d(e,R(s,{className:"apartments-list"}),{default:_(()=>[t.promo?(o(),c("div",U,[V,a("div",I,[a("div",j,[a("p",$,T(t.promo),1)])])])):m("",!0),a("div",z,[t.title?(o(),d(n,{key:0,text:t.title,tag:t.titleTag,styleLevel:t.styleLevel,class:"apartments-list__main-title"},null,8,["text","tag","styleLevel"])):m("",!0),a("p",{innerHTML:t.copy,class:"apartments-list__copy-block copy"},null,8,O),a("div",J,[a("ul",null,[(o(!0),c(q,null,A(y(p),S=>(o(),c("li",K,[E(i,{pageMeta:t.pageMeta,apartmentDetails:S,apartmentCardTitleTag:t.apartmentCardTitleTag,apartmentCardTitleStyleLevel:t.apartmentCardTitleStyleLevel,communityPhoneNumber:y(f),ctaText:t.ctaText,ctaLocation:t.ctaLocation,opensNewTab:t.opensNewTab,priceLeadCopy:t.priceLeadCopy,subBrand:t.subBrand},null,8,["pageMeta","apartmentDetails","apartmentCardTitleTag","apartmentCardTitleStyleLevel","communityPhoneNumber","ctaText","ctaLocation","opensNewTab","priceLeadCopy","subBrand"])]))),256))])]),t.disclaimer?(o(),c("p",{key:1,innerHTML:t.disclaimer,class:"apartments-list__disclaimer copy copy--is-xsmall"},null,8,Q)):m("",!0),a("div",W,[t.ctaLinkList?(o(),d(l,{key:0,to:t.ctaLinkList,class:F(["apartments-list__form-submit button",y(C)]),target:"_blank",rel:"noopener noreferrer"},{default:_(()=>[G(T(t.ctaTextList),1)]),_:1},8,["to","class"])):m("",!0)])])]),_:1},16)}}});export{st as _};