PageSourceSearch

https://hotelvilainglesa.com.br/assets/AccommodationsCarousel-pVaCJGls.js

js hotelvilainglesa.com.br collected 2026-09-26 10:27:22 UTC 8,435 bytes, 1 lines download raw bytes

1import{j as e,u as be}from"./vendor-query-CO_QYTkO.js";import{r as a}from"./vendor-react-DJfEFaqw.js";import{f as g,c as K,s as ye}from"./index-BuBFkYNO.js";import{u as ge}from"./vendor-carousel-DpjaRhUe.js";import{al as Ne,A as ve}from"./vendor-icons-BmcpZVdY.js";import{u as we}from"./useAccommodationDisplaySettings-Dg3z5qGy.js";import"./vendor-ui-CCUQhf4y.js";import"./vendor-supabase-MEHSyf2E.js";import"./vendor-router-CkFJCvFZ.js";import"./vendor-helmet-Cc4zoVvE.js";import"./vendor-sanitize-D9RiKzGB.js";import"./vendor-codemirror-kF8_xaBD.js";import"./vendor-dnd-Ds4KDHQQ.js";const q=a.createContext(null);function j(){const t=a.useContext(q);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}const V=a.forwardRef(({orientation:t="horizontal",opts:s,setApi:l,plugins:n,className:i,children:u,...f},x)=>{const[C,r]=ge({...s,axis:t==="horizontal"?"x":"y"},n),[S,N]=a.useState(!1),[k,R]=a.useState(!1),p=a.useCallback(c=>{c&&(N(c.canScrollPrev()),R(c.canScrollNext()))},[]),b=a.useCallback(()=>{r==null||r.scrollPrev()},[r]),y=a.useCallback(()=>{r==null||r.scrollNext()},[r]),v=a.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),b()):c.key==="ArrowRight"&&(c.preventDefault(),y())},[b,y]);return a.useEffect(()=>{!r||!l||l(r)},[r,l]),a.useEffect(()=>{if(r)return p(r),r.on("reInit",p),r.on("select",p),()=>{r==null||r.off("select",p)}},[r,p]),e.jsx(q.Provider,{value:{carouselRef:C,api:r,opts:s,orientation:t||((s==null?void 0:s.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:y,canScrollPrev:S,canScrollNext:k},children:e.jsx("div",{ref:x,onKeyDownCapture:v,className:g("relative",i),role:"region","aria-roledescription":"carousel",...f,children:u})})});V.displayName="Carousel";const F=a.forwardRef(({className:t,...s},l)=>{const{carouselRef:n,orientation:i}=j();return e.jsx("div",{ref:n,className:"overflow-hidden",children:e.jsx("div",{ref:l,className:g("flex",i==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...s})})});F.displayName="CarouselContent";const Q=a.forwardRef(({className:t,...s},l)=>{const{orientation:n}=j();return e.jsx("div",{ref:l,role:"group","aria-roledescription":"slide",className:g("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",t),...s})});Q.displayName="CarouselItem";const J=a.forwardRef(({className:t,variant:s="outline",size:l="icon",...n},i)=>{const{orientation:u,scrollPrev:f,canScrollPrev:x}=j();return e.jsxs(K,{ref:i,variant:s,size:l,className:g("absolute h-8 w-8 rounded-full",u==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!x,onClick:f,...n,children:[e.jsx(Ne,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Previous slide"})]})});J.displayName="CarouselPrevious";const U=a.forwardRef(({className:t,variant:s="outline",size:l="icon",...n},i)=>{const{orientation:u,scrollNext:f,canScrollNext:x}=j();return e.jsxs(K,{ref:i,variant:s,size:l,className:g("absolute h-8 w-8 rounded-full",u==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!x,onClick:f,...n,children:[e.jsx(ve,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Next slide"})]})});U.displayName="CarouselNext";const je={1:"basis-full",2:"basis-1/2",3:"basis-1/3",4:"basis-1/4"},Ce={1:"md:basis-full",2:"md:basis-1/2",3:"md:basis-1/3",4:"md:basis-1/4"},Se={1:"lg:basis-full",2:"lg:basis-1/2",3:"lg:basis-1/3",4:"lg:basis-1/4"},B=(t,s)=>{const l=Number(t);return!l||Number.isNaN(l)?s:Math.min(4,Math.max(1,Math.round(l)))},Oe=({buttonText:t="RESERVE",showPrice:s=!0,showDescription:l=!0,sectionTitle:n,sectionTitleHighlight:i,sectionSubtitle:u,cardsPerViewMobile:f=1,cardsPerViewTablet:x=2,cardsPerViewDesktop:C=3,arrowsPosition:r="middle",arrowsAlwaysVisible:S=!0,arrowsBackgroundColor:N="#1a3a4a",arrowsIconColor:k="#ffffff",cardBorderRadius:R="16px",imageBorderRadius:p="0",cardBackgroundColor:b="#ffffff",cardBorderColor:y="hsl(198, 20%, 85%)",cardBorderWidth:v="1px",cardPadding:c="0",cardsGap:I="1rem",titleColor:X="#1a3a4a",titleFontSize:Y="1.5rem",descriptionColor:P="#6b7280",descriptionFontSize:M="0.875rem",priceColor:Z="#1a3a4a",priceFontSize:G="1.5rem",buttonBackgroun
1dColor:ee="#1a3a4a",buttonTextColor:re="#ffffff",buttonBorderColor:te="#1a3a4a",buttonBorderWidth:se="1px",buttonBorderRadius:le="0",contentPadding:oe="1.5rem",imageAspectRatio:ae="4/3"})=>{const{data:m,isLoading:ne}=be({queryKey:["accommodations"],queryFn:async()=>{const{data:o,error:h}=await ye.from("accommodations").select("*").eq("is_enabled",!0).order("sort_order");if(h)throw h;return o}}),{settings:$}=we(),D=a.useMemo(()=>{if(!m)return[];const o=$.buildingTypeOrder||"historico_first";if(o==="none")return m;const h=m.filter(d=>(d.building_type||"Histórico")==="Histórico"),w=m.filter(d=>d.building_type==="Contemporâneo"),[E,_]=o==="historico_first"?[h,w]:[w,h],A=[],he=Math.max(E.length,_.length);for(let d=0;d<he;d++)E[d]&&A.push(E[d]),_[d]&&A.push(_[d]);return A},[m,$.buildingTypeOrder]);if(ne)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(!m||m.length===0)return null;const L=B(f,1),H=B(x,2),O=B(C,3),T=Math.max(L,H,O),ie=D.length>T,ce={backgroundColor:b,borderRadius:R,borderColor:y,borderWidth:v,borderStyle:v!=="0px"?"solid":"none",padding:c,overflow:"hidden"},de={borderRadius:p,overflow:"hidden",aspectRatio:ae},ue={color:X,fontSize:Y,fontWeight:600,marginBottom:"0.5rem"},me={color:P,fontSize:M,marginBottom:"1rem",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},fe={color:Z,fontSize:G,fontWeight:700},xe={backgroundColor:ee,color:re,borderColor:te,borderWidth:se,borderStyle:"solid",borderRadius:le,textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"0.75rem",padding:"0.75rem 1.5rem"},W={backgroundColor:N,color:k,borderColor:N,opacity:S?1:void 0},z={top:{wrapper:"relative",prev:"top-0 left-auto right-12 -translate-y-[calc(100%+1rem)] translate-x-0",next:"top-0 right-0 translate-x-0 -translate-y-[calc(100%+1rem)]"},middle:{wrapper:"relative",prev:"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2",next:"right-0 top-1/2 -translate-y-1/2 translate-x-1/2"},bottom:{wrapper:"relative pb-16",prev:"bottom-0 top-auto left-auto right-12 translate-y-[calc(100%+1rem)] translate-x-0",next:"bottom-0 top-auto right-0 translate-y-[calc(100%+1rem)] translate-x-0"}}[r],pe=`${je[L]} ${Ce[H]} ${Se[O]}`;return e.jsxs("div",{children:[(n||u)&&e.jsxs("div",{className:"text-center mb-12",children:[n&&e.jsxs("h2",{className:"font-display text-3xl md:text-4xl lg:text-5xl text-foreground mb-3",children:[n," ",i&&e.jsx("span",{className:"italic text-hotel-teal",children:i})]}),u&&e.jsx("p",{className:"text-muted-foreground uppercase tracking-widest text-xs",children:u})]}),e.jsxs(V,{opts:{align:"start",loop:m.length>T},className:`w-full px-1 ${z.wrapper}`,children:[e.jsx(F,{className:"-ml-4",children:D.map(o=>{const w=(o.building_type||"Histórico")==="Histórico";return e.jsx(Q,{className:`pl-4 ${pe}`,style:{paddingRight:I!=="1rem"?I:void 0},children:e.jsxs("div",{style:ce,className:"h-full flex flex-col shadow-md",children:[e.jsx("div",{style:de,className:"relative",children:e.jsx("img",{src:o.image_url||"/placeholder.svg",alt:o.image_alt||o.name,className:"w-full h-full object-cover transition-transform duration-300 hover:scale-105",loading:"lazy"})}),e.jsxs("div",{style:{padding:oe},className:"flex flex-col flex-1",children:[e.jsx("h3",{style:ue,className:"font-display",children:o.name}),e.jsx("p",{className:"font-body self-start -mt-1 mb-2",style:{color:P,fontSize:M},children:w?"Prédio Histórico":"Prédio Contemporâneo"}),l&&o.description&&e.jsx("p",{style:me,className:"flex-1",children:o.description}),e.jsxs("div",{className:"flex items-center justify-between mt-auto pt-4",children:[s&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs block",style:{color:P},children:"A partir de"}),e.jsx("span",{style:fe,children:o.price})]}),o.link&&e.jsx("a",{href:o.link,style:xe,className:"inline-flex items-center justify-center",children:t})]})]})]})},o.id)})}),ie&&e.jsxs(e.Fragment,{children:[e.jsx(J,{className:`${z.prev} h-10 w-10 shadow-lg hover:opacity-90 border-2`,style:W}),e.jsx(U,{className:`${z.next} h-10 w-10 shadow-lg hover:opacity-90 border-2`,style:W})]})]})]})};export{Oe as default};

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.