PageSourceSearch

https://www.hotelconfiance.com.br/assets/reserva-confirmada-Dsx59SMK.js

js hotelconfiance.com.br collected 2026-10-08 10:37:44 UTC 9,511 bytes, 1 lines download raw bytes

1import{c as T,t as $,g as F,b as p,d as b,R as L,r as x,e as B,f as D,h as k,C as O,U,i as M,j as n,k as A,l as h,L as g,m as P,w as q}from"./index-BmmGtEQ_.js";import{T as z}from"./ticket-TqJf1tUq.js";import{C as E}from"./circle-check-_P-uiaUO.js";import{P as V}from"./phone-BtlVR4nf.js";const H=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],W=T("door-open",H),_="https://rlohbcyhyxsspnyhfbdd.supabase.co/functions/v1/receive-booking";function J(t){try{if(navigator.sendBeacon&&navigator.sendBeacon(_,new Blob([t],{type:"text/plain;charset=UTF-8"})))return}catch{}fetch(_,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:t,mode:"cors",keepalive:!0}).catch(()=>{})}function Z(t){if(!t)return null;const r=Number(String(t).replace(/[^\d,.-]/g,"").replace(",","."));return Number.isFinite(r)?r:null}function Y(t){if(typeof window>"u")return;const r=t.valorTotalReais??Z(t.total);$("purchase",{transaction_id:t.bookingId??void 0,value:r??void 0,currency:"BRL",hotel:t.hotelSlug??"rede",check_in:t.checkIn??null,check_out:t.checkOut??null,rooms:t.rooms??null});try{const e=F(),a={evento:"reserva_confirmada",origem:"pagina-sucesso-site",pagina:window.location.href,visitor_id:t.visitorId??b(),session_id:t.sessionId??p(),reserva_codigo:t.bookingId??null,valor_total:r??null,moeda:"BRL",company_id:t.companyId??null,chain_id:t.chainId??null,booking_url:t.bookingUrl??null,hotel_slug:t.hotelSlug??null,hotel_nome:t.rede?null:t.hotelName??null,rede:t.rede,checkin:t.checkIn??null,checkout:t.checkOut??null,adultos:t.adults??null,criancas:t.children??null,quartos:t.rooms??null,promocode:t.promoCode??null,dispositivo:window.innerWidth<768?"mobile":"desktop",user_agent:navigator.userAgent?.slice(0,500)??null,criado_em:new Date().toISOString(),traffic_source:t.trafficSource??e.traffic_source,traffic_medium:t.trafficMedium??e.traffic_medium,landing_page:t.landingPage??e.landing_page,utm_source:t.utmSource??e.utm_source,utm_medium:t.utmMedium??e.utm_medium,utm_campaign:t.utmCampaign??e.utm_campaign,utm_term:t.utmTerm??e.utm_term,utm_content:t.utmContent??e.utm_content,campaign_id:t.campaignId??e.campaign_id,adgroup_id:t.adgroupId??e.adgroup_id,ads_device:t.adsDevice??e.ads_device,matchtype:t.matchtype??e.matchtype,gclid:t.gclid??e.gclid,gbraid:t.gbraid??e.gbraid,wbraid:t.wbraid??e.wbraid,referrer:e.referrer};J(JSON.stringify(a))}catch{}}function l(t){if(t==null)return null;const r=String(t).trim();return!r||r==="undefined"||r==="null"?null:r}function G(){try{return JSON.parse(localStorage.getItem("hc_attr")||"null")||{}}catch{return{}}}function u(t){const r=l(t);if(!r)return null;const e=r.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(e)return`${e[3]}-${e[2]}-${e[1]}`;if(/^\d{4}-\d{2}-\d{2}$/.test(r))return r;try{const a=new Date(r);if(!Number.isNaN(a.getTime())){const o=a.getFullYear(),c=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0");return`${o}-${c}-${s}`}}catch{}return null}function y(t){const r=l(t);if(!r)return null;const[e,a,o]=r.split("-");return!e||!a||!o?null:`${o}/${a}/${e}`}function m(t){const r=l(t);if(!r)return null;const e=Number.parseInt(r,10);return Number.isFinite(e)?e:null}function K(t){const r=l(t);if(!r)return null;if(/^\d+$/.test(r)){const o=Number(r);return Number.isFinite(o)&&o>0?o/100:null}const e=r.replace(/\./g,"").replace(",","."),a=Number.parseFloat(e);return!Number.isFinite(a)||a<=0?null:a>1e4?a/100:a}function ne(){const t=L.useSearch(),r=x.useRef(!1),e=x.useMemo(()=>{try{const o=B()??{},c=(i,f)=>l(t[i])??l(o[i])??l(o[i.replace(/[A-Z]/g,R=>`_${R.toLowerCase()}`)])??f??null,s=i=>m(t[i])??m(l(o[i]))??m(l(o[i.replace(/[A-Z]/g,f=>`_${f.toLowerCase()}`)])),v=(c("hotel")??String(o.hotelSlug??"")).toLowerCase().trim(),d=v?D(v):void 0,I=u(t.checkin)??u(String(o.checkIn??""))??u(String(o.checkin??"")),N=u(t.checkout)??u(String(o.checkOut??""))??u(String(o.checkout??"")),j=s("adults")??m(String(o.adultos??"")),w=s("children")??m(String(o.criancas??"")),S=s("rooms")??m(String(o.quartos??"")),C=t.conversionValue||t.total||null;return{slug:d?d.slug:null,nome:d?.name??(l(o.hotelName)||"Hotéis Confiance"),cidade:d?.location?.city??"Curitiba",telefone:d?.phone??k,rede:!d&&!l(o.hotelName),bookingId:t.bookingId||t.reserva||t.reservationId||null,checkin:I,checkout:N,adultos:j,criancas:w,quartos:S,valorTotalReais:K(C),promocode:c("promoCode",String(o.promocode??"")),companyId:c("c
1ompanyId",String(o.company_id??"")),chainId:c("chainId",String(o.chain_id??"")),bookingUrl:l(o.bookingUrl)??l(o.booking_url)??null,visitorId:t.hc_vid||b(),sessionId:t.hc_sid||p()}}catch{return{slug:null,nome:"Hotéis Confiance",cidade:"Curitiba",telefone:k,rede:!0,bookingId:null,checkin:null,checkout:null,adultos:null,criancas:null,quartos:null,valorTotalReais:null,promocode:null,companyId:null,chainId:null,bookingUrl:null,visitorId:t.hc_vid||b(),sessionId:t.hc_sid||p()}}},[t]);x.useEffect(()=>{if(r.current)return;r.current=!0;const o=G();Y({hotelSlug:e.slug,hotelName:e.nome,rede:e.rede,bookingId:e.bookingId,checkIn:e.checkin,checkOut:e.checkout,adults:e.adultos,children:e.criancas,rooms:e.quartos,valorTotalReais:e.valorTotalReais,promoCode:e.promocode,companyId:e.companyId,chainId:e.chainId,bookingUrl:e.bookingUrl,visitorId:e.visitorId,sessionId:e.sessionId,trafficSource:o.traffic_source??null,trafficMedium:o.traffic_medium??null,landingPage:o.landing_page??null,utmSource:o.utm_source??null,utmMedium:o.utm_medium??null,utmCampaign:o.utm_campaign??null,utmTerm:o.utm_term??null,utmContent:o.utm_content??null,campaignId:o.campaign_id??null,adgroupId:o.adgroup_id??null,adsDevice:o.ads_device??null,matchtype:o.matchtype??null,gclid:o.gclid??null,gbraid:o.gbraid??null,wbraid:o.wbraid??null}),typeof window<"u"&&e.bookingId&&e.valorTotalReais&&(window.dataLayer=window.dataLayer||[],window.dataLayer.some(s=>typeof s=="object"&&s!==null&&s.event==="reserva_confirmada"&&s.transaction_id===e.bookingId)||window.dataLayer.push({event:"reserva_confirmada",transaction_id:e.bookingId,value:e.valorTotalReais,currency:"BRL"}))},[e]);const a=[e.checkin&&{icon:O,content:n.jsxs(n.Fragment,{children:["Check-in ",n.jsx("strong",{children:y(e.checkin)}),e.checkout&&n.jsxs(n.Fragment,{children:[" · ","Check-out ",n.jsx("strong",{children:y(e.checkout)})]})]})},(e.adultos!==null||e.criancas!==null)&&{icon:U,content:n.jsxs(n.Fragment,{children:[e.adultos??0," adulto(s)",e.criancas?` · ${e.criancas} criança(s)`:""]})},e.quartos!==null&&{icon:M,content:n.jsxs(n.Fragment,{children:[e.quartos," quarto(s)"]})},e.promocode&&{icon:z,content:n.jsxs(n.Fragment,{children:["Promocode ",n.jsx("strong",{children:e.promocode})]})}].filter(Boolean);return n.jsx("div",{className:"bg-muted/30 py-12 md:py-20",children:n.jsx(A,{children:n.jsxs("div",{className:"mx-auto w-full max-w-xl overflow-hidden rounded-2xl border border-border/60 bg-card shadow-sm",children:[n.jsxs("div",{className:"bg-ink px-8 py-10 text-center text-ink-foreground",children:[n.jsx(E,{className:"mx-auto h-14 w-14 text-gold"}),n.jsx("h1",{className:"mt-4 font-serif text-3xl font-medium",children:"Reserva confirmada!"}),n.jsxs("p",{className:"mt-2 text-sm opacity-80",children:[e.nome,e.cidade?` · ${e.cidade}`:""]})]}),n.jsxs("div",{className:"space-y-5 px-6 py-7 md:px-8",children:[e.bookingId&&n.jsxs("div",{className:"rounded-xl bg-muted px-4 py-3 text-center",children:[n.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Código da reserva"}),n.jsx("p",{className:"mt-1 font-mono text-xl font-semibold text-foreground",children:e.bookingId})]}),a.length>0&&n.jsx("ul",{className:"divide-y divide-border/60 text-sm text-foreground",children:a.map((o,c)=>n.jsxs("li",{className:"flex items-center gap-3 py-3",children:[n.jsx(o.icon,{className:"h-4 w-4 shrink-0 text-gold"}),n.jsx("span",{children:o.content})]},c))}),n.jsx(h,{asChild:!0,size:"lg",className:"w-full rounded-xl bg-gold py-6 text-base font-semibold text-gold-foreground shadow-sm hover:bg-gold/90",children:n.jsxs(g,{to:"/checkin-online",children:[n.jsx(W,{className:"mr-2 h-5 w-5"}),"Fazer check-in online"]})}),n.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Você receberá os detalhes da reserva por e-mail. Dúvidas? Fale com a recepção pelo telefone ",e.telefone," ou pelo WhatsApp."]}),n.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-center",children:[n.jsx(h,{asChild:!0,variant:"outline",className:"rounded-full",children:n.jsxs("a",{href:P(e.telefone),children:[n.jsx(V,{className:"mr-2 h-4 w-4"}),"Ligar para o hotel"]})}),n.jsx(h,{asChild:!0,variant:"outline",className:"rounded-full",children:n.jsx("a",{href:q(e.telefone),target:"_blank",rel:"noopener noreferrer",children:"WhatsApp"})}),e.slug?n.jsx(h,{asChild:!0,className:"rounded-full bg-cta text-cta-foreground hover:bg-cta/90",children:n.jsx(g,{to:"/hoteis/$slug",params:{slug:e.slug},children:"Ver o hotel"})}):n.jsx(h,{asChild:!0,className:"rounded-full bg-cta text-cta-foreground hover:bg-cta/90",children:n.jsx(g,{to:"/",children:"Voltar ao site"})})]}),e.slug&&n.jsx("p",{className:"text-center",children:n.jsx(g,{to:"/",className:"text-xs text-muted-foreground underline underline-offset-4 hover:text-foreground",children:"Voltar ao site"})})]})]})})})}export{ne as component};

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.