PageSourceSearch

https://app.showfloor.ai/assets/VisualizerShowroom-BTNcpdCB.js

js showfloor.ai collected 2026-10-05 15:25:57 UTC 54,671 bytes, 1 lines download raw bytes

1import{b as l,j as e}from"./query-CYOR7zGO.js";import{M as et,p as tt}from"./materials-f_Ubtn_x.js";import{q}from"./index-DcQpqDRc.js";import{n as st,d as nt,e as rt}from"./photoFirstShowroom-r5okSK5D.js";import{f as ce,d as ke,C as ot,U as it,X as lt}from"./lucide-Da0VTTkw.js";import{C as at}from"./ContentAwareBeforeAfter-DZaaQTzJ.js";const Qt="This showroom is not available.",ct="No floor options are available right now.",de="Image unavailable";function dt(t){const s=t==null?void 0:t.trim().replace(/[.\s]+$/,"");return s?`Please check back later or contact ${s}.`:"Please check back later."}const es="This showroom is temporarily offline.",ut="Floor showroom",mt="Featured",ft={epoxy_flake:"Flake blends",epoxy_metallic:"Metallic floors",epoxy_solid:"Solid-color floors",polished_concrete:"Polished concrete"};function je(t){const s=t==null?void 0:t.trim();return s||null}function ht(t){return[...t].sort((s,n)=>!!s.featured!=!!n.featured?s.featured?-1:1:(s.sort_order??0)-(n.sort_order??0))}function Fe(t,s){return t.show_brand_names?je(s.brand):null}function Be(t,s){const n=Fe(t,s),r=_e(s.category);return n&&r?`${n} · ${r}`:n||r||je(s.finish)}function _e(t){const s=je(t);if(!s)return null;const n=s.toLowerCase(),r=ft[n];if(r)return r;const o=et[n];if(o)return o;if(!s.includes("_"))return s.charAt(0).toUpperCase()+s.slice(1);const i=n.replaceAll("_"," ");return i.charAt(0).toUpperCase()+i.slice(1)}function pt(t){return t&&t.split(/\s+/).filter(Boolean).slice(0,2).map(n=>{var r;return(r=n[0])==null?void 0:r.toUpperCase()}).join("")||null}const Le=new Map,xt=t=>Array.from(new Uint8Array(t),s=>s.toString(16).padStart(2,"0")).join(""),Ie=async t=>xt(await crypto.subtle.digest("SHA-256",t));async function Re(t,s,n,r,o){const i=[];for(const[d,p]of Array.from(s.entries()))d==="turnstile_token"||d==="submission_id"||i.push([d,typeof p=="string"?d==="email"?p.trim().toLowerCase():p.trim():await Ie(await p.arrayBuffer())]);i.sort(([d],[p])=>d.localeCompare(p));const f=await Ie(new TextEncoder().encode(JSON.stringify([t,n??null,i]))),h=`showfloor:public-submission:${t}`;let c=Le.get(h);try{const d=r==null?void 0:r.getItem(h);if(d){const p=JSON.parse(d);/^[a-f0-9]{64}$/.test(p.fingerprint)&&/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/.test(p.id)&&(c=p)}}catch{}const m=!(o!=null&&o.fresh)&&(c==null?void 0:c.fingerprint)===f?c:{fingerprint:f,id:crypto.randomUUID()};Le.set(h,m);try{r==null||r.setItem(h,JSON.stringify(m))}catch{}return m.id}const qe="dealer-project-email-preview-v1",ts="https://showfloor.ai/privacy";function bt(t){return`Send my name, email, room photo and selected floor to ${t} for email follow-up about this project. ShowFloor uses them to create and deliver my preview.`}const Pe=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/,wt=["sending","post_unknown","accepted_pending","accepted_unknown","delivered","deferred","failed"],ye=t=>!!(t&&["delivered","deferred","failed"].includes(t.phase));class gt{constructor(s,n,r){this.slug=s,this.token=n,this.storage=r,this.snapshot={ready:!1,attempt:null,fresh:!1},this.listeners=new Set,this.tombstones=[],this.admitting=!1,this.key="",this.getSnapshot=()=>this.snapshot,this.subscribe=o=>(this.listeners.add(o),()=>{this.listeners.delete(o)}),this.ready=this.hydrate()}publish(s){this.snapshot=s,this.listeners.forEach(n=>n())}async hydrate(){var s;try{const n=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(JSON.stringify([this.slug,this.token??null])));this.key="showfloor:default-attempt:"+Array.from(new Uint8Array(n),o=>o.toString(16).padStart(2,"0")).join("");let r;try{r=(s=this.storage)==null?void 0:s.getItem(this.key)}catch{}if(r)try{if(r.length>256e3)throw Error("invalid_record");const o=JSON.parse(r);if(o.v!==1||!Array.isArray(o.tombstones)||!o.tombstones.every(h=>typeof h=="string"&&Pe.test(h))||typeof o.fresh!="boolean")throw Error("invalid_record");this.tombstones=Array.from(new Set(o.tombstones));const i=o.current;let f=null;if(i!==null){if(!i||typeof i.id!="string"||!Pe.test(i.id)||this.tombstones.includes(i.id)||typeof i.materialId!="str
1ing"||!i.materialId||i.materialId.length>256||!wt.includes(i.phase)||!Number.isFinite(i.startedAt))throw Error("invalid_record");f={id:i.id,materialId:i.materialId,startedAt:i.startedAt,phase:i.phase==="sending"?"post_unknown":i.phase==="accepted_pending"?"accepted_unknown":i.phase}}this.publish({ready:!0,attempt:f,fresh:!f&&o.fresh&&this.tombstones.length>0});return}catch{this.publish({ready:!0,fresh:!1,attempt:{id:null,materialId:"",phase:"post_unknown",startedAt:Date.now()}});return}this.publish({ready:!0,attempt:null,fresh:!1})}catch{this.publish({ready:!0,attempt:null,fresh:!1})}}persist(){var r;if(!this.key)return;const s=this.snapshot.attempt;if(s&&!s.id)return;const n=s?{id:s.id,materialId:s.materialId,phase:s.phase,startedAt:s.startedAt}:null;try{(r=this.storage)==null||r.setItem(this.key,JSON.stringify({v:1,current:n,tombstones:this.tombstones,fresh:this.snapshot.fresh}))}catch{}}async begin(s,n){if(this.admitting)return null;this.admitting=!0;try{if(await this.ready,this.snapshot.attempt)return null;const r=this.snapshot.fresh;this.publish({ready:!0,fresh:r,attempt:{id:null,materialId:n,phase:"sending",startedAt:Date.now()}});let o;try{if(o=await Re(this.slug,s,this.token,this.storage,r?{fresh:!0}:void 0),this.tombstones.includes(o)&&(o=await Re(this.slug,s,this.token,this.storage,{fresh:!0})),this.tombstones.includes(o))throw Error("submission_identity_conflict")}catch(i){throw this.publish({ready:!0,fresh:r,attempt:null}),i}return this.publish({ready:!0,fresh:!1,attempt:{id:o,materialId:n,phase:"sending",startedAt:Date.now()}}),this.persist(),o}finally{this.admitting=!1}}settle(s,n,r={}){const o=this.snapshot.attempt;return!o||o.id!==s||this.tombstones.includes(s)||ye(o)||n==="post_unknown"&&!["sending","post_unknown"].includes(o.phase)?!1:(this.publish({...this.snapshot,attempt:{...o,...r,phase:n,startedAt:n==="accepted_pending"&&o.phase!=="accepted_pending"?Date.now():o.startedAt}}),this.persist(),!0)}releasePrewrite(s){var n;return((n=this.snapshot.attempt)==null?void 0:n.id)!==s||this.snapshot.attempt.phase!=="sending"||this.tombstones.includes(s)?!1:(this.publish({ready:!0,attempt:null,fresh:!1}),this.persist(),!0)}newRequest(s){var n;return((n=this.snapshot.attempt)==null?void 0:n.id)!==s||!ye(this.snapshot.attempt)||this.tombstones.includes(s)?!1:(this.tombstones.push(s),this.publish({ready:!0,attempt:null,fresh:!0}),this.persist(),!0)}}const Oe=new Map;function We(t,s){const n=JSON.stringify([t,s??null]);let r=Oe.get(n);if(!r){let o;try{o=window.sessionStorage}catch{}r=new gt(t,s,o),Oe.set(n,r)}return r}function He(t){return l.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}const yt=new Set(["422:UAT_EMAIL_MISMATCH","400:TURNSTILE_REQUIRED","400:NO_PHOTO","400:INVALID_IMAGE","400:IMAGE_TOO_SMALL","415:UNSUPPORTED_MEDIA_TYPE","422:IMAGE_PROCESSING_FAILED","413:LIMIT_FILE_SIZE","429:RATE_LIMIT_EXCEEDED"]),vt=(t,s)=>yt.has(`${t}:${s??""}`);function jt(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const s=t;return typeof s.lead_token!="string"||s.lead_token.length<24||s.preview_status!=="queued"&&s.preview_status!=="deferred"||s.test_mode!==void 0&&s.test_mode!==!0||s.request_contract!==void 0&&s.request_contract!==qe?null:{leadToken:s.lead_token,status:s.preview_status}}const _t="#ea580c";function fe(t){const s=[1,3,5].map(n=>{const r=Number.parseInt(t.slice(n,n+2),16)/255;return r<=.04045?r/12.92:((r+.055)/1.055)**2.4});return s[0]*.2126+s[1]*.7152+s[2]*.0722}function Nt(t,s){const n=Math.max(fe(t),fe(s)),r=Math.min(fe(t),fe(s));return(n+.05)/(r+.05)}function Ne(t){return st(t)??_t}function ve(t){const s=Ne(t),n=nt(s);return{"--sf-accent-color":s,"--sf-accent-ink":n,backgroundColor:s,borderColor:n==="#000000"?"#64748b":"transparent",color:n}}function pe(t,s="#fbf8f2"){const n=Ne(t);return Nt(n,s)>=4.5?n:"#334155"}const Y={creating:"Creating your preview…",checking:"Checking your preview…",slow:"Still working on your preview…",timing:"Usually under two minutes.",slowTiming:"This one is taking longer than usual. It’s still in progress.",keepWindowOpen:"Keep this window open to see it here.",keepPageOpen:"Keep this page open to see it here.",stayOrCloseWindow:"Stay here to see it, or close this window — we’ll email it to you.",stayOrLeavePage:"Stay here to see it, or leave this page — we’ll email it to you.",selectedFloor:"Selected floor",roomAlt:"Your room photo"};
1function Et({status:t="creating",surface:s="window",showEmailNote:n=!1,slow:r=!1}){const o=n?s==="page"?Y.stayOrLeavePage:Y.stayOrCloseWindow:s==="page"?Y.keepPageOpen:Y.keepWindowOpen;return{title:t==="checking"?Y.checking:r?Y.slow:Y.creating,lines:[`${r?Y.slowTiming:Y.timing} ${o}`]}}function At({photoUrl:t,materialName:s,swatchUrl:n,accentColor:r,status:o="creating",surface:i="window",showEmailNote:f=!1,announce:h=!0,slow:c=!1,still:m=!1}){const[d,p]=l.useState(!1),[E,g]=l.useState(!1);l.useEffect(()=>p(!1),[t]),l.useEffect(()=>g(!1),[n]);const u=Et({status:o,surface:i,showEmailNote:f,slow:c}),b=(s==null?void 0:s.trim())||null,S=n&&!E?n:null,y=t&&!d?t:null,w={"--sf-dev-accent":pe(r,"#ffffff")};return e.jsxs("section",{className:`sf-dev${m?" sf-dev-still":""}`,style:w,"data-showfloor-developing":m?void 0:"",children:[e.jsxs("div",{className:"sf-dev-stage",children:[y?e.jsx("img",{className:"sf-dev-room",src:y,alt:Y.roomAlt,onError:()=>p(!0)}):S?e.jsx("img",{className:"sf-dev-room sf-dev-room-swatch",src:S,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer"}):e.jsx("div",{className:"sf-dev-room sf-dev-room-empty","aria-hidden":"true"}),e.jsx("div",{className:"sf-dev-veil","aria-hidden":"true"}),m?null:e.jsx("div",{className:"sf-dev-sweep","aria-hidden":"true",children:e.jsx("span",{})}),b?e.jsxs("div",{className:"sf-dev-floor",children:[S?e.jsx("img",{className:"sf-dev-swatch",src:S,alt:"",referrerPolicy:"no-referrer",onError:()=>g(!0)}):null,e.jsxs("span",{className:"sf-dev-floor-text",children:[e.jsx("small",{children:Y.selectedFloor}),e.jsx("strong",{children:b})]})]}):null]}),m?null:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sf-dev-track","aria-hidden":"true",children:e.jsx("span",{})}),e.jsxs("div",{className:"sf-dev-copy",role:h?"status":void 0,"aria-live":h?"polite":void 0,children:[e.jsx("p",{className:"sf-dev-title",children:u.title}),u.lines.map(U=>e.jsx("p",{children:U},U))]})]})]})}const re={hasRequest:t=>`${t} has your request.`,followUpEmail:"They’ll follow up by email about your project.",mayContact:"They may contact you about your project.",moreFinishes:t=>`More finishes from ${t}`,slowAfterMs:9e4};
1function St({businessName:t,detail:s,accentColor:n}){const r=pe(n,"#ffffff");return e.jsxs("div",{className:"sf-next","data-showfloor-next":"",children:[e.jsx("span",{className:"sf-next-mark",style:{background:r},"aria-hidden":"true",children:e.jsx(ce,{size:13,strokeWidth:3})}),e.jsxs("p",{children:[e.jsx("strong",{children:re.hasRequest(t)}),s?e.jsx("span",{children:s}):null]})]})}function ss({businessName:t,finishes:s}){const n=s.filter(r=>r.name.trim()&&r.swatchUrl).slice(0,4);return n.length<2?null:e.jsxs("section",{className:"sf-more","aria-label":re.moreFinishes(t),children:[e.jsx("h2",{children:re.moreFinishes(t)}),e.jsx("ul",{children:n.map(r=>e.jsx(kt,{finish:r},r.id))})]})}function kt({finish:t}){const[s,n]=l.useState(!1);return e.jsxs("li",{children:[e.jsx("span",{className:"sf-more-swatch",children:s?null:e.jsx("img",{src:t.swatchUrl,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>n(!0)})}),e.jsx("span",{className:"sf-more-name",children:t.name})]})}function Lt(t,s=re.slowAfterMs,n){const[r,o]=l.useState(!1);return l.useEffect(()=>{if(!t){o(!1);return}const i=n===void 0?s:s-(Date.now()-n);if(i<=0){o(!0);return}o(!1);const f=window.setTimeout(()=>o(!0),i);return()=>window.clearTimeout(f)},[t,s,n]),r}function ns(t){var r;if(!t||typeof t.business_name!="string")return null;const s=(r=t.business_name)==null?void 0:r.trim(),n=t.request_disclosure;return t.leads_enabled&&s&&(n==null?void 0:n.id)===qe&&n.text===bt(s)&&/^[a-f0-9]{64}$/.test(n.receipt_key)?n:null}function $e(t,s){if(typeof t!="string"||/[\s\\]/.test(t))return null;try{const n=new URL(t,s);return n.origin!==s||n.username||n.password||n.search||n.hash||!/^\/v\/[a-zA-Z0-9_-]{16,128}$/.test(n.pathname)?null:n.href}catch{return null}}function It(t,s){const n=$e(t,s);return n?new URL(n).pathname.slice(3):null}function ze(t,s){if(typeof t!="string"||/[\s\\]/.test(t))return null;try{const n=new URL(t,s);return!(n.origin===s&&n.protocol==="http:")&&n.protocol!=="https:"||n.username||n.password||n.hash?null:n.href}catch{return null}}function Rt(t,s,n,r){if(!t||typeof t!="object")return null;const o=t;if(o.version!==void 0&&o.version!=="v2")return null;const i=o.contractor;if(!i||typeof i!="object"||i.companyName!==s)return null;const f=ze(o.afterImage,r);if(!f)return null;const h=o.material,c=h&&typeof h=="object"?h.name:null,m=typeof c=="string"&&c.trim()?c.trim():null,d=typeof n=="string"&&n.trim()?n.trim():null;return m!==d?null:{afterImage:f,materialName:m}}function Pt(t,s){if(!t||typeof t!="object")return null;const n=t,r=ze(n.beforeImage,s);if(!r)return null;const o=n.natural,i=Number(o==null?void 0:o.width),f=Number(o==null?void 0:o.height),h=Number.isInteger(i)&&Number.isInteger(f)&&i>0&&f>0&&i<=32768&&f<=32768?{width:i,height:f}:null;return{beforeImage:r,natural:h}}function rs(t){return typeof t=="string"&&/^[a-zA-Z0-9_-]{32}$/.test(t)}function os(t,s){return t===429&&s==="RATE_LIMIT_EXCEEDED"?"Too many requests right now. Wait a few minutes, then send again — your photo, floor choice and details are still here.":[400,409,413,415,422,503].includes(t)?s==="TURNSTILE_REQUIRED"?"Complete the verification to continue.":s==="IMAGE_TOO_SMALL"?"Choose a room photo at least 512 pixels wide and tall.":t===413||s==="LIMIT_FILE_SIZE"?"Choose a photo up to 12 MB.":["INVALID_IMAGE","UNSUPPORTED_MEDIA_TYPE","IMAGE_PROCESSING_FAILED","NO_PHOTO"].includes(String(s))?"Choose a JPG, PNG or WebP room photo.":s==="INVALID_SUBMISSION"?"Check your name and email, then try again.":t===422&&["INVALID_MATERIAL","NO_MATERIAL","TOO_MANY_MATERIALS"].includes(String(s))?"Go back and choose another floor.":t===422&&s==="UAT_EMAIL_MISMATCH"||t===503&&s==="LEADS_UNAVAILABLE"?"We can’t accept this request right now. Try again later.":t===409&&s==="REQUEST_DETAILS_CHANGED"?"The project details have changed. Refresh this page before sending your request.":null:null}const Ce=30*1024*1024,Ot=128*1024,Ct=15e3,Ue=new Set(["image/jpeg","image/png","image/webp","image/avif"]);async function ge(t,s){var c,m;const n=Number(t.headers.get("content-length"));if(Number.isFinite(n)&&n>s)throw await((c=t.body)==null?void 0:c.cancel()),new Error("response too large");const r=(m=t.body)==null?void 0:m.getReader();if(!r)throw new Error("response body unavailable");const o=[];let i=0;try{for(;;){const{done:d,value:p}=await r.read();if(d)break;if(p){if(i+=p.byteLength,i>s)throw await r.cancel(),new Error("response too large");o.push(p)}}}finally{r.releaseLock()}const f=new Uint8Array(i);let h=0;for(const d of o)f.set(d,h),h+=d.byteLength;return f}function Te(t,s){return new Promise((n,r)=>{if(s.aborted){r(new Error("preview image load aborted"));return}const o=new Image;let i=!1;const f=c=>{i||(i=!0,o.onload=null,o.onerror=null,s.removeEventListener("abort",h),c?r(c):n())},h=()=>f(new Error("preview image load aborted"));o.onload=()=>f(),o.onerror=()=>f(new Error("preview image could not be decoded")),s.addEventListener("abort",h,{once:!0}),s.aborted?h():o.src=t})}function Ut({dealer:t,materialName:s,resultUrl:n,onStateChange:r,compare:o=!1,showLink:i=!0,onOpenLink:f}){const[h,c]=l.useState(0),[m,d]=l.useState({kind:"loading"}),p=l.useRef(null);if(l.useEffect(()=>{const g=It(n,window.location.origin),u=new AbortController;let b=!1,S=null,y=null;const w=()=>{var T;if(y&&(URL.revokeObjectURL(y),y=null),!S)return;const O=S;S=null,((T=p.current)==null?void 0:T.url)===O&&(p.current=null),URL.revokeObjectURL(O)};d({kind:"loading"}),r("loading");const U=window.setTimeout(()=>u.abort(),Ct),_=O=>{b||(d(O),r(O.kind))};async function k(){var O,T,z,W;if(!g){window.clearTimeout(U),_({kind:"unavailable"});return}try{const I=await fetch(`/api/viz-share/${encodeURIComponent(g)}`,{signal:u.signal,cache:"no-store",credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"});if(b)return;
1if(I.status===410){await((O=I.body)==null?void 0:O.cancel()),_({kind:"expired"});return}if(!I.ok){await((T=I.body)==null?void 0:T.cancel()),_({kind:"unavailable"});return}const H=await ge(I,Ot),G=JSON.parse(new TextDecoder().decode(H)),F=Rt(G,t,s,window.location.origin);if(!F||b){b||_({kind:"unavailable"});return}const $=await fetch(F.afterImage,{signal:u.signal,cache:"no-store",credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"}),L=(z=$.headers.get("content-type"))==null?void 0:z.split(";",1)[0].trim().toLowerCase();if(!$.ok||!L||!Ue.has(L))throw new Error("preview image unavailable");const M=await ge($,Ce);if(!M.byteLength||b)throw new Error("preview image unavailable");const C=URL.createObjectURL(new Blob([M],{type:L}));if(b){URL.revokeObjectURL(C);return}S=C,p.current={url:C,release:w},await Te(C,u.signal);const x=o?Pt(G,window.location.origin):null;let A=null;if(x)try{const j=await fetch(x.beforeImage,{signal:u.signal,cache:"no-store",credentials:"omit",redirect:"error",referrerPolicy:"no-referrer"}),V=(W=j.headers.get("content-type"))==null?void 0:W.split(";",1)[0].trim().toLowerCase();if(!j.ok||!V||!Ue.has(V))throw new Error("before image unavailable");const K=await ge(j,Ce);if(!K.byteLength||b)throw new Error("before image unavailable");A=URL.createObjectURL(new Blob([K],{type:V})),y=A,await Te(A,u.signal)}catch{if(b)throw new Error("preview load stopped");y&&(URL.revokeObjectURL(y),y=null),A=null}_({kind:"ready",imageUrl:C,materialName:F.materialName,beforeUrl:A,natural:(x==null?void 0:x.natural)??null})}catch{u.abort(),w(),b||_({kind:"unavailable"})}finally{window.clearTimeout(U)}}return k(),()=>{b=!0,window.clearTimeout(U),u.abort(),w()}},[h,t,s,r,n,o]),m.kind==="loading")return e.jsx("div",{className:"sf-request-preview-state",role:"status",children:e.jsx("div",{className:"sf-request-preview-placeholder",children:"Loading preview…"})});if(m.kind==="expired")return e.jsx("div",{className:"sf-request-preview-state",role:"status",children:e.jsxs("p",{children:["Contact ",t," for help."]})});if(m.kind==="unavailable")return e.jsxs("div",{className:"sf-request-preview-state",role:"status",children:[e.jsx("div",{className:"sf-request-preview-placeholder",children:"Preview unavailable"}),e.jsx("button",{type:"button",className:"sf-photo-secondary",onClick:()=>c(g=>g+1),children:"Try loading preview again"})]});const E=()=>{var g;(g=p.current)==null||g.release(),d({kind:"unavailable"}),r("unavailable")};return e.jsxs("div",{className:"sf-request-preview-result",children:[e.jsxs("figure",{children:[m.beforeUrl?e.jsx("div",{className:"sf-request-preview-compare",style:m.natural?{aspectRatio:`${m.natural.width} / ${m.natural.height}`}:void 0,children:e.jsx(at,{beforeSrc:m.beforeUrl,afterSrc:m.imageUrl,natural:m.natural||void 0,fit:"contain",handleVariant:"editorial",labels:{before:"Before",after:"After"},onAfterError:E,onBeforeError:()=>d(g=>g.kind==="ready"?{...g,beforeUrl:null}:g)})}):e.jsx("img",{src:m.imageUrl,alt:"Your generated floor preview",onError:E}),m.materialName?e.jsx("figcaption",{children:m.materialName}):null]}),i?e.jsxs("a",{className:"sf-photo-secondary sf-request-result",href:n,target:"_blank",rel:"noopener noreferrer",onClick:f,children:["Share or download",e.jsx("span",{className:"sf-photo-small",children:"Opens in a new tab"})]}):null]})}const Tt=()=>{},Mt="image/jpeg,image/png,image/webp,image/heic,image/heif",Dt=12*1024*1024;function Me(t,s){return t===429||s==="RATE_LIMIT_EXCEEDED"?"Too many requests right now. Please wait a few minutes, then try again.":s==="IMAGE_TOO_SMALL"?"That photo is too small. Choose a room photo at least 512 pixels wide and tall.":t===413||s==="LIMIT_FILE_SIZE"?"That photo is too large. Choose one smaller than 12 MB.":s==="INVALID_IMAGE"||s==="UNSUPPORTED_MEDIA_TYPE"||s==="IMAGE_PROCESSING_FAILED"||s==="NO_PHOTO"?"We could not read that photo. Choose a JPG, PNG, WebP, HEIC, or HEIF image.":s==="LEADS_UNAVAILABLE"?"Previews are temporarily unavailable. Please try again in a few minutes.":"We couldn't start the preview. Please try again in a moment."}function Ft({material:t,materials:s,config:n,businessName:r,slug:o,accentColor:i,uatToken:f,onNewRequest:h,onTrack:c}){var Ee,Ae;
1const m=r||"your contractor",d=We(o,f),p=He(d),[E,g]=l.useState({status:"form"}),u=l.useMemo(()=>{const a=p.attempt;if(!a)return E;switch(a.phase){case"sending":return{status:"sending"};case"post_unknown":return{status:"submission_unknown"};case"accepted_pending":return a.leadToken?{status:"progress",leadToken:a.leadToken,startedAt:a.startedAt}:{status:"failed_soft"};case"accepted_unknown":return{status:"failed_soft"};case"delivered":return{status:"delivered",resultUrl:a.resultUrl};case"deferred":return{status:"deferred"};case"failed":return{status:"failed"}}},[p.attempt,E]),[b,S]=l.useState(null),[y,w]=l.useState(null),[U,_]=l.useState(!1),[k,O]=l.useState(""),[T,z]=l.useState(""),[W,I]=l.useState(""),[H,G]=l.useState(""),[F,$]=l.useState(""),[L,M]=l.useState(""),[C,x]=l.useState(!!(typeof window<"u"&&((Ee=window.turnstile)!=null&&Ee.render))),[A,j]=l.useState({}),[V,K]=l.useState(!1),Z=l.useRef(!1),oe=l.useRef(!1),ie=l.useRef(null),le=l.useRef(null),te=l.useRef(!1),xe=l.useRef(null),Q=l.useRef(null),Ve=n.finalists_per_lead===2&&s.length>1,me=!!n.turnstile_site_key,Ke=s.filter(a=>a.id!==t.id),Je=Lt(u.status==="progress",re.slowAfterMs,u.status==="progress"?u.startedAt:void 0),be=!f&&!!r,ae=be?e.jsx("div",{className:"mt-4",children:e.jsx(St,{businessName:r,accentColor:i,detail:re.mayContact})}):null;l.useEffect(()=>{var a;u.status==="form"&&te.current&&(te.current=!1,(a=le.current)==null||a.focus())},[u.status]),l.useEffect(()=>()=>{y&&URL.revokeObjectURL(y),_(!1)},[y]),l.useEffect(()=>{u.status!=="delivered"||oe.current||(oe.current=!0,c==null||c("showfloor_preview_ready",{material_name:t.name??void 0}))},[u.status,c,t.name]),l.useEffect(()=>{var R,X;if(!n.turnstile_site_key||(R=window.turnstile)!=null&&R.render){x(!!((X=window.turnstile)!=null&&X.render));return}const N=()=>{var ee;return x(!!((ee=window.turnstile)!=null&&ee.render))};let v=document.querySelector('script[data-showfloor-turnstile="true"]');v||(v=document.createElement("script"),v.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",v.async=!0,v.defer=!0,v.dataset.showfloorTurnstile="true",document.head.appendChild(v)),v.addEventListener("load",N);const P=window.setInterval(N,250),B=window.setTimeout(()=>window.clearInterval(P),1e4);return N(),()=>{v==null||v.removeEventListener("load",N),window.clearInterval(P),window.clearTimeout(B)}},[n.turnstile_site_key]),l.useEffect(()=>{var N;const a=n.turnstile_site_key;if(!(!a||!C||!xe.current||!((N=window.turnstile)!=null&&N.render)||Q.current||u.status!=="form"))return Q.current=window.turnstile.render(xe.current,{sitekey:a,theme:"light",size:"flexible",callback:v=>{M(v),j(P=>({...P,turnstile:""}))},"expired-callback":()=>M(""),"error-callback":()=>M("")}),()=>{const v=window.turnstile;Q.current&&(v!=null&&v.remove)&&v.remove(Q.current),Q.current=null}},[n.turnstile_site_key,u.status,C]),l.useEffect(()=>{var ee;if(u.status!=="progress")return;let a=!1;const N=u.startedAt,v=u.leadToken,P=(ee=p.attempt)==null?void 0:ee.id;if(!P)return;const B=P;async function R(){if(!a)try{const Se=await fetch(`/api/public/visualizer/${encodeURIComponent(o)}/leads/${encodeURIComponent(v)}`,{headers:f?{"X-ShowFloor-UAT-Token":f}:void 0});if(!Se.ok)throw new Error("poll_failed");const D=await Se.json();if(D&&typeof D=="object"&&!Array.isArray(D)&&D.preview_status==="delivered"&&typeof D.result_url=="string"&&D.result_url.trim()){d.settle(B,"delivered",{resultUrl:D.result_url});return}if(D&&typeof D=="object"&&!Array.isArray(D)&&D.preview_status==="deferred"){d.settle(B,"deferred");return}if(D&&typeof D=="object"&&!Array.isArray(D)&&D.preview_status==="failed"){d.settle(B,"failed");return}!a&&Date.now()-N>=18e4&&d.settle(B,"accepted_unknown")}catch{!a&&Date.now()-N>=18e4&&d.settle(B,"accepted_unknown")}}R();const X=window.setInterval(()=>void R(),5e3);return()=>{a=!0,window.clearInterval(X)}},[u,o,f,d,(Ae=p.attempt)==null?void 0:Ae.id]);const Xe=a=>{if(y&&URL.revokeObjectURL(y),a&&a.size>Dt){S(null),w(null),j(N=>({...N,photo:"Choose a photo smaller than 12 MB."}));return}S(a),w(a?URL.createObjectURL(a):null),j(N=>({...N,photo:""})),a&&(c==null||c("showfloor_photo_added"))},Ze=()=>{const a={};return b||(a.photo="Add a photo of your space to continue."),k.trim()||(a.name="Add your name."),/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(T.trim())||(a.email="Add a valid email."),me&&!L&&(a.turnstile="Complete the verification to continue."),j(a),Object.keys(a).length===0},Qe=async a=>{if(a.preventDefault(),Z.current||p.attempt||!Ze()||!b)return;Z.current=!0;const N=[t.id,...F?[F]:[]],v=new FormData;v.set("photo",b),v.set("name",k.trim()),v.set("email",T.trim()),v.set("phone",W.trim()),v.set("zip",H.trim()),v.set("selected_material_ids",JSON.stringify(N)),v.set("turnstile_token",L),K(!0);let P=null;try{if(P=await d.begin(v,t.id),!P)return;v.set("submission_id",P);const B=await fetch(`/api/public/visualizer/${encodeURIComponent(o)}/leads`,{method:"POST",body:v,headers:{"X-ShowFloor-Turnstile-Token":L,...f?{"X-ShowFloor-UAT-Token":f}:{}}}),R=await B.json().catch(()=>null);if(!B.ok){if(!vt(B.status,R==null?void 0:R.code))d.settle(P,"post_unknown");else if(d.releasePrewrite(P))B.status===422&&(R==null?void 0:R.code)==="UAT_EMAIL_MISMATCH"?g({status:"email_error"}):(R==null?void 0:R.code)==="TURNSTILE_REQUIRED"?j(ee=>({...ee,turnstile:"Complete the verification to continue."})):g({status:"submit_error",message:Me(B.status,R==null?void 0:R.code)});else return;return}const X=jt(R);X?X.status==="deferred"?(d.settle(P,"deferred"),c==null||c("showfloor_preview_requested",{material_name:t.name??void 0})):(d.settle(P,"accepted_pending",{leadToken:X.leadToken}),c==null||c("showfloor_preview_requested",{material_name:t.name??void 0})):d.settle(P,"post_unknown")}catch{P?d.settle(P,"post_unknown"):g({status:"submit_error",message:Me(0)})}finally{Z.current=!1,K(!1),me&&window.turnstile&&Q.current&&(window.turnstile.reset(Q.current),M(""))}},we=ye(p.attempt)?e.jsx("button",{type:"button",className:"mt-5 min-h-12 w-full rounded-[9px] border border-stone-300 bg-white px-5 text-sm font-semibold text-stone-800",onClick:()=>{var N;const a=(N=p.attempt)==null?void 0:N.id;a&&d.newRequest(a)&&h()},children:"Preview another floor"}):null;if(u.status==="sending")return e.jsx(J,{icon:e.jsx(ke,{className:"h-5 w-5 animate-spin"}),title:"Sending your request…",children:e.jsx("p",{children:"Keep this page open."})});if(u.status==="submission_unknown")return e.jsx(J,{title:"We can’t confirm your request.",children:e.jsx("p",{children:"Please don’t submit it again."})});if(u.status==="progress")return e.jsxs(J,{title:"Your request is in.",children:[e.jsx("div",{className:"mt-4",children:e.jsx(At,{photoUrl:U?null:y,materialName:t.name,swatchUrl:ue(t),accentColor:i,surface:"page",announce:!1,slow:Je,showEmailNote:!f})}),ae]});if(u.status==="delivered"){const a=u.resultUrl&&r&&typeof window<"u"?$e(u.resultUrl,window.location.origin):null;return e.jsxs(J,{icon:e.jsx(ce,{className:"h-5 w-5"}),title:"Your preview is ready.",children:[a?e.jsx("div",{className:"mt-4",children:e.jsx(Ut,{dealer:r,materialName:t.name,resultUrl:a,c
1ompare:!0,showLink:!1,onStateChange:Tt})}):null,be?e.jsx("p",{className:"mt-3",children:"We also emailed you a link to this preview."}):null,u.resultUrl||n.estimator_slug?e.jsxs("div",{className:"mt-5 flex flex-col gap-2 sm:flex-row",children:[u.resultUrl?e.jsx("a",{href:u.resultUrl,onClick:()=>c==null?void 0:c("showfloor_preview_shared",{material_name:t.name??void 0}),className:"inline-flex min-h-12 flex-1 items-center justify-center rounded-[9px] border px-5 text-sm font-semibold transition-shadow hover:shadow-md active:shadow-inner focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2",style:ve(i),children:"Save or share your preview"}):null,n.estimator_slug?e.jsx("a",{href:`/estimate/${n.estimator_slug}`,className:"inline-flex min-h-12 flex-1 items-center justify-center rounded-[9px] border border-stone-300 bg-white px-5 text-sm font-semibold text-stone-800",children:"Request a quote"}):null]}):null,ae,we]})}return u.status==="deferred"?e.jsxs(J,{icon:e.jsx(ce,{className:"h-5 w-5"}),title:"Your request is in.",children:[e.jsx("p",{children:"A preview isn’t available for this request."}),e.jsx("p",{children:"Nothing else is needed from you — your request still went through."}),ae,we]}):u.status==="failed"?e.jsxs(J,{icon:e.jsx(ce,{className:"h-5 w-5"}),title:"Your request is in.",children:[e.jsx("p",{children:"We couldn’t create your preview this time."}),e.jsx("p",{children:"Nothing else is needed from you — your request still went through."}),ae,we]}):u.status==="failed_soft"?e.jsxs(J,{icon:e.jsx(ce,{className:"h-5 w-5"}),title:"Your request is in.",children:[e.jsx("p",{children:"We can’t confirm whether your preview is ready."}),be?e.jsx("p",{children:"If it finishes, we’ll email it to you."}):null,ae]}):u.status==="email_error"?e.jsxs(J,{title:"Check your email address.",children:[e.jsx("p",{children:"This email address can’t be used for this preview."}),e.jsx("button",{type:"button",onClick:()=>{te.current=!0,g({status:"form"})},className:"mt-5 min-h-12 w-full rounded-[9px] border border-stone-300 bg-white px-5 text-sm font-semibold text-stone-800",children:"Edit email"})]}):u.status==="submit_error"?e.jsxs(J,{title:"We couldn’t start the preview.",children:[e.jsx("p",{children:u.message}),e.jsx("button",{type:"button",onClick:()=>g({status:"form"}),className:"mt-5 min-h-12 w-full rounded-[9px] border border-stone-300 bg-white px-5 text-sm font-semibold text-stone-800",children:"Try again"})]}):e.jsxs("form",{onSubmit:Qe,className:"rounded-[10px] border border-stone-200 bg-stone-50/80 p-4 sm:p-5",noValidate:!0,children:[e.jsxs("div",{className:"border-b border-stone-200 pb-4",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-stone-500",children:"Room preview"}),e.jsx("h3",{className:"mt-1.5 text-[20px] font-semibold leading-7 text-stone-900",children:"Get your free preview"}),e.jsxs("p",{className:"mt-1 text-[13.5px] leading-5 text-stone-600",children:["Send one room photo. We’ll place ",t.name||"this floor"," in your space."]})]}),e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{htmlFor:"showroom-photo",className:"text-[13px] font-semibold text-stone-800",children:"Photo of your space"}),e.jsxs("button",{type:"button",onClick:()=>{var a;return(a=ie.current)==null?void 0:a.click()},className:q("mt-2 flex min-h-[132px] w-full items-center gap-4 roun
1ded-[9px] border bg-white p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stone-400 focus-visible:ring-offset-2",A.photo?"border-red-300":"border-stone-300 hover:border-stone-400"),children:[y&&!U?e.jsx("img",{src:y,alt:"Selected room",onError:()=>_(!0),className:"h-[106px] w-[112px] shrink-0 rounded-[7px] object-cover"}):e.jsx("span",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-stone-100 text-stone-600",children:e.jsx(ot,{className:"h-5 w-5"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"flex items-center gap-2 text-[14px] font-semibold text-stone-900",children:[e.jsx(it,{className:"h-4 w-4"}),b?"Change photo":"Choose a room photo"]}),e.jsx("span",{className:"mt-1 block text-[12.5px] leading-5 text-stone-500",children:"Wide angle, floor visible. JPG, PNG, WebP, or HEIC up to 12 MB."}),b?e.jsx("span",{className:"mt-1 block truncate text-[12px] text-stone-500",children:b.name}):null]})]}),e.jsx("input",{ref:ie,id:"showroom-photo",type:"file",accept:Mt,tabIndex:-1,className:"sr-only",onChange:a=>{var N;return Xe(((N=a.currentTarget.files)==null?void 0:N[0])??null)}}),A.photo?e.jsx("p",{className:"mt-1.5 text-[12.5px] text-red-700",children:A.photo}):null]}),Ve?e.jsxs("label",{className:"mt-5 block text-[13px] font-semibold text-stone-800",children:["Add a second floor ",e.jsx("span",{className:"font-normal text-stone-500",children:"(optional)"}),e.jsxs("select",{value:F,onChange:a=>$(a.currentTarget.value),className:"mt-2 block min-h-12 w-full rounded-[9px] border border-stone-300 bg-white px-3 text-[14px] font-normal text-stone-900 outline-none focus:border-stone-500 focus:ring-2 focus:ring-stone-200",children:[e.jsxs("option",{value:"",children:["Just ",t.name||"this floor"]}),Ke.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))]})]}):null,e.jsxs("div",{className:"mt-5 grid gap-3 sm:grid-cols-2",children:[e.jsx(he,{label:"Name",value:k,onChange:a=>{O(a),j(N=>({...N,name:""}))},error:A.name,autoComplete:"name"}),e.jsx(he,{label:"Email",inputRef:le,value:T,onChange:a=>{z(a),j(N=>({...N,email:""}))},error:A.email,type:"email",autoComplete:"email"}),e.jsx(he,{label:"Phone",optional:!0,value:W,onChange:I,type:"tel",autoComplete:"tel"}),e.jsx(he,{label:"ZIP",optional:!0,value:H,onChange:G,inputMode:"numeric",autoComplete:"postal-code"})]}),me?e.jsxs("div",{className:"mt-5 overflow-hidden",children:[e.jsx("div",{ref:xe,className:"min-h-[65px]"}),C?null:e.jsx("p",{className:"text-[12.5px] text-stone-500",children:"Loading verification…"}),A.turnstile?e.jsx("p",{className:"mt-1.5 text-[12.5px] text-red-700",children:A.turnstile}):null]}):null,e.jsx("button",{type:"submit",disabled:!p.ready||V||me&&!C,className:"mt-5 inline-flex min-h-12 w-full items-center justify-center rounded-[9px] border px-5 text-[14px] font-semibold transition-shadow hover:shadow-md active:shadow-inner focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-70 disabled:shadow-none",style:ve(i),children:V?e.jsxs(e.Fragment,{children:[e.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"})," Starting preview…"]}):"Get my preview"}),e.jsxs("p",{className:"mt-3 text-[11.5px] leading-5 text-stone-500",children:["By submitting, you agree that ",m," may contact you about your project."," ",e.jsx("a",{href:"/privacy",className:"inline-flex min-h-11 min-w-11 items-center justify-center align-middle font-semibold text-stone-700 underline underline-offset-2",children:"Privacy"})]})]})}function J({icon:t,title:s,children:n}){return e.jsxs("div",{className:"rounded-[10px] border border-stone-200 bg-stone-50/80 p-5",role:"status","aria-live":"polite",children:[t?e.jsx("span",{className:"mb-4 flex h-10 w-10 items-center justify-center rounded-full bg-stone-900 text-white",children:t}):null,e.jsx("h3",{id:"showroom-request-status-title",className:"text-[19px] font-semibold leading-7 text-stone-900",children:s}),e.jsx("div",{className:"mt-1.5 text-[13.5px] leading-6 text-stone-600",children:n})]})}function he({label:t,inputRef:s,optional:n,value:r,onChange:o,error:i,type:f="text",autoComplete:h,inputMode:c}){return e.jsxs("label",{className:"block text-[13px] font-semibold text-stone-800",children:[t," ",n?e.jsx("span",{className:"font-normal text-stone-500",children:"(optional)"}
1):null,e.jsx("input",{ref:s,type:f,value:r,autoComplete:h,inputMode:c,"aria-invalid":!!i,onChange:m=>o(m.currentTarget.value),className:q("mt-1.5 block min-h-12 w-full rounded-[9px] border bg-white px-3 text-[14px] font-normal text-stone-900 outline-none focus:ring-2 focus:ring-stone-200",i?"border-red-300 focus:border-red-400":"border-stone-300 focus:border-stone-500")}),i?e.jsx("span",{className:"mt-1.5 block text-[12.5px] font-normal text-red-700",children:i}):null]})}function Bt(t,s,n){const[r,o]=l.useState(!1),[i,f]=l.useState(!1),[h,c]=l.useState({state:"loading",attempt:0}),m=l.useRef(!1),d=l.useRef(null),[p,E]=l.useState(t);p!==t&&(E(t),o(!1),f(!1),c(w=>w.state==="loading"?w:{state:"loading",attempt:w.attempt}));const g=!i&&!!n&&n!==t,u=i?n??null:t,b=()=>{if(!s||m.current||i){if(g){f(!0),c(w=>({state:"loading",attempt:w.attempt+1}));return}c(w=>({...w,state:"failed"}));return}m.current=!0,d.current=t,c(w=>({...w,state:"resigning"})),Promise.resolve(s()).catch(()=>{}).then(()=>{c(w=>w.state==="resigning"?{state:"loading",attempt:w.attempt+1}:w)})},S=()=>{o(!0),m.current&&t!==d.current&&(m.current=!1)},y=h.state==="failed";return{currentSrc:u,loaded:r,failed:y,requesting:!!u&&h.state==="loading",unavailable:!u||y,attempt:h.attempt,handleLoad:S,handleError:b}}const qt="See your new floor before we install it",Wt="Upload a photo of your space and preview any floor we offer — free.",Ht="Browse the floors we offer and choose the look you want to discuss.",$t="See it in your space";function ue(t){return tt(t)||t.thumb_url||null}function Ge(t){return(typeof t.full_url=="string"?t.full_url.trim():"")||ue(t)}function se(t){const s=t==null?void 0:t.trim();return s||null}function De(t){return se(t.category)}function Ye({ctaLabel:t,accentColor:s,onActivate:n,className:r}){return e.jsx("button",{type:"button",onClick:n,className:q("inline-flex min-h-[48px] items-center justify-center rounded-[9px] border px-7 text-[14.5px] font-semibold transition-shadow hover:shadow-md active:shadow-inner focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-70 disabled:shadow-none",r),style:ve(s),children:t})}function ne({src:t,className:s,imgClassName:n,eager:r,fallbackLabel:o,onImageError:i,fallbackSrc:f}){const{currentSrc:h,loaded:c,failed:m,requesting:d,unavailable:p,attempt:E,handleLoad:g,handleError:u}=Bt(t,i,f);return e.jsxs("div",{className:q("relative overflow-hidden bg-stone-100",s),children:[h&&!c&&!m?e.jsx("div",{className:"absolute inset-0 animate-pulse bg-stone-100"}):null,p&&o?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center px-2 text-center",children:e.jsx("span",{"aria-hidden":"true",className:"text-[11px] font-medium leading-tight text-stone-600",children:o})}):null,d?e.jsx("img",{src:h,alt:"",loading:r?void 0:"lazy",onLoad:g,onError:u,className:q("h-full w-full object-cover transition-opacity duration-300",c?"opacity-100":"opacity-0",n)},E):null]})}function zt({config:t,materials:s,slug:n,previewBanner:r,uatToken:o,onBrowseCommit:i,embedded:f=!1,inlineViewport:h,studioPreview:c=!1,onImageError:m,onTrack:d}){var M,C;const p=c?"section":"main",E=c?"h2":"h1",g=Ne(t.accent_color),u=pe(g),b=se(t.business_name),S=se(t.headline)||qt,y=se(t.intro_text)||(t.leads_enabled?Wt:Ht),w=se(t.cta_label)||$t,U=pt(b),_=((M=t.presentation)==null?void 0:M.version)==="visualizer-presentation-v1"&&t.presentation.mode==="white_label"&&!!b,[k,O]=l.useState("All"),[T,z]=l.useState(null),W=l.useCallback(()=>z(null),[]),I=l.useMemo(()=>ht(s),[s]),H=l.useMemo(()=>{const x=I.map(De).filter(A=>!!A);return["All",...Array.from(new Set(x))]},[I]),G=k==="All"?I:I.filter(x=>De(x)===k),F=I.length>0,$=((C=I.find(x=>se(x.example_render_url)))==null?void 0:C.example_render_url)||null,L=!!(t.uat_mode&&o);return l.useEffect(()=>{i==null||i(G.some(x=>{var A;return!!(x.id&&((A=x.name)!=null&&A.trim()))}))},[G,i]),l.useEffect(()=>{k!=="All"&&(H.includes(k)||O("All"))},[k,H]),e.jsxs("div",{className:q(!f&&"min-h-[100dvh]","relative bg-[#f7f6f3] text-stone-900"),children:[L&&t.uat_mode?e.jsx("div",{className:"sticky top-0 z-40 flex items-center bg-[#f7f6f3] p-5",children:e.jsx("span",{className:"inline-flex rounded-[6px] bg-amber-100 px-[9px] py-[3px] text-[12px] font-semibold leading-[18px] text-amber-900",children:"Demo"})}):null,e.jsxs(p,{"aria-label":c?"Live preview":void 0,className:"mx-auto flex w-full max-w-[1280px] flex-col px-0 py-0 sm:px-6 sm:py-10",children:[r?e.jsx("div",{className:"mb-4 rounded-[9px] border border-stone-200 bg-white px-4 py-2.5 text-[13px] font-medium leading-5 text-stone-600",children:r}):null,e.jsxs("article",{className:"overflow-hidden border-y border-stone-200/90 bg-[#fbf8f2] shadow-[0_24px_64px_-16px_rgba(41,37,36,0.14)] sm:rou
1nded-[18px] sm:border",children:[e.jsxs("header",{className:"flex min-h-[76px] items-center justify-between gap-4 border-b border-stone-200 px-5 py-4 sm:min-h-[86px] sm:px-10",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.logo_url?e.jsx("span",{className:"flex h-11 min-w-11 max-w-[148px] shrink-0 items-center justify-center overflow-hidden rounded-[9px] border border-stone-200 bg-white px-2 py-1.5 sm:max-w-[220px]",children:e.jsx("img",{src:t.logo_url,alt:b||"",className:"h-8 w-auto max-w-full object-contain"})}):U?e.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#06101b] text-[12px] font-semibold text-white",children:U}):null,b?e.jsx("p",{className:q("line-clamp-2 text-[15px] font-semibold leading-5 text-stone-900 sm:truncate",t.logo_url&&"hidden sm:block"),children:b}):null]}),e.jsx("p",{className:"shrink-0 text-[10px] font-semibold uppercase tracking-[0.14em] text-stone-500 sm:text-[11px]",children:ut})]}),$?e.jsxs("section",{className:"relative min-h-[430px] overflow-hidden sm:min-h-[520px]",children:[e.jsx(ne,{src:$,className:"absolute inset-0 h-full w-full",eager:!0}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#06101b]/80 via-[#06101b]/20 to-transparent sm:bg-gradient-to-r sm:from-[#06101b]/75 sm:via-[#06101b]/20"}),e.jsxs("div",{className:"relative z-10 flex min-h-[430px] max-w-[650px] flex-col justify-end px-6 py-10 text-white sm:min-h-[520px] sm:justify-center sm:px-14 sm:py-16",children:[e.jsx(E,{className:"max-w-[11ch] font-display-serif text-[44px] font-normal leading-[0.98] tracking-[-0.035em] sm:text-[68px]",children:S}),e.jsx("p",{className:"mt-5 max-w-[48ch] text-[14px] leading-6 text-stone-100 sm:text-[16px]",children:y})]})]}):e.jsxs("section",{className:"px-6 py-12 sm:px-14 sm:py-16",children:[e.jsx(E,{className:"max-w-[16ch] font-display-serif text-[42px] font-normal leading-[1.02] tracking-[-0.03em] text-stone-900 sm:text-[62px]",children:S}),e.jsx("p",{className:"mt-4 max-w-[56ch] text-[14px] leading-6 text-stone-500 sm:text-[16px]",children:y})]}),F?e.jsxs("section",{className:"pb-10 sm:pb-12",children:[H.length>
12?e.jsx("nav",{"aria-label":"Floor categories",className:"overflow-x-auto overscroll-x-contain border-b border-stone-200 pl-2 [mask-image:linear-gradient(90deg,#000_0,#000_calc(100%-34px),transparent_100%)] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden sm:px-10 sm:[mask-image:none]",children:e.jsx("div",{className:"flex min-w-max pr-8 sm:pr-0",children:H.map(x=>e.jsx("button",{type:"button",onClick:()=>O(x),"aria-pressed":k===x,className:q("min-h-[60px] min-w-11 border-b-[3px] border-transparent px-1.5 text-[12px] font-semibold transition-colors sm:min-h-[68px] sm:px-6 sm:text-[13px]",k===x?"text-stone-950":"text-stone-500 hover:text-stone-900"),style:k===x?{borderBottomColor:u,color:u}:void 0,children:x==="All"?"All floors":_e(x)},x))})}):null,e.jsx("div",{className:"flex items-end justify-between gap-8 px-5 pb-5 pt-10 sm:px-10 sm:pb-7 sm:pt-12",children:e.jsxs("div",{children:[e.jsx("h2",{className:"font-display-serif text-[34px] font-normal leading-none tracking-[-0.03em] text-stone-950 sm:text-[48px]",children:"Browse by material"}),e.jsxs("p",{className:"mt-3 max-w-[62ch] text-[13px] leading-6 text-stone-500 sm:text-[14px]",children:["Explore the floors and surfaces ",b?`${b} offers`:"available here","."]})]})}),e.jsx("div",{id:"showroom-material-grid",className:"grid grid-cols-2 gap-3 px-5 sm:grid-cols-3 sm:gap-5 sm:px-10",children:G.map(x=>{const A=ue(x),j=Be(t,x);return e.jsxs("button",{type:"button",onClick:()=>{z(x),d==null||d("showfloor_finish_selected",{material_name:x.name??void 0})},className:"group overflow-hidden rounded-[12px] border border-stone-200 bg-white text-left transition-all hover:-translate-y-0.5 hover:border-stone-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stone-400 focus-visible:ring-offset-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ne,{src:A,className:"aspect-square sm:aspect-[4/3]",fallbackLabel:de,onImageError:m}),x.featured?e.jsx("span",{className:"absolute left-2 top-2 rounded-full bg-stone-100 px-2.5 py-1 text-[11px] font-medium leading-4 text-stone-600",children:mt}):null]}),e.jsxs("div",{className:"px-3 py-3.5 sm:px-4 sm:py-4",children:[e.jsx("p",{className:"line-clamp-2 text-[14px] font-semibold leading-5 text-stone-900 sm:text-[16px]",children:x.name}),j?e.jsx("p",{className:"mt-1 truncate text-[11.5px] leading-5 text-stone-500 sm:text-[12.5px]",children:j}):null]})]},x.id)})}),t.leads_enabled?e.jsxs("div",{className:"mx-5 mt-8 flex flex-col gap-4 roun
1ded-[14px] border border-stone-300 bg-[#efe8dd] p-4 sm:mx-10 sm:flex-row sm:items-center sm:justify-between sm:p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-display-serif text-[22px] leading-tight text-stone-950",children:"See a floor in your room."}),e.jsx("p",{className:"mt-1 text-[12px] text-stone-600",children:"Choose a product first. No app required."})]}),e.jsx(Ye,{ctaLabel:"Choose a floor to preview",accentColor:g,onActivate:()=>{var x;return(x=document.getElementById("showroom-material-grid"))==null?void 0:x.scrollIntoView({behavior:"smooth",block:"start"})},className:"w-full sm:w-auto"})]}):null]}):e.jsxs("section",{className:"px-6 pb-12 sm:px-14 sm:pb-16",children:[e.jsx("h2",{className:"font-display-serif text-[22px] font-normal leading-tight text-stone-950",children:ct}),e.jsx("p",{className:"mt-2 max-w-[56ch] text-[14px] leading-6 text-stone-600",children:dt(b)})]}),e.jsx("footer",{className:"flex min-h-[84px] items-center justify-center border-t border-stone-200 bg-stone-50/70 px-6 py-5 text-center sm:px-10",children:_?e.jsx("p",{className:"text-[12px] font-medium leading-5 text-stone-500",children:rt(b??"")}):e.jsx("a",{href:`https://showfloor.ai?utm_source=visualizer&utm_medium=hosted&utm_campaign=${encodeURIComponent(n)}`,className:"inline-flex min-h-[44px] items-center text-[12px] font-medium leading-5 text-stone-500 underline-offset-2 hover:text-stone-900 hover:underline",children:"Powered by ShowFloor"})})]})]}),T?e.jsx(Gt,{material:T,materials:I,config:t,businessName:b,ctaLabel:w,accentColor:g,slug:n,uatToken:o,inlineViewport:h,onClose:W,onImageError:m,onTrack:d}):null]})}function Gt({material:t,materials:s,config:n,businessName:r,ctaLabel:o,accentColor:i,slug:f,uatToken:h,inlineViewport:c,onClose:m,onImageError:d,onTrack:p}){const[E,g]=l.useState(!1),[u,b]=l.useState(t),{attempt:S}=He(We(f,h)),y=S?s.find(L=>L.id===S.materialId):null,w=E&&!!S&&!y,U=E&&y?y:u,_=s.find(L=>L.id===U.id)??U,k=l.useRef(null),O=l.useRef(null),T=l.useRef(null),z=l.useRef(null),W=ue(_),I=Ge(_),H=Fe(n,_),G=Be(n,_),F=_e(_.category),$=!!c;return l.useEffect(()=>{z.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const L=document.body.style.overflow,M=document.body.style.paddingRight,C=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",C>0&&(document.body.style.paddingRight=`${C}px`);const x=window.requestAnimationFrame(()=>{var j;return(j=T.current)==null?void 0:j.focus()}),A=j=>{var oe,ie,le;if(j.key==="Escape"){j.preventDefault(),m();return}if(j.key!=="Tab")return;const V=Array.from(((oe=k.current)==null?void 0:oe.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))||[]).filter(te=>te.getClientRects().length>0&&te.getAttribute("aria-hidden")!=="true"),K=V[0],Z=V[V.length-1];!K||!Z?(j.preventDefault(),(ie=k.current)==null||ie.focus()):(le=k.current)!=null&&le.contains(document.activeElement)?j.shiftKey&&document.activeElement===K?(j.preventDefault(),Z.focus()):!j.shiftKey&&document.activeElement===Z&&(j.preventDefault(),K.focus()):(j.preventDefault(),K.focus())};return window.addEventListener("keydown",A),()=>{var j;window.cancelAnimationFrame(x),window.removeEventListener("keydown",A),document.body.style.overflow=L,document.body.style.paddingRight=M,(j=z.current)!=null&&j.isConnected&&z.current.focus()}},[m]),l.useEffect(()=>{var L,M;(L=k.current)==null||L.scrollTo({top:0,left:0,behavior:"auto"}),(M=O.current)==null||M.scrollTo({top:0,left:0,behavior:"auto"})},[E]),e.jsx("div",{className:q("z-50 flex items-end justify-center bg-[#06101b]/75 lg:items-center lg:p-8",$?"absolute inset-x-0":"fixed inset-0"),style:c?{top:c.top,height:c.height}:void 0,onClick:m,children:e.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":w?"showroom-request-status-title":"showroom-dialog-title",tabIndex:-1,className:q("relative w-full overflow-y-auto rounded-t-[20px] bg-white shadow-2xl lg:rounded-[20px]",$?"max-h-[calc(100%-16px)] lg:max-h-[calc(100%-64px)]":"max-h-[96dvh] lg:max-h-[min(880px,calc(100dvh-64px))]",w?"lg:max-w-[390px]":q("lg:grid lg:max-w-[1180px] lg:grid-cols-[1.15fr_.85fr] lg:grid-rows-[minmax(0,1fr)] lg:overflow-hidden lg:border lg:border-stone-300",E&&($?"lg:h-[c
1alc(100%-64px)]":"lg:h-[min(880px,calc(100dvh-64px))]"))),onClick:L=>L.stopPropagation(),children:[e.jsxs("section",{className:q("bg-[#06101b] text-white",w?"flex flex-col items-start p-5":E?"p-5 lg:p-10":"p-5 lg:p-8"),children:[e.jsxs("button",{ref:T,type:"button",onClick:E&&!w?()=>{y&&b(y),g(!1)}:m,className:"inline-flex min-h-11 items-center rounded-full px-1 text-[13px] font-semibold text-stone-200 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",children:["← ",E&&!w?"Back to floor details":"Back to all floors"]}),w?null:E?e.jsxs("div",{className:"mt-3 lg:mt-7",children:[e.jsx("h2",{id:"showroom-dialog-title",className:"font-display-serif text-[31px] font-normal leading-[1.03] tracking-[-0.03em] lg:text-[48px]",children:"Picture it in your room."}),e.jsxs("p",{className:"mt-3 max-w-[46ch] text-[13px] leading-6 text-stone-300 lg:text-[14px]",children:["Add one clear photo. ",r||"Your contractor"," will receive the room, your selected floor, and the contact details you choose to share."]}),e.jsxs("figure",{className:"mt-6 hidden lg:block",children:[e.jsx(ne,{src:I,fallbackSrc:W,className:"aspect-[16/6] rounded-[12px]",eager:!0,fallbackLabel:de,onImageError:d}),e.jsx("figcaption",{className:"mt-2 text-[12px] leading-5 text-stone-300",children:"Selected floor texture"})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-3 rounded-[12px] border border-white/20 p-3 lg:mt-5",children:[e.jsx(ne,{src:W,className:"h-16 w-16 shrink-0 rounded-[8px]",eager:!0,fallbackLabel:de,onImageError:d}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("strong",{className:"block truncate text-[13px]",children:_.name}),G?e.jsx("span",{className:"mt-1 block truncate text-[12px] text-stone-300",children:G}):null]})]})]}):e.jsxs("figure",{className:"mt-3 lg:mt-5",children:[e.jsx(ne,{src:_.example_render_url||I,fallbackSrc:_.example_render_url?null:W,className:"aspect-[16/10] rounded-[14px] lg:aspect-[1.35]",eager:!0,fallbackLabel:de,onImageError:d},_.id),e.jsx("figcaption",{className:"mt-3 text-[12px] leading-5 text-stone-300",children:_.example_render_url?"Shown in a sample space":"Product texture"})]})]}),e.jsxs("section",{ref:O,className:q("relative overflow-y-auto bg-[#fbf8f2] p-5 pt-16",!w&&"sm:p-7 sm:pt-16 lg:p-9 lg:pt-16"),children:[n.uat_mode&&h?e.jsx("div",{className:"absolute left-5 top-5 z-10",children:e.jsx("span",{className:"inline-flex rounded-[6px] bg-amber-100 px-[9px] py-[3px] text-[12px] font-semibold leading-[18px] text-amber-900",children:"Demo"})}):null,e.jsx("button",{type:"button",onClick:m,"aria-label":"Close",className:"absolute right-4 top-3 flex h-11 w-11 items-center justify-center rounded-full border border-stone-300 bg-white text-stone-500 transition-colors hover:border-stone-400 hover:text-stone-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stone-400",children:e.jsx(lt,{className:"h-4 w-4"})}),E?e.jsx(Ft,{material:_,materials:s,config:n,businessName:r,slug:f,accentColor:i,uatToken:h,onNewRequest:m,onTrack:p}):e.jsxs("div",{className:"flex min-h-full flex-col",children:[F?e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.13em]",style:{color:pe(i)},children:F}):null,e.jsx("h2",{id:"showroom-dialog-title",className:"mt-3 font-display-serif text-[36px] font-normal leading-[1.02] tracking-[-0.03em] text-stone-950 lg:text-[46px]",children:_.name||"Floor detail"}),_.finish?e.jsx("p",{className:"mt-4 text-[14px] leading-6 text-stone-600",children:_.finish}):null,e.jsx(ne,{src:I,fallbackSrc:W,className:"mt-6 aspect-[16/10] rounded-[12px] lg:aspect-[4/3]",eager:!0,fallbackLabel:de}),e.jsxs("dl",{className:"mt-6 border-t border-stone-300 text-[13px]",children:[H?e.jsxs("div",{className:"grid min-h-12 grid-cols-[96px_1fr] items-center border-b border-stone-300",children:[e.jsx("dt",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-stone-500",children:"Brand"}),e.jsx("dd",{className:"m-0 font-semibold text-stone-900",children:H})]}):null,F?e.jsxs("div",{className:"grid min-h-12 grid-cols-[96px_1fr] items-center border-b border-stone-300",children:[e.jsx("dt",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-stone-500",children:"Surface"}),e.jsx("dd",{className:"m-0 font-semibold text-stone-900",children:F})]}):null,_.finish?e.jsxs("div",{className:"grid min-h-12 grid-cols-[96px_1fr] items-center border-b border-stone-300",children:[e.jsx("dt",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-stone-500",children:"Finish"}),e.jsx("dd",{className:"m-0 font-semibold text-stone-900",children:_.finish})]}):null]}),n.leads_enabled?e.jsx(Ye,{ctaLabel:o,accentColor:i,onActivate:()=>g(!0),className:"mt-7 w-full lg:mt-auto"}):null]})]})]})})}const is=Object.freeze(Object.defineProperty({__proto__:null,VisualizerShowroom:zt,getPublicVisualizerFullUrl:Ge,getPublicVisualizerThumbUrl:ue},Symbol.toStringTag,{value:"Module"}));
1export{re as A,qe as D,ss as M,At as P,ts as S,zt as V,St as W,pe as a,ns as b,ue as c,os as d,Bt as e,de as f,ve as g,Qt as h,es as i,is as j,Re as p,Ne as r,ze as s,Lt as u,rs as v};

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.