1import{j as e}from"./jsx-runtime-CuP2xq57.js";import{A as Le,B as ze,R as $e,r as g,y as Ye}from"./chunk-JZWAC4HX-DvFdmerS.js";import{g as Ue,d as Ge,a as Ve}from"./firebase-YQaWUxJx.js";import{_ as te}from"./preload-helper-BXl3LOEh.js";import{R as He}from"./product-templates-ANoaiE4K.js";import{l as Pe}from"./google-maps-DchGsElW.js";const Je={},fe=t=>{let s;const i=new Set,a=(h,d)=>{const m=typeof h=="function"?h(s):h;if(!Object.is(m,s)){const j=s;s=d??(typeof m!="object"||m===null)?m:Object.assign({},s,m),i.forEach(c=>c(s,j))}},n=()=>s,u={setState:a,getState:n,getInitialState:()=>f,subscribe:h=>(i.add(h),()=>i.delete(h)),destroy:()=>{(Je?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},f=s=t(a,n,u);return u},Ke=t=>t?fe(t):fe;var ne={exports:{}},re={},le={exports:{}},oe={};var be;function Qe(){if(be)return oe;be=1;var t=Le();function s(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:s,a=t.useState,n=t.useEffect,r=t.useLayoutEffect,l=t.useDebugValue;function x(d,m){var j=m(),c=a({inst:{value:j,getSnapshot:m}}),o=c[0].inst,q=c[1];return r(function(){o.value=j,o.getSnapshot=m,u(o)&&q({inst:o})},[d,j,m]),n(function(){return u(o)&&q({inst:o}),d(function(){u(o)&&q({inst:o})})},[d]),l(j),j}function u(d){var m=d.getSnapshot;d=d.value;try{var j=m();return!i(d,j)}catch{return!0}}function f(d,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:x;return oe.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,oe}var ge;function Ze(){return ge||(ge=1,le.exports=Qe()),le.exports}var xe;
1function Xe(){if(xe)return re;xe=1;var t=Le(),s=Ze();function i(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var a=typeof Object.is=="function"?Object.is:i,n=s.useSyncExternalStore,r=t.useRef,l=t.useEffect,x=t.useMemo,u=t.useDebugValue;return re.useSyncExternalStoreWithSelector=function(f,h,d,m,j){var c=r(null);if(c.current===null){var o={hasValue:!1,value:null};c.current=o}else o=c.current;c=x(function(){function N(M){if(!w){if(w=!0,b=M,M=m(M),j!==void 0&&o.hasValue){var C=o.value;if(j(C,M))return k=C}return k=M}if(C=k,a(b,M))return C;var P=m(M);return j!==void 0&&j(C,P)?(b=M,C):(b=M,k=P)}var w=!1,b,k,p=d===void 0?null:d;return[function(){return N(h())},p===null?void 0:function(){return N(p())}]},[h,d,m,j]);var q=n(f,c[0],c[1]);return l(function(){o.hasValue=!0,o.value=q},[q]),u(q),q},re}var je;function et(){return je||(je=1,ne.exports=Xe()),ne.exports}var tt=et();const st=ze(tt),Ee={},{useDebugValue:it}=$e,{useSyncExternalStoreWithSelector:at}=st;let ve=!1;const nt=t=>t;function rt(t,s=nt,i){(Ee?"production":void 0)!=="production"&&i&&!ve&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ve=!0);const a=at(t.subscribe,t.getState,t.getServerState||t.getInitialState,s,i);return it(a),a}const qe=t=>{(Ee?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const s=typeof t=="function"?Ke(t):t,i=(a,n)=>rt(s,a,n);return Object.assign(i,s),i},lt=t=>t?qe(t):qe,ye={step:"address",address:"",coordinates:null,roofs:[],totalSqFt:0,priceRange:null,packages:null,selectedMaterial:null,selectedProduct:null,selectedColor:null,contact:{},isLoading:!1,error:null,roofAutoDetected:!1,solarData:null,pitchSource:null,isSubpremise:!1},R=lt((t,s)=>({...ye,settings:null,embedId:null,setSettings:(i,a)=>t({settings:i,embedId:a}),setStep:i=>t({step:i}),setAddress:(i,a)=>t({address:i,coordinates:a}),setRoofs:i=>{const a=i.reduce((n,r)=>n+r.areaSqFt,0);t({roofs:i,totalSqFt:a})},setAutoDetectedRoofs:i=>{const a=i.reduce((n,r)=>n+r.areaSqFt,0);t({roofs:i,totalSqFt:a,roofAutoDetected:!0})},setSolarData:i=>{const a=i.segments.map(r=>({id:r.id,name:r.name,areaSqFt:r.areaSqFt,groundAreaSqFt:r.groundAreaSqFt,pitchDegrees:r.pitchDegrees,slope:r.slope,center:r.center,boundingBox:r.boundingBox,included:!0,coordinates:[]})),n=a.reduce((r,l)=>r+l.areaSqFt,0);t({solarData:i,roofs:a,totalSqFt:n,roofAutoDetected:!0,pitchSource:"solar"})},setIsSubpremise:i=>t({isSubpremise:i}),updateRoofSlope:(i,a)=>{const{roofs:n,settings:r}=s(),l=n.map(u=>{if(u.id!==i)return u;const f=r?.slopeMultipliers[a||"flat"]||1,h=u.areaSqFt/(r?.slopeMultipliers[u.slope||"flat"]||1);return{...u,slope:a,areaSqFt:Math.round(h*f)}}),x=l.reduce((u,f)=>u+f.areaSqFt,0);t({roofs:l,totalSqFt:x})},updateRoofCoordinates:(i,a)=>{const{roofs:n}=s(),r=n.map(l=>l.id===i?{...l,coordinates:a}:l);t({roofs:r})},setPriceRange:i=>t({priceRange:i}),setSelectedMaterial:i=>t({selectedMaterial:i,selectedProduct:null,selectedColor:null}),clearSelectedMaterial:()=>t({selectedMaterial:null,selectedProduct:null,selectedColor:null}),setSelectedProduct:i=>t({selectedProduct:i}),setSelectedColor:i=>t({selectedColor:i}),setPackages:i=>t({packages:i}),fetchPricing:async(i,a,n,r,l)=>{t({isLoading:!0,error:null});try{const{PRICING_API_URL:x,SUPABASE_ANON_KEY:u}=await te(async()=>{const{PRICING_API_URL:d,SUPABASE_ANON_KEY:m}=await import("./api-config-Yu7X_qnK.js");return{PRICING_API_URL:d,SUPABASE_ANON_KEY:m}},[]),f=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({trade:i,area_sq_ft:a,zip:n,slope_multiplier:r||1,contractor_id:l||void 0})}),h=await f.json();if(!f.ok)throw new Error(h.error||"Pricing calculation failed");return t({packages:h.packages,isLoading:!1}),h}catch(x){return t({error:x.message,isLoading:!1}),null}},setContact:i=>t(a=>({contact:{...a.contact,...i}}
1)),setLoading:i=>t({isLoading:i}),setError:i=>t({error:i}),reset:()=>t(ye)}));function ot(t){if(t.length<3)return 0;let s=0;const i=t.length;for(let l=0;l<i;l++){const x=(l+1)%i;s+=t[l][0]*t[x][1],s-=t[x][0]*t[l][1]}s=Math.abs(s)/2;const a=t.reduce((l,x)=>l+x[1],0)/i,n=364e3,r=364e3*Math.cos(a*Math.PI/180);return Math.round(s*n*r)}function ee(t,s,i=null,a={}){if(Y(s)){const l=ct(t,s,i,a);if(l)return l;const x=dt(t,s,i);if(x)return x}const n=t*s.pricePerSqFt,r=s.priceVariance/100*n;return{min:Math.round(n-r),max:Math.round(n+r)}}function Y(t){return t?.estimatorFlow==="simple-bands"}function Ne(t,s,i=10,a=null){const n=Number(i),r=Number.isFinite(n)?n/100:.1;return{min:Math.round(t*(1-r)),max:Math.round(s*(1+r)),label:a}}function me(t){if(t==null||t==="")return 1/0;const s=Number(t);return Number.isFinite(s)?s:1/0}function Ae({roofs:t,solarData:s}={}){const i=s?.weightedSlope;if(i==="flat")return"flat";if(i==="shallow")return"low";if(i==="medium"||i==="steep")return"high";const n=(Array.isArray(t)?t.filter(r=>r?.included!==!1):[]).map(r=>
1r?.slope).filter(Boolean);return n.length?n.every(r=>r==="flat")?"flat":n.some(r=>r==="medium"||r==="steep")?"high":n.some(r=>r==="shallow")?"low":n.some(r=>r==="pitched")?"unknown":null:null}function ct(t,s,i=null,a={}){const n=s?.simplePricingConfig;if(!n)return null;const r=n.variancePercent??10;if(i==="flat"){const m=(Array.isArray(n.flatBands)?n.flatBands:[]).find(c=>{const o=Number(c.minSqFt||0),q=me(c.maxSqFt);return t>=o&&t<=q});if(!m||!Number.isFinite(Number(m.rate)))return null;const j=t*Number(m.rate);return Ne(j,j,r,m.label||"Flat roof")}const l=Ae(a),x=Array.isArray(n.pitchedCategories)?n.pitchedCategories:[],u=[];if(x.forEach(d=>{(Array.isArray(d.subcategories)?d.subcategories:[]).forEach(j=>{const c=Number(j.lowSlopeRate),o=Number(j.highSlopeRate);if(l==="low"){Number.isFinite(c)&&u.push(c);return}if(l==="high"){Number.isFinite(o)&&u.push(o);return}Number.isFinite(c)&&u.push(c),Number.isFinite(o)&&u.push(o)})}),!u.length)return null;const f=Math.min(...u),h=Math.max(...u);return Ne(t*f,t*h,r,"Pitched roof")}function dt(t,s,i=null){const a=Array.isArray(s?.priceBands)?s.priceBands:[],n=i==="flat"?"flat":i?"pitched":null,x=[...n?a.filter(h=>!h.roofType||h.roofType===n):a].sort((h,d)=>(h.maxSqFt||1/0)-(d.maxSqFt||1/0)).find(h=>{const d=Number(h.minSqFt||0),m=me(h.maxSqFt);return t>=d&&t<=m});if(!x)return null;const u=Number(x.min),f=Number(x.max);return!Number.isFinite(u)||!Number.isFinite(f)?null:{min:Math.round(u),max:Math.round(f),label:
1x.label||null}}function X(t,s,i,a={}){const n=s?.priceVariance??i.priceVariance??15,r=s?.materialKey||De(s);let l=Number(t)*Number(s?.pricePerUnit||0);if(r==="flat"&&Array.isArray(s?.flatRateBands)&&s.flatRateBands.length>0){const u=s.flatRateBands.find(f=>{const h=Number(f.minSqFt||0),d=me(f.maxSqFt);return t>=h&&t<=d});u&&Number.isFinite(Number(u.rate))&&(l=Number(t)*Number(u.rate))}else{const u=Ae(a),f=u==="low"?Number(s?.lowSlopeRate):u==="high"?Number(s?.highSlopeRate):NaN;Number.isFinite(f)&&(l=Number(t)*f)}const x=Number(n)/100*l;return{min:Math.round(l-x),max:Math.round(l+x),midpoint:Math.round(l)}}function Te(t){return t?.products?.length>0&&t.products.some(s=>s.active!==!1)}function se(t){return t?.estimatorFlow==="material-first"&&!Y(t)}function Z(t){const s=String(t||"").toLowerCase();return s?s.includes("flat")||s.includes("tpo")||s.includes("modified")||s.includes("torch")?"flat":s.includes("tile")?"tile":s.includes("metal")?"metal":s.includes("shingle")||s.includes("asphalt")?"shingles":null:null}function Be({selectedProduct:t,selectedMaterial:s}={}){return Z(t?.material)||Z(t?.name)||Z(t?.id)||Z(s)}function mt({roofs:t,solarData:s}={}){const i=Array.isArray(t)?t.filter(a=>a?.included!==!1):[];return s?.weightedSlope==="flat"?"flat":s?.weightedSlope?"pitched":i.length>0&&i.every(a=>a?.slope==="flat")?"flat":i.some(a=>a?.slope&&a.slope!=="flat")?"pitched":null}function ie({selectedProduct:t,selectedMaterial:s,roofs:i,solarData:a}={}){return Be({selectedProduct:t,selectedMaterial:s})||mt({roofs:i,solarData:a})}function Fe({contact:t,roofType:s}={}){const i=String(t?.propertyType||"").trim().toLowerCase();return i==="residential"||i==="commercial"?i:s==="shingles"||s==="tile"?"residential":null}function Ie({selectedProduct:t,selectedMaterial:s,contact:i,settings:a,roofs:n,solarData:r}={}){if(Y(a))return!1;const l=ie({selectedProduct:t,selectedMaterial:s,roofs:n,solarData:r});return l!=="metal"&&l!=="flat"?!1:!Fe({contact:i,roofType:l})}function ue({selectedProduct:t,selectedMaterial:s,contact:i,isDemo:a,settings:n,roofs:r,solarData:l}={}){return a?"demo-booking":Ie({selectedProduct:t,selectedMaterial:s,contact:i,settings:n,roofs:r,solarData:l})?"property-type":"contact"}function De(t){if(t.materialKey)return t.materialKey;const s=(t.material||"").toLowerCase();return s.includes("flat")||s.includes("tpo")||s.includes("epdm")||s.includes("modified bitumen")?"flat":s.includes("tile")?"tile":s.includes("metal")?"metal":s.includes("shingle")||s.includes("asphalt")?"shingle":null}function ut(t,s=[]){if(!t?.length||!s.length)return!1;const i=new Set(t.filter(a=>a.active!==!1).map(De).filter(Boolean));return s.every(a=>i.has(a))}function ht(t){const s=t?.allowedMaterials?.length?t.allowedMaterials:["shingle","tile","metal"];return He.filter(i=>s.includes(i.materialKey))}function pt(t){const s={good:0,better:1,best:2},i=t?.products?.filter(n=>n.active!==!1)||[];return(se(t)&&!ut(i,t?.allowedMaterials||[])?ht(t):i).sort((n,r)=>(s[n.tier]||0)-(s[r.tier]||0))}function ft(t,s){if(!s)return!0;if(s.mode==="radius"){const a=(t.lat-s.center.lat)*Math.PI/180,n=(t.lng-s.center.lng)*Math.PI/180,r=Math.sin(a/2)**2+Math.cos(s.center.lat*Math.PI/180)*Math.cos(t.lat*Math.PI/180)*Math.sin(n/2)**2;return 3959*2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))<=s.radiusMiles}return s.mode==="zipCodes"?!s.allowedZips||!t.zip?!0:s.allowedZips.includes(t.zip):!0}function bt({text:t,onClick:s,primaryColor:i,onMouseEnter:a,onMouseLeave:n}){return e.jsxs("button",{onClick:s,onMouseEnter:a,onMouseLeave:n,className:"embediq-sidetab",style:{backgroundColor:i},"aria-label":t,children:[e.jsx("svg",{className:"embediq-sidetab-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",width:"20",height:"20",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),e.jsx("span",{className:"embediq-sidetab-text",children:t})]})}function gt({text:t,onClose:s,onClick:i,backgroundColor:a="#ffffff"}){return e.jsxs("div",{className:"embediq-tooltip",style:{backgroundColor:a},children:[e.jsx("button",{onClick:s,className:"embediq-tooltip-close","aria-label":"Close",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("button",{onClick:i,className:"embediq-tooltip-content",children:[e.jsx("span",{children:t}),e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})]})}function xt({children:t,onClose:s}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"embediq-backdrop",onClick:s,"aria-hidden":"true"}),e.jsxs("div",{className:"embediq-modal",role:"dialog","aria-modal":"true",children:[e.jsx("button",{onClick:s,className:"embediq-modal-close","aria-label":"Close",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),e.jsx("div",{className:"embediq-modal-content",children:t})]})]})}function Se(){const[t,s]=g.useState(""),[i,a]=g.useState([]),[n,r]=g.useState(!1),[l,x]=g.useState(!1),[u,f]=g.useState(!1),h=g.useRef(null),{setAddress:d,setStep:m,setLoading:j,setError:c,isLoading:o,error:q,settings:N}=R();g.useEffect(()=>{Pe().then(()=>{x(!0),console.log("[AddressStep] Google Maps loaded")}).catch(b=>{console.error("[AddressStep] Failed to load Google Maps:",b)})},[]),g.useEffect(()=>{if(!t||t.length<3||!l){a([]);return}return h.current&&clearTimeout(h.current),h.current=setTimeout(async()=>{r(!0),console.log("[AddressStep] Searching for:",t);try{const{suggestions:b}=await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:t,includedPrimaryTypes:["street_address","premise","subpremise"],includedReg
1ionCodes:["us"]});if(console.log("[AddressStep] Suggestions:",b),b&&b.length>0){const k=b.slice(0,5).map(p=>({address:p.placePrediction.text.text,placeId:p.placePrediction.placeId,coordinates:{lat:0,lng:0},relevance:1}));a(k)}else a([])}catch(b){console.error("[AddressStep] Autocomplete error:",b),a([])}finally{r(!1)}},300),()=>{h.current&&clearTimeout(h.current)}},[t,l]);const w=async b=>{console.log("[AddressStep] Selected:",b.address),s(b.address),a([]),j(!0),c(null);const k=R.getState();k.setIsSubpremise(!1),k.solarData&&R.setState({solarData:null,pitchSource:null});try{const p=new google.maps.places.Place({id:b.placeId});if(await p.fetchFields({fields:["location","addressComponents","types"]}),!p.location){console.error("[AddressStep] No location in place details"),m("fallback"),j(!1);return}const M=p.addressComponents?.find(I=>I.types.includes("postal_code")),C={lat:p.location.lat(),lng:p.location.lng(),zip:M?.longText||""};if(console.log("[AddressStep] Coordinates:",C,"Zip:",C.zip),(p.addressComponents?.some(I=>I.types.includes("subpremise"))??!1)&&(console.log("[AddressStep] Address is a subpremise (shared roofline likely)"),R.getState().setIsSubpremise(!0)),N?.serviceArea&&!ft(C,N.serviceArea)){f(!0),j(!1);return}d(b.address,C);const{API_URLS:v}=await te(async()=>{const{API_URLS:I}=await import("./api-config-Yu7X_qnK.js");return{API_URLS:I}},[]),[B,F]=await Promise.allSettled([fetch(v.roofData,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lat:C.lat,lng:C.lng})}).then(I=>I.json()),fetch(v.detectRoof,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lat:C.lat,lng:C.lng})}).then(I=>I.json())]),T=B.status==="fulfilled"?B.value:null,E=F.status==="fulfilled"?F.value:null;console.log("[AddressStep] Solar result:",T?.success,"Gemini result:",E?.success);const{setSolarData:D,setAutoDetectedRoofs:A}=R.getState();if(T?.success){if(D(T),E?.success&&E.polygons?.length>0){const U=R.getState().roofs.map((ae,G)=>{const J=E.polygons[G]||E.polygons[0];return{...ae,coordinates:J?.coordinates||[]}});R.getState().setRoofs(U)}}else{console.log("[AddressStep] Solar API miss, trying OSM...");try{const U=await(await fetch(v.buildingFootprint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lat:C.lat,lng:C.lng})})).json();U.success&&U.polygons?.length>0?(console.log("[AddressStep] OSM found",U.polygons.length,"building(s)"),A(U.polygons)):E?.success&&E.polygons?.length>0?(console.log("[AddressStep] Using Gemini-only polygons"),A(E.polygons)):console.log("[AddressStep] All detection methods missed. Manual draw mode.")}catch(I){console.log("[AddressStep] OSM fetch failed:",I),E?.success&&E.polygons?.length>0&&(console.log("[AddressStep] Using Gemini-only polygons after OSM error"),A(E.polygons))}}m("roof-confirm"),j(!1)}catch(p){console.error("[AddressStep] Error:",p),m("fallback"),j(!1)}};return e.jsxs("div",{className:"embediq-step embediq-address-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"What Will Your New Roof Cost?"}),e.jsx("p",{className:"embediq-step-subtitle",children:"Get your instant estimate in 60 seconds. No email required."})]}),e.jsxs("div",{className:"embediq-address-input-wrapper",children:[e.jsxs("div",{className:"embediq-address-input-container",children:[e.jsxs("svg",{className:"embediq-address-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),e.jsx("input",{type:"text",value:t,onChange:b=>s(b.target.value),placeholder:"Enter your home address",className:"embediq-address-input",disabled:o||!l,autoComplete:"off"}),n&&e.jsx("div",{className:"embediq-address-spinner",children:e.jsx("div",{className:"embediq-spinner-small"})})]}),i.length>0&&e.jsx("ul",{className:"embediq-suggestions",children:i.map((b,k)=>e.jsx("li",{children:e.jsxs("button",{onClick:()=>w(b),className:"embediq-suggestion-item",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"})}),e.jsx("span",{children:b.address})]})}
1,k))})]}),o&&e.jsxs("div",{className:"embediq-loading-state",children:[e.jsx("div",{className:"embediq-spinner"}),e.jsx("p",{children:"Analyzing your roof..."})]}),q&&e.jsx("div",{className:"embediq-error-message",children:q}),!N?.hideDefaultSteps&&e.jsxs("div",{className:"embediq-steps-guide",children:[e.jsxs("div",{className:"embediq-steps-header",children:[e.jsxs("h3",{className:"embediq-steps-title",children:["How It Works ",e.jsx("em",{children:"in 4 Simple Steps"})]}),e.jsx("p",{className:"embediq-steps-subtitle",children:"No email required. No obligation. Free."})]}),e.jsx("div",{className:"embediq-steps-grid",children:[{num:"1",title:"Enter Your Address",desc:"We locate your roof instantly using satellite imagery."},{num:"2",title:"Confirm Your Roof",desc:"We auto-detect your roof outline. Just confirm it looks right."},{num:"3",title:"Get Your Estimate",desc:"Choose from Good, Better, and Best options with transparent pricing."},{num:"4",title:"Book Your Inspection",desc:"Schedule a free in-person consultation to finalize details."}].map(b=>e.jsxs("div",{className:"embediq-steps-item",children:[e.jsx("div",{className:"embediq-steps-num",children:b.num}),e.jsxs("div",{className:"embediq-steps-body",children:[e.jsx("div",{className:"embediq-steps-bar"}),e.jsx("h4",{children:b.title}),e.jsx("p",{children:b.desc})]})]},b.num))})]}),e.jsxs("div",{className:"embediq-trust-signals",children:[e.jsxs("div",{className:"embediq-trust-item",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),e.jsx("span",{children:"No spam, ever"})]}),e.jsxs("div",{className:"embediq-trust-item",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{children:"Takes 60 seconds"})]}),e.jsxs("div",{className:"embediq-trust-item",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),e.jsx("span",{children:"Your info stays private"})]})]}),u&&e.jsxs("div",{className:"embediq-out-of-area",children:[e.jsx("div",{className:"embediq-out-of-area-icon",children:e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})}),e.jsx("h3",{className:"embediq-out-of-area-title",children:"Outside Service Area"}),e.jsxs("p",{className:"embediq-out-of-area-text",children:["This address is outside ",N?.name?`${N.name}'s`:"the"," service area."]}),e.jsx("button",{className:"embediq-out-of-area-btn",onClick:()=>{f(!1),s(""),a([])},children:"Try Another Address"}),N?.phone&&e.jsxs("p",{className:"embediq-out-of-area-phone",children:["Or call us: ",e.jsx("a",{href:`tel:${N.phone.replace(/[^0-9+]/g,"")}`,children:N.phone})]})]})]})}const ce={strokeColor:"#ffffff",strokeOpacity:.9,fillColor:"#3b82f6",fillOpacity:.2},ke={strokeColor:"#ef4444",strokeOpacity:.8,fillColor:"#ef4444",fillOpacity:.15};function jt(){const t=g.useRef(null),s=g.useRef(null),i=g.useRef([]),a=g.useRef([]),n=g.useRef(null),r=g.useRef([]),l=g.useRef(null),[x,u]=g.useState(!1),[f,h]=g.useState(!1),{coordinates:d,roofs:m,roofAutoDetected:j,setRoofs:c,setStep:o,address:q,solarData:N,isSubpremise:w}=R(),[b,k]=g.useState(j&&m.length>
10&&!w),p=!b,M=!!N,C=m.some(y=>y.coordinates?.length>=3),P=g.useCallback(()=>{const y=R.getState().roofs,L=i.current.map((S,W)=>{const $=S.getPath(),_=[];for(let z=0;z<$.getLength();z++){const K=$.getAt(z);_.push([K.lng(),K.lat()])}const O=y[W]?.included!==!1;return{id:`roof_${W+1}`,name:W===0?"Main Roof":`Roof Section ${W+1}`,coordinates:_,areaSqFt:ot(_),included:O}});c(L)},[c]),v=(y,L)=>{const S=L?ce:ke;y.setOptions(S)},B=g.useCallback((y,L)=>{const S=new google.maps.Polygon({paths:y,...ce,strokeWeight:2,editable:!0,draggable:!0,map:L});google.maps.event.addListener(S.getPath(),"set_at",P),google.maps.event.addListener(S.getPath(),"insert_at",P),google.maps.event.addListener(S,"dragend",P),i.current.push(S),P()},[P]),F=g.useCallback(()=>{n.current&&(n.current.setMap(null),n.current=null),r.current.forEach(y=>y.setMap(null)),r.current=[],a.current=[]},[]),T=g.useCallback(()=>{const y=a.current;y.length>=3&&s.current&&B(y,s.current),F(),h(!1)},[B,F]),E=g.useCallback(()=>{F(),h(!1)},[F]),D=g.useCallback(()=>{s.current&&(h(!0),a.current=[],n.current=new google.maps.Polyline({strokeColor:"#22c55e",strokeOpacity:1,strokeWeight:2,map:s.current}))},[]),A=g.useCallback(y=>{if(!f||!y.latLng||!s.current)return;const L=y.latLng,S=a.current;if(S.length>=3){const $=S[0],_=google.maps.geometry?.spherical?.computeDistanceBetween(L,$);if(_&&_<5){T();return}}S.push(L);const W=new google.maps.Marker({position:L,map:s.current,icon:{path:google.maps.SymbolPath.CIRCLE,scale:6,fillColor:"#22c55e",fillOpacity:1,strokeColor:"#ffffff",strokeWeight:2}});r.current.push(W),n.current&&n.current.setPath(S)},[f,T]);g.useEffect(()=>{if(s.current)return l.current&&(google.maps.event.removeListener(l.current),l.current=null),f&&(l.current=s.current.addListener("click",A)),()=>{l.current&&google.maps.event.removeListener(l.current)}},[f,A]),g.useEffect(()=>{if(!p||!t.current||!d)return;let y=!0;async function L(){try{if(await Pe(),!y||!t.current)return;const S=new google.maps.Map(t.current,{center:{lat:d.lat,lng:d.lng},zoom:20,mapTypeId:"satellite",tilt:0,disableDefaultUI:!0,zoomControl:!0,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1,gestureHandling:"greedy"});s.current=S;const W=R.getState().roofs,$=R.getState().roofAutoDetected,_=R.getState().isSubpremise,V=!$||_;W.forEach(O=>{const z=O.coordinates.map(([We,Oe])=>new google.maps.LatLng(Oe,We)),Q=O.included!==!1?ce:ke,H=new google.maps.Polygon({paths:z,...Q,strokeWeight:2,editable:V,draggable:V,map:S});google.maps.event.addListener(H.getPath(),"set_at",P),google.maps.event.addListener(H.getPath(),"insert_at",P),google.maps.event.addListener(H,"dragend",P),i.current.push(H)}),u(!0)}catch(S){console.error("Failed to load Google Maps:",S)}}return L(),()=>{y=!1,i.current.forEach(S=>S.setMap(null)),i.current=[],F()}},[p,d]);const I=()=>{k(!1)},U=y=>{if(y>=0&&y<m.length){const L=m.map((S,W)=>W===y?{...S,included:S.included===!1}:S);if(c(L),i.current[y]){const S=L[y].included!==!1;v(i.current[y],S)}}},ae=()=>{i.current.forEach(y=>y.setMap(null)),i.current=[],c([])},G=m.filter(y=>y.included!==!1);G.reduce((y,L)=>y+L.areaSqFt,0);const J=async()=>{const y=R.getState(),L=y.roofs.filter(S=>S.included!==!1);if(L.length!==0)if(y.solarData){const{settings:S,fetchPricing:W,setPriceRange:$}=y,_=L.reduce((O,z)=>O+z.areaSqFt,0),V=se(S)?"material-selection":"product-catalog";if(Y(S)){const O=ie({roofs:L,solarData:y.solarData}),z=ee(_,S,O,{roofs:L,solarData:y.solarData});if(z){$(z),o("estimate");return}}if(S.pricebookEnabled){const O=L.reduce((K,Q)=>{const H=S.slopeMultipliers?.[Q.slope||"flat"]||1;return K+H*Q.areaSqFt},0)/_,z=y.coordinates?.zip||"";await W("roofing",_,z,O),o(V)}else if(Te(S))o(V);else{const O=ee(_,S);$(O),o("estimate")}}else o("slope")},he="pk.eyJ1IjoiZ2Fta2ciLCJhIjoiY21vdzQzNXhyMDNqYzJycHo2cGUxbHdhMiJ9.wyQDB_RW50P7C58npo7F2w",pe=d&&he?`https://api.mapbox.com/styles/v1/mapbox/satellite-v9/static/${d.lng},${d.lat},19,0/800x400@2x?access_token=${he}`:null;return b?e.jsxs("div",{className:"embediq-step embediq-roof-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"We Found Your Roof"}),e.jsx("p",{className:"embediq-step-subtitle",children:q})]}),e.jsxs("div",{className:"embediq-roof-confirmed-card",children:[pe&&e.jsxs("div",{className:"embediq-roof-satellite",children:[e.jsx("img",{src:pe,alt:"Satellite view of your property",className:"embediq-roof-satellite-img"}),e.jsx("div",{className:"embediq-roof-satellite-pin",children:e.jsxs("svg",{width:"48",height:"62",viewBox:"0 0 48 62",fill:"none",children:[e.jsx("path",{d:"M24 58C24 58 44 34 44 20C44 9 35 0 24 0C13 0 4 9 4 20C4 34 24 58 24 58Z",fill:"#16a34a",stroke:"#fff",strokeWidth:"3"}),e.jsx("circle",{cx:"24",cy:"20",r:"12",fill:"#fff"}),e.jsx("path",{d:"M16 20l5 5 9-9",stroke:"#16a34a",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}
1),e.jsxs("div",{className:"embediq-roof-confirmed-details",children:[e.jsx("div",{className:"embediq-roof-confirmed-label",children:"Roof Detection Complete"}),e.jsx("div",{className:"embediq-roof-confirmed-sqft",children:"Review the sections below before pricing."}),G.length>1&&e.jsxs("div",{className:"embediq-roof-confirmed-sections",children:[G.length," roof sections detected"]})]})]}),e.jsxs("div",{className:"embediq-step-actions",children:[e.jsx("button",{onClick:()=>o("address"),className:"embediq-btn embediq-btn-secondary",children:"Back"}),e.jsx("button",{onClick:J,className:"embediq-btn embediq-btn-primary",children:"That's My Roof"})]}),e.jsx("button",{onClick:I,className:"embediq-edit-link",children:"Not right? Edit manually"})]}):e.jsxs("div",{className:"embediq-step embediq-roof-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:j&&w||m.length>0?"Confirm Your Roof":"Outline Your Roof"}),e.jsx("p",{className:"embediq-step-subtitle",children:q})]}),e.jsxs("div",{className:"embediq-map-container",children:[e.jsx("div",{ref:t,style:{width:"100%",height:"100%"}}),!x&&e.jsxs("div",{className:"embediq-map-loading",children:[e.jsx("div",{className:"embediq-spinner"}),e.jsx("p",{children:"Loading satellite view..."})]}),x&&M&&!C&&e.jsxs("div",{className:"embediq-solar-stats-card",children:[e.jsxs("div",{className:"embediq-solar-stats-badge",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"5"}),e.jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),"Solar Data"]}),e.jsxs("p",{className:"embediq-solar-stats-text",children:[N.segments.length," roof section",N.segments.length!==1?"s":""," detected"]})]}),x&&e.jsx("div",{className:"embediq-map-controls",children:f?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:T,className:"embediq-draw-btn embediq-draw-btn-complete",disabled:a.current.length<3,children:"Complete"}),e.jsx("button",{onClick:E,className:"embediq-draw-btn embediq-draw-btn-cancel",children:"Cancel"})]}):e.jsxs("button",{onClick:D,className:"embediq-draw-btn",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polygon",{points:"12 2 2 22 22 22"})}),"Draw Roof"]})})]}),j&&w?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"embediq-auto-detect-info",children:[e.jsxs("div",{className:"embediq-auto-detect-badge",children:[e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M20 6L9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Building Detected"]}),e.jsx("div",{className:"embediq-auto-detect-area",children:"Full building detected"})]}),e.jsx("p",{className:"embediq-subpremise-hint",children:"We detected the full building. Adjust the outline to show just your section, or continue if this looks right."}),e.jsx("div",{className:"embediq-step-actions",children:e.jsx("button",{onClick:J,className:"embediq-btn embediq-btn-primary",children:"Continue"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"embediq-drawing-instructions",children:e.jsx("p",{children:f?"Click points around your roof to trace its outline. Click near the first point or press Complete to finish.":m.length>0?"Toggle checkboxes to include/exclude areas. Drag corners to adjust.":'Click "Draw Roof" then click points around your roof to trace its outline.'})}),m.length>0&&e.jsxs("div",{className:"embediq-roof-info",children:[e.jsx("div",{className:"embediq-roof-stats",children:e.jsxs("div",{className:"embediq-roof-stat",children:[e.jsx("span",{className:"embediq-stat-label",children:"Selected Areas"}),e.jsxs("span",{className:"embediq-stat-value",children:[G.length," of ",m.length]})]})}),m.map((y,L)=>{const S=y.included!==!1;return e.jsxs("div",{className:`embediq-roof-item ${S?"":"embediq-roof-item-excluded"}`,children:[m.length>1&&e.jsxs("label",{className:"embediq-roof-toggle",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:()=>U(L)}),e.jsx("span",{className:"embediq-roof-checkbox",children:S&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})})]}),e.jsx("span",{className:"embediq-roof-name",children:y.name})]},y.id)}),m.length>1&&e.jsx("div",{className:"embediq-roof-actions",children:e.jsx("button",{onClick:ae,className:"embediq-btn-text",children:"Clear All"})})]}),e.jsxs("div",{className:"embediq-step-actions",children:[e.jsx("button",{onClick:()=>o("address"),className:"embediq-btn embediq-btn-secondary",children:"Back"}),e.jsx("button",{onClick:J,className:"embediq-btn embediq-btn-primary",disabled:G.length===0,children:"Continue"})]})]})]})}const vt=[{value:"flat",label:"Flat",description:"0-2 pitch",icon:"M3 12h18"}
1,{value:"shallow",label:"Shallow",description:"3-5 pitch",icon:"M3 17l9-5 9 5"},{value:"medium",label:"Medium",description:"6-9 pitch",icon:"M3 19l9-7 9 7"},{value:"steep",label:"Steep",description:"10+ pitch",icon:"M3 21l9-10 9 10"}],qt=[{value:"flat",label:"Flat",description:"Low-slope or flat roof",icon:"M3 12h18"},{value:"pitched",label:"Pitched",description:"Any non-flat roof",icon:"M3 19l9-7 9 7"}];function yt(){const{roofs:t,setRoofs:s,updateRoofSlope:i,setStep:a,setPriceRange:n,settings:r,address:l,fetchPricing:x}=R(),[u,f]=g.useState(!1),h=Y(r),d=h?qt:vt,m=t.filter(b=>b.included!==!1),j=m.reduce((b,k)=>b+k.areaSqFt,0),c=m.length===0||m.every(b=>b.slope),o=m.length>0&&c,q=b=>{const k=t.map(p=>p.id===b?{...p,included:p.included===!1}:p);s(k)},N=()=>{if(!r?.slopeMultipliers||m.length===0)return 1;const b=m.reduce((p,M)=>p+M.areaSqFt,0);return b===0?1:m.reduce((p,M)=>{const C=r.slopeMultipliers[M.slope||"flat"]||1;return p+C*M.areaSqFt},0)/b},w=async()=>{if(!o||!r)return;const b=se(r)?"material-selection":"product-catalog";if(Y(r)){const k=ie({roofs:m}),p=ee(j,r,k,{roofs:m});p&&(n(p),a("estimate"));return}if(r.pricebookEnabled){f(!0);const k=N(),{coordinates:p}=R.getState(),M=p?.zip||"",C=await x("roofing",j,M,k);f(!1),C&&a(b)}else if(Te(r))a(b);
1else{const k=ee(j,r);n(k),a("estimate")}};return e.jsxs("div",{className:"embediq-step embediq-slope-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:h?"Is Your Roof Flat or Pitched?":"How Steep Is Your Roof?"}),e.jsx("p",{className:"embediq-step-subtitle",children:h?"Select flat or pitched for each roof area. Uncheck any areas you do not want included.":"Select a pitch for each roof area. Uncheck any areas you do not want included."})]}),e.jsxs("div",{className:"embediq-slope-summary",children:[e.jsx("span",{className:"embediq-slope-summary-label",children:"Selected Areas"}),e.jsxs("span",{className:"embediq-slope-summary-value",children:[m.length," of ",t.length]})]}),e.jsx("div",{className:"embediq-slopes-container",children:t.map(b=>{const k=b.included!==!1;return e.jsxs("div",{className:`embediq-slope-section ${k?"":"embediq-slope-section-excluded"}`,children:[e.jsxs("div",{className:"embediq-slope-header",children:[t.length>1&&e.jsxs("label",{className:"embediq-roof-toggle",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:()=>q(b.id)}),e.jsx("span",{className:"embediq-roof-checkbox",children:k&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})})]}),e.jsx("span",{className:"embediq-slope-name",children:b.name})]}),k&&e.jsx("div",{className:"embediq-slope-options",children:d.map(p=>e.jsxs("button",{onClick:()=>i(b.id,p.value),className:`embediq-slope-option ${b.slope===p.value?"embediq-slope-selected":""}`,children:[e.jsx("svg",{className:"embediq-slope-icon",width:"32",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:p.icon,strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"embediq-slope-label",children:p.label}),e.jsx("span",{className:"embediq-slope-desc",children:p.description})]},p.value))})]},b.id)})}),e.jsxs("div",{className:"embediq-pitch-help",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{children:h?"Not sure? Choose pitched unless the roof is clearly flat or low-slope.":"Not sure? Most homes have a medium pitch. When in doubt, select medium."})]}),e.jsxs("div",{className:"embediq-step-actions",children:[e.jsx("button",{onClick:()=>a("roof-confirm"),className:"embediq-btn embediq-btn-secondary",children:"Back"}),e.jsx("button",{onClick:w,className:"embediq-btn embediq-btn-primary",disabled:!o||u,children:u?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"embediq-spinner-small"}),"Calculating..."]}):"Get My Price"})]})]})}const Nt={shingle:{key:"shingle",label:"Shingle Roofing",description:"Affordable, durable, and the most common choice for residential roof replacement."},tile:{key:"tile",label:"Tile Roofing",description:"A premium Florida roofing option with strong curb appeal and long lifespan."},metal:{key:"metal",label:"Metal Roofing",description:"Energy-efficient, long-lasting, and ideal for homeowners comparing modern roofing systems."},flat:{key:"flat",label:"Flat Roofing",description:"Low-slope systems like TPO and modified bitumen built for drainage, sealing, and long-term weather protection."}};function St(){const{settings:t,setSelectedMaterial:s,setStep:i}=R(),a=g.useMemo(()=>(t?.allowedMaterials?.length?t.allowedMaterials:["shingle","tile","metal"]).map(l=>Nt[l]).filter(Boolean),[t]),n=r=>{s(r),i("product-catalog")};return e.jsxs("div",{className:"embediq-step embediq-material-selection-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"Choose Your Roofing Material"}),e.jsx("p",{className:"embediq-step-subtitle",children:"Select the roofing system you want to explore. You can change this later."})]}),e.jsx("div",{className:"embediq-product-cards",children:a.map(r=>e.jsx("button",{type:"button",onClick:()=>n(r.key),className:"embediq-product-card embediq-product-card-select",children:e.jsx("div",{className:"embediq-product-card-body",children:e.jsxs("div",{className:"embediq-product-info",children:[e.jsx("h3",{className:"embediq-product-name",children:r.label}),e.jsx("p",{className:"embediq-product-description",children:r.description})]})})},r.key))}),e.jsx("div",{className:"embediq-step-actions",children:e.jsx("button",{type:"button",onClick:()=>i("slope"),className:"embediq-btn embediq-btn-secondary",children:"Back"})})]})}function kt(){const{priceRange:t,roofs:s,setStep:i,address:a,embedId:n,selectedProduct:r,selectedMaterial:l,contact:x,settings:u,solarData:f}=R(),h=n?.startsWith("bidhawk-demo-"),d=Y(u);if(!t)return null;const m=Math.round((t.min+t.max)/2);return e.jsxs("div",{className:"embediq-step embediq-estimate-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"Your Estimated Roof Cost"}),e.jsx("p",{className:"embediq-step-subtitle",children:a})]}),e.jsxs("div",{className:"embediq-estimate-card",children:[e.jsxs("div",{className:"embediq-estimate-primary",children:[e.jsx("span",{className:"embediq-estimate-label",children:"Estimated Investment"}),e.jsxs("div",{className:"embediq-estimate-main",children:[e.jsx("span",{className:"embediq-estimate-currency",children:"$"}),e.jsx("span",{className:"embediq-estimate-value",children:m.toLocaleStr
1ing()})]}),e.jsx("div",{className:"embediq-estimate-range-text",children:d?`$${t.min.toLocaleString()} - $${t.max.toLocaleString()}`:`${t.label?`${t.label}: `:"Typical range: "}$${t.min.toLocaleString()} - $${t.max.toLocaleString()}`})]}),e.jsx("div",{className:"embediq-estimate-details",children:e.jsxs("div",{className:"embediq-estimate-detail",children:[e.jsx("span",{className:"embediq-detail-label",children:"Roof Sections"}),e.jsx("span",{className:"embediq-detail-value",children:s.length})]})})]}),e.jsxs("div",{className:"embediq-estimate-disclaimer",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("p",{children:d?"Based on roof size and roof shape from satellite data or your manual selections. Final price is confirmed during inspection.":"Based on satellite measurements and standard materials. Final price depends on roof condition, material choice, and other factors discovered during inspection."})]}),e.jsxs("div",{className:"embediq-estimate-cta",children:[e.jsx("p",{className:"embediq-cta-text",children:d?"Ready for the next step? Book your inspection and we will confirm everything on site.":"Like what you see? Get a detailed quote with material options."}),e.jsxs("button",{onClick:()=>i(ue({selectedProduct:r,selectedMaterial:l,contact:x,isDemo:h,settings:u,roofs:s,solarData:f})),className:"embediq-btn embediq-btn-primary embediq-btn-lg",children:["Schedule Free Inspection",e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})]}),e.jsx("button",{onClick:()=>{const{pitchSource:j}=R.getState();i(j==="solar"?"roof-confirm":"slope")},className:"embediq-back-link",children:"â Adjust roof details"})]})}function wt(t){return{id:t.assembly_slug,tier:t.tier,name:t.name,description:t.description,manufacturer:t.manufacturer,material:t.material_type,warranty:t.warranty,features:t.features||[],colors:t.colors||[],packageIncludes:t.package_includes||[],image:t.image_url,_apiPricing:t.price_min!=null&&t.price_max!=null?{min:t.price_min,max:t.price_max,midpoint:t.price_midpoint}:null}}const Ct={good:"GOOD",better:"BETTER",best:"THE BEST",premium:"PREMIUM"},we={good:"#22c55e",better:"#3b82f6",best:"#f59e0b",premium:"#7c3aed"},Mt={shingle:"Choose Your Shingle Roofing Package",tile:"Choose Your Tile Roofing Package",metal:"Choose Your Metal Roofing Package",flat:"Choose Your Flat Roofing Package"},Rt={shingle:"Shingle",tile:"Tile",metal:"Metal",flat:"Flat"};function Lt(t){if(t.materialKey)return t.materialKey;const s=(t.material||"").toLowerCase();return s.includes("flat")||s.includes("tpo")||s.includes("epdm")||s.includes("modified bitumen")?"flat":s.includes("tile")?"tile":s.includes("metal")?"metal":s.includes("shingle")||s.includes("asphalt")?"shingle":null}function Pt(){const{settings:t,totalSqFt:s,roofs:i,solarData:a,address:n,packages:r,selectedMaterial:l,setStep:x,setSelectedProduct:u,setSelectedColor:f,setPriceRange:h,clearSelectedMaterial:d,embedId:m,contact:j}=R(),[c,o]=g.useState(null),q=m?.startsWith("bidhawk-demo-"),N=se(t),w=Y(t),b=g.useMemo(()=>{const v=r?r.map(wt):pt(t);return!N||!l?v:v.filter(B=>Lt(B)===l)},[N,r,l,t]);if(g.useEffect(()=>{N&&!l&&x("material-selection")},[N,l,x]),!t||N&&!l)return null;const k=N?Mt[l]||"Choose Your Roofing Package":"Your Roof Details",p=l?Rt[l]||l:null,M=v=>{const B=v._apiPricing||X(s,v,t,{roofs:i,solarData:a});u(v),f(null),h(B),x("product-detail")},C=v=>{const B=v._apiPricing||X(s,v,t,{roofs:i,solarData:a});u(v),f(null),h(B),x(ue({selectedProduct:v,selectedMaterial:l,contact:j,isDemo:q,settings:t,roofs:i}))},P=()=>{d(),x("material-selection")};return e.jsxs("div",{className:"embediq-step embediq-product-catalog-step",children:[N&&e.jsxs("button",{type:"button",onClick:P,className:"embediq-product-detail-back",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),"Back to Materials"]}),e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:k}),e.jsx("p",{className:"embediq-step-subtitle",children:n}),N&&p&&e.jsxs("p",{className:"embediq-step-subtitle",children:["Selected material: ",p," ",e.jsx("button",{type:"button",onClick:P,className:"embediq-edit-link",style:{background:"none",border:0,padding:0},children:"Change material"})]})]}),!w&&e.jsxs("div",{className:"embediq-product-roof-summary",children:[e.jsxs("div",{className:"embediq-product-roof-stat",children:[e.jsx("span",{className:"embediq-product-roof-stat-label",children:"Roof Size"}),e.jsxs("span",{className:"embediq-product-roof-stat-value",children:[s.toLocaleStr
1ing()," sq ft"]})]}),e.jsxs("div",{className:"embediq-product-roof-stat",children:[e.jsx("span",{className:"embediq-product-roof-stat-label",children:"Sections"}),e.jsx("span",{className:"embediq-product-roof-stat-value",children:i.filter(v=>v.included!==!1).length})]})]}),e.jsx("h3",{className:"embediq-product-catalog-heading",children:N?"Recommended Packages":"Recommended Products"}),e.jsx("div",{className:"embediq-product-cards",children:b.map(v=>{const B=v._apiPricing||X(s,v,t,{roofs:i,solarData:a}),F=we[v.tier]||we.good,T=c===v.id,E=v.tier==="better";return e.jsxs("div",{className:`embediq-product-card ${E?"embediq-product-card-popular":""}`,children:[e.jsx("div",{className:"embediq-product-tier-badge",style:{backgroundColor:F},children:Ct[v.tier]||"GOOD"}),E&&e.jsx("div",{className:"embediq-product-popular-label",children:"Most Popular"}),e.jsxs("div",{className:"embediq-product-card-body",children:[e.jsxs("div",{className:"embediq-product-card-top",children:[v.image&&e.jsx("div",{className:"embediq-product-image",children:e.jsx("img",{src:v.image,alt:v.name})}),e.jsxs("div",{className:"embediq-product-info",children:[v.manufacturer&&e.jsx("span",{className:"embediq-product-manufacturer",children:v.manufacturer}),e.jsx("h4",{className:"embediq-product-name",children:v.name}),v.material&&e.jsx("span",{className:"embediq-product-material",children:v.material}),v.warranty&&e.jsxs("div",{className:"embediq-product-warranty",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsx("span",{children:v.warranty})]})]})]}),v.features?.length>0&&e.jsx("div",{className:"embediq-product-features",children:v.features.slice(0,4).map((D,A)=>e.jsxs("div",{className:"embediq-product-feature",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}),e.jsx("span",{children:D})]},A))}),v.colors?.length>0&&e.jsxs("div",{className:"embediq-product-colors",children:[e.jsxs("span",{className:"embediq-product-colors-label",children:[v.colors.length," color",v.colors.length!==1?"s":""," available"]}),e.jsxs("div",{className:"embediq-product-swatches",children:[v.colors.slice(0,8).map((D,A)=>e.jsx("div",{className:"embediq-product-swatch",style:{backgroundColor:D.hex},title:D.name},A)),v.colors.length>8&&e.jsxs("span",{className:"embediq-product-swatch-more",children:["+",v.colors.length-8]})]}),e.jsx("span",{className:"embediq-product-colors-note",children:"Sample colors shown â more options available. Ask your rep."})]}),e.jsx("div",{className:"embediq-product-pricing",children:e.jsxs("span",{className:"embediq-product-price-range",children:["$",B.min.toLocaleString()," - $",B.max.toLocaleString()]})}),e.jsxs("div",{className:"embediq-product-actions",children:[e.jsx("button",{onClick:()=>M(v),className:"embediq-btn embediq-btn-secondary embediq-product-details-btn",children:"See Details"}),e.jsx("button",{onClick:()=>C(v),className:"embediq-btn embediq-btn-primary embediq-product-select-btn",children:"Send Me Details"})]}),v.packageIncludes?.length>0&&e.jsxs("div",{className:"embediq-product-package",children:[e.jsxs("button",{className:"embediq-product-package-toggle",onClick:()=>o(T?null:v.id),children:[e.jsx("span",{children:"See Package Details"}),e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:T?"embediq-chevron-up":"",children:e.jsx("path",{d:"M6 9l6 6 6-6"})})]}),T&&e.jsxs("div",{className:"embediq-product-package-content",children:[e.jsx("h5",{children:"What's Included:"}),e.jsx("ul",{children:v.packageIncludes.map((D,A)=>e.jsxs("li",{children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}),D]},A))})]})]})]})]},v.id)})}),e.jsxs("div",{className:"embediq-estimate-disclaimer",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("p",{children:"Pricing based on satellite measurements. Final price depends on roof condition, material choice, and factors discovered during inspection."})]}),e.jsx("button",{onClick:()=>{const{pitchSource:v}=R.getState();x(v==="solar"?"roof-confirm":"slope")},className:"embediq-back-link",children:"â Adjust roof details"})]})}const Et={good:"GOOD",better:"BETTER",best:"THE BEST",premium:"PREMIUM"},Ce={good:"#22c55e",better:"#3b82f6",best:"#f59e0b",premium:"#7c3aed"};function At(){const{settings:t,totalSqFt:s,roofs:i,selectedProduct:a,selectedColor:n,setSelectedColor:r,setPriceRange:l,setStep:x,embedId:u,selectedMaterial:f,contact:h}=R(),[d,m]=g.useState("package"),j=u?.startsWith("bidhawk-demo-");if(!a||!t)return null;const c=a._apiPricing||X(s,a,t,{roofs:i}),o=Ce[a.tier]||Ce.good,q=()=>{l(c),x(ue({selectedProduct:a,selectedMaterial:f,contact:h,isDemo:j,settings:t,roofs:i}))},N=[];return a.packageIncludes?.length>0&&N.push({id:"package",label:"Installation Package"}),a.warranty&&N.push({id:"warranty",label:"Warranty"}),a.features?.length>0&&N.push({id:"features",label:"Features & Specs"}),e.jsxs("div",{className:"embediq-step embediq-product-detail-step",children:[e.jsxs("button",{onClick:()=>x("product-catalog"),className:"embediq-product-detail-back",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),"Back to Products"]}),e.jsx("div",{className:"embediq-product-detail-header",children:e.jsxs("div",{className:"embediq-product-detail-title-row",children:[e.jsxs("div",{children:[e.jsx("div",{className:"embediq-product-tier-badge embediq-product-tier-badge-sm",style:{backgroundColor:o},children:Et[a.tier]||"GOOD"}),a.manufacturer&&e.jsx("span",{className:"embediq-product-detail-manufacturer",children:a.manufacturer}),e.jsx("h2",{className:"embediq-product-detail-name",children:a.name}),a.material&&e.jsx("span",{className:"embediq-product-detail-material",children:a.material})]}),e.jsx("div",{className:"embediq-product-detail-price",children:e.jsxs("span",{className:"embediq-product-detail-price-range",children:["$",c.min.toLocaleStr
1ing()," - $",c.max.toLocaleString()]})})]})}),a.image&&e.jsx("div",{className:"embediq-product-detail-image",children:e.jsx("img",{src:a.image,alt:a.name})}),a.colors?.length>0&&e.jsxs("div",{className:"embediq-product-detail-colors",children:[e.jsxs("span",{className:"embediq-product-detail-colors-label",children:["Select a Color: ",n?.name||"None selected"]}),e.jsx("div",{className:"embediq-product-detail-swatches",children:a.colors.map((w,b)=>e.jsx("button",{className:`embediq-product-detail-swatch ${n?.name===w.name?"embediq-swatch-selected":""}`,style:{backgroundColor:w.hex},onClick:()=>r(w),title:w.name,children:n?.name===w.name&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})},b))}),e.jsx("span",{className:"embediq-product-colors-note",children:"Sample colors shown â more options available. Ask your rep."})]}),a.description&&e.jsx("p",{className:"embediq-product-detail-description",children:a.description}),N.length>0&&e.jsxs("div",{className:"embediq-product-detail-tabs",children:[e.jsx("div",{className:"embediq-product-detail-tab-nav",children:N.map(w=>e.jsx("button",{className:`embediq-product-detail-tab ${d===w.id?"embediq-tab-active":""}`,onClick:()=>m(w.id),children:w.label},w.id))}),e.jsxs("div",{className:"embediq-product-detail-tab-content",children:[d==="package"&&a.packageIncludes?.length>0&&e.jsx("ul",{className:"embediq-product-detail-package-list",children:a.packageIncludes.map((w,b)=>e.jsxs("li",{children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}),w]},b))}),d==="warranty"&&a.warranty&&e.jsxs("div",{className:"embediq-product-detail-warranty",children:[e.jsx("div",{className:"embediq-product-detail-warranty-badge",children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}),e.jsx("p",{children:a.warranty})]}),d==="features"&&a.features?.length>0&&e.jsx("ul",{className:"embediq-product-detail-features-list",children:a.features.map((w,b)=>e.jsxs("li",{children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}),w]},b))})]})]}),e.jsx("div",{className:"embediq-product-detail-cta",children:e.jsxs("button",{onClick:q,className:"embediq-btn embediq-btn-primary embediq-btn-lg",children:["Send Me Details",e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})})]})}const Tt=[{value:"residential",title:"Residential",description:"Single-family home, townhouse, condo, or other residential property."},{value:"commercial",title:"Commercial",description:"Retail, office, warehouse, multi-unit, or other commercial property."}];function Bt(){const{settings:t,selectedProduct:s,selectedMaterial:i,contact:a,setContact:n,setStep:r}=R(),l=Be({selectedProduct:s,selectedMaterial:i}),x=Ie({selectedProduct:s,selectedMaterial:i,contact:a});if(g.useEffect(()=>{x||r("contact")},[x,r]),!t||!x)return null;const u=l==="flat"?"flat roofing":"metal roofing",f=s?"product-catalog":"estimate";return e.jsxs("div",{className:"embediq-step embediq-property-type-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"What Type of Property Is This?"}),e.jsxs("p",{className:"embediq-step-subtitle",children:["We need this for the ",u," estimate and lead routing."]})]}),e.jsx("div",{className:"embediq-product-cards",children:Tt.map(h=>e.jsx("button",{type:"button",onClick:()=>{n({propertyType:h.value}),r("contact")},className:"embediq-product-card embediq-product-card-select",children:e.jsx("div",{className:"embediq-product-card-body",children:e.jsxs("div",{className:"embediq-product-info",children:[e.jsx("h3",{className:"embediq-product-name",children:h.title}),e.jsx("p",{className:"embediq-product-description",children:h.description})]})})},h.value))}),e.jsx("div",{className:"embediq-step-actions",children:e.jsx("button",{type:"button",onClick:()=>r(f),className:"embediq-btn embediq-btn-secondary",children:"Back"})})]})}const Me="I understand this online estimate is not the final price. Final pricing will be provided after an on-site inspection";function _e(t){const s=t?.estimateAcknowledgementText;if(typeof s=="string"&&s.trim())return s.trim();const i=typeof t?.name=="string"?t.name.trim():"";if(!i)return`${Me}.`;const a=/^[aeiou]/i.test(i)?"an":"a";return`${Me} by ${a} ${i} team member.`}const Ft=["As soon as possible","Within 1-2 weeks","Within 1-3 months","Just exploring options"];function It({propertyType:t,roofType:s}
1){return[t,s].filter(Boolean)}function Dt(){const[t,s]=g.useState(!1),[i,a]=g.useState({}),{settings:n,embedId:r,address:l,coordinates:x,roofs:u,totalSqFt:f,priceRange:h,selectedProduct:d,selectedMaterial:m,selectedColor:j,contact:c,setContact:o,setStep:q,setError:N}=R();if(!n)return null;const w=_e(n),b=()=>{const p={};return c.name?.trim()||(p.name="Name is required"),c.email?.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c.email)||(p.email="Please enter a valid email"):p.email="Email is required",n.leadFields.phone&&!c.phone?.trim()&&(p.phone="Phone is required"),c.estimateAcknowledgement||(p.estimateAcknowledgement="Please acknowledge that this online estimate is not the final price"),a(p),Object.keys(p).length===0},k=async p=>{if(p.preventDefault(),!(!b()||!r)){s(!0);try{const{pitchSource:M,solarData:C}=R.getState(),P=ie({selectedProduct:d,selectedMaterial:m,roofs:u,solarData:C}),v=Y(n)?null:Fe({contact:c,roofType:P}),B=It({propertyType:v,roofType:P}),F={embedId:r,eventType:"instant_estimate",source:"instant_estimate",address:l,co
1ordinates:x,roofPolygons:{type:"FeatureCollection",features:u.map(A=>({type:"Feature",properties:{name:A.name,slope:A.slope},geometry:{type:"Polygon",coordinates:[A.coordinates]}}))},estimatedSqFt:f,slopes:Object.fromEntries(u.map(A=>[A.name,A.slope])),pitchSource:M||"manual",...C?{solarWeightedPitch:C.weightedPitchDegrees,solarWeightedSlope:C.weightedSlope,solarImageryQuality:C.imageryQuality}:{},priceRange:h,...v&&{propertyType:v},...P&&{roofType:P},...B.length>0&&{tags:B},...d&&{selectedProduct:{id:d.id,name:d.name,tier:d.tier,manufacturer:d.manufacturer,material:d.material,pricePerUnit:d.pricePerUnit}},...j&&{selectedColor:{name:j.name,hex:j.hex}},contact:{name:c.name,email:c.email,phone:c.phone||void 0,projectTimeline:c.projectTimeline||void 0,additionalNotes:c.additionalNotes||void 0,estimateAcknowledgement:!!c.estimateAcknowledgement,estimateAcknowledgementText:w}},{API_URLS:T}=await te(async()=>{const{API_URLS:A}=await import("./api-config-Yu7X_qnK.js");return{API_URLS:A}},[]),E=await fetch(T.submitLead,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)}),D=await E.json();if(!E.ok||!D.success)throw new Error(D.error||"Failed to submit lead");q("success")}catch(M){console.error("Failed to submit lead:",M),N("Failed to submit. Please try again.")}finally{s(!1)}}};return e.jsxs("div",{className:"embediq-step embediq-contact-step",children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:d?"Get Your Detailed Quote":"Schedule Your Free Inspection"}),e.jsx("p",{className:"embediq-step-subtitle",children:d?`${d.name}${j?` in ${j.name}`:""}`:"We'll confirm your estimate and discuss your options - no obligation"})]}),e.jsxs("form",{onSubmit:k,className:"embediq-contact-form",children:[e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Name ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"text",value:c.name||"",onChange:p=>o({name:p.target.value}),className:`embediq-input ${i.name?"embediq-input-error":""}`,placeholder:"Your full name"}),i.name&&e.jsx("span",{className:"embediq-error",children:i.name})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Email ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"email",value:c.email||"",onChange:p=>o({email:p.target.value}),className:`embediq-input ${i.email?"embediq-input-error":""}`,placeholder:"[email protected]"}),i.email&&e.jsx("span",{className:"embediq-error",children:i.email})]}),n.leadFields.phone&&e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Phone ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"tel",value:c.phone||"",onChange:p=>o({phone:p.target.value}),className:`embediq-input ${i.phone?"embediq-input-error":""}`,placeholder:"(555) 123-4567"}),i.phone&&e.jsx("span",{className:"embediq-error",children:i.phone})]}),n.leadFields.projectTimeline&&e.jsxs("div",{className:"embediq-form-group",children:[e.jsx("label",{className:"embediq-label",children:"Project Timeline"}),e.jsxs("select",{value:c.projectTimeline||"",onChange:p=>o({projectTimeline:p.target.value}),className:"embediq-select",children:[e.jsx("option",{value:"",children:"Select timeline..."}),Ft.map(p=>e.jsx("option",{value:p,children:p},p))]})]}),n.leadFields.additionalNotes&&e.jsxs("div",{className:"embediq-form-group",children:[e.jsx("label",{className:"embediq-label",children:"Anything we should know?"}),e.jsx("textarea",{value:c.additionalNotes||"",onChange:p=>o({additionalNotes:p.target.value}),className:"embediq-textarea",placeholder:"Tell us about leaks, storm damage, access issues, or anything else we should know...",rows:3})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-acknowledgement-label",children:[e.jsx("input",{type:"checkbox",checked:!!c.estimateAcknowledgement,onChange:p=>o({estimateAcknowledgement:p.target.checked}),className:"embediq-acknowledgement-checkbox"}),e.jsxs("span",{children:[w," ",e.jsx("span",{className:"embediq-required",children:"*"})]})]}),i.estimateAcknowledgement&&e.jsx("span",{className:"embediq-error",children:i.estimateAcknowledgement})]}),e.jsxs("div",{className:"embediq-step-actions",children:[e.jsx("button",{type:"button",onClick:()=>q(d?"product-detail":"estimate"),className:"embediq-btn embediq-btn-secondary",disabled:t,children:"Back"}),e.jsx("button",{type:"submit",className:"embediq-btn embediq-btn-primary",disabled:t,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"embediq-spinner-small"}),"Submitting..."]}):d?"Send Me Details":"Schedule My Inspection"})]})]})]})}function _t({onClose:t}){const{contact:s,priceRange:i,address:a}=R();return e.jsxs("div",{className:"embediq-step embediq-success-step",children:[e.jsx("div",{className:"embediq-success-icon",children:e.jsx("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h2",{className:"embediq-success-title",children:"You're All Set!"}),e.jsxs("p",{className:"embediq-success-message",children:["Thanks, ",s.name?.split(" ")[0],"! We've received your request and a roofing specialist will reach out within 24 hours to schedule your free inspection."]}),e.jsxs("div",{className:"embediq-success-summary",children:[e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Property"}),e.jsx("span",{className:"embediq-summary-value",children:a})]}),e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Estimate Range"}),e.jsxs("span",{className:"embediq-summary-value",children:["$",i?.min.toLocaleStr
1ing()," - $",i?.max.toLocaleString()]})]}),e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Confirmation sent to"}),e.jsx("span",{className:"embediq-summary-value",children:s.email})]})]}),e.jsxs("div",{className:"embediq-success-next",children:[e.jsx("h3",{children:"What Happens Next"}),e.jsxs("ul",{className:"embediq-next-steps",children:[e.jsxs("li",{children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e.jsx("span",{children:"We'll call or text within 24 hours to schedule your inspection"})]}),e.jsxs("li",{children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e.jsx("span",{children:"Our expert will inspect your roof and review your options in person"})]}),e.jsxs("li",{children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e.jsx("span",{children:"You'll receive a detailed written quote - no obligation, no pressure"})]})]})]}),e.jsx("button",{onClick:t,className:"embediq-btn embediq-btn-secondary",children:"Close"})]})}function Wt(){const[t,s]=g.useState(!1),[i,a]=g.useState(!1),[n,r]=g.useState({}
1),{address:l,coordinates:x,contact:u,setContact:f,embedId:h,setStep:d,settings:m}=R(),j=_e(m),c=()=>{const q={};return u.name?.trim()||(q.name="Name is required"),u.email?.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u.email)||(q.email="Please enter a valid email"):q.email="Email is required",u.phone?.trim()||(q.phone="Phone is required"),u.estimateAcknowledgement||(q.estimateAcknowledgement="Please acknowledge that this online estimate is not the final price"),r(q),Object.keys(q).length===0},o=async q=>{if(q.preventDefault(),!!c()){s(!0);try{const{API_URLS:N}=await te(async()=>{const{API_URLS:w}=await import("./api-config-Yu7X_qnK.js");return{API_URLS:w}},[]);await fetch(N.submitLead,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embedId:h,address:l,coordinates:x,contact:{name:u.name,email:u.email,phone:u.phone,additionalNotes:u.additionalNotes,estimateAcknowledgement:!!u.estimateAcknowledgement,estimateAcknowledgementText:j},source:"manual",roofPolygons:null,estimatedSqFt:null,priceRange:null})}),a(!0)}catch(N){console.error("Failed to submit:",N)}finally{s(!1)}}};return i?e.jsxs("div",{className:"embediq-step embediq-fallback-step",children:[e.jsx("div",{className:"embediq-success-icon",children:e.jsx("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h2",{className:"embediq-success-title",children:"Request Submitted!"}),e.jsx("p",{className:"embediq-success-message",children:"Thanks! A roofing specialist will contact you within 24 hours."})]}):e.jsxs("div",{className:"embediq-step embediq-fallback-step",children:[e.jsx("div",{className:"embediq-fallback-icon",children:e.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsx("h2",{className:"embediq-step-title",children:"We Couldn't Find That Address"}),e.jsx("p",{className:"embediq-step-subtitle",children:"No problem! Leave your details below and a roofing specialist will contact you within 24 hours with a personalized estimate."}),l&&e.jsxs("div",{className:"embediq-fallback-address",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"})}),e.jsx("span",{children:l})]}),e.jsxs("form",{onSubmit:o,className:"embediq-contact-form",children:[e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Name ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"text",value:u.name||"",onChange:q=>f({name:q.target.value}),className:`embediq-input ${n.name?"embediq-input-error":""}`,placeholder:"Your full name"}),n.name&&e.jsx("span",{className:"embediq-error",children:n.name})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Email ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"email",value:u.email||"",onChange:q=>f({email:q.target.value}),className:`embediq-input ${n.email?"embediq-input-error":""}`,placeholder:"[email protected]"}),n.email&&e.jsx("span",{className:"embediq-error",children:n.email})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:["Phone ",e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsx("input",{type:"tel",value:u.phone||"",onChange:q=>f({phone:q.target.value}),className:`embediq-input ${n.phone?"embediq-input-error":""}`,placeholder:"(555) 123-4567"}),n.phone&&e.jsx("span",{className:"embediq-error",children:n.phone})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsx("label",{className:"embediq-label",children:"Anything we should know?"}),e.jsx("textarea",{value:u.additionalNotes||"",onChange:q=>f({additionalNotes:q.target.value}),className:"embediq-textarea",placeholder:"Tell us about leaks, storm damage, access issues, or anything else we should know...",rows:3})]}),e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-acknowledgement-label",children:[e.jsx("input",{type:"checkbox",checked:!!u.estimateAcknowledgement,onChange:q=>f({estimateAcknowledgement:q.target.checked}),className:"embediq-acknowledgement-checkbox"}),e.jsxs("span",{children:[j," ",e.jsx("span",{className:"embediq-required",children:"*"})]})]}),n.estimateAcknowledgement&&e.jsx("span",{className:"embediq-error",children:n.estimateAcknowledgement})]}),e.jsxs("div",{className:"embediq-step-actions",children:[e.jsx("button",{type:"button",onClick:()=>d("address"),className:"embediq-btn embediq-btn-secondary",disabled:t,children:"Try Another Address"}),e.jsx("button",{type:"submit",className:"embediq-btn embediq-btn-primary",disabled:t,children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"embediq-spinner-small"}),"Submitting..."]}):"Get My Free Quote"})]})]})]})}const Re=[{label:"Name",value:"Sarah Johnson",type:"text"},{label:"Email",value:"[email protected]",type:"email"},{label:"Phone",value:"(813) 555-0142",type:"tel"},{label:"Timeline",value:"Within 1-2 weeks",type:"select"}],de=[{day:"Mon",date:"17",available:!1},{day:"Tue",date:"18",available:!0},{day:"Wed",date:"19",available:!0},{day:"Thu",date:"20",available:!1},{day:"Fri",date:"21",available:!0}],Ot=["9:00 AM","11:30 AM","2:00 PM"];function zt(){const[t,s]=g.useState("form"),[i,a]=g.useState(0),[n,r]=g.useState(null),[l,x]=g.useState(null),[u,f]=g.useState(0),h=g.useRef(null),{priceRange:d,address:m,setStep:j}=R();return g.useEffect(()=>{if(t==="form")return i<Re.length?h.current=setTimeout(()=>{a(c=>c+1)},600):h.current=setTimeout(()=>{s("calendar")},800),()=>clearTimeout(h.current)},[t,i]),g.useEffect(()=>{if(t==="calendar")return h.current=setTimeout(()=>{r(1)},700),()=>clearTimeout(h.current)},[t]),g.useEffect(()=>{if(!(n===null||t!=="calendar"))return h.current=setTimeout(()=>{x(1)},600),()=>clearTimeout(h.current)},[n,t]),g.useEffect(()=>{if(!(l===null||t!=="calendar"))return h.current=setTimeout(()=>{s("confirming")},800),()=>clearTimeout(h.current)},[l,t]),g.useEffect(()=>{if(t!=="confirming")return;const c=setInterval(()=>{f(o=>o>=100?(clearInterval(c),setTimeout(()=>s("confirmed"),300),100):o+4)},40);return()=>clearInterval(c)},[t]),e.jsxs("div",{className:"embediq-step",style:{position:"relative"},children:[e.jsx("div",{style:{background:"linear-gradient(135deg, #06B6D4, #0891B2)",color:"white",padding:"10px 16px",borderRadius:"8px",fontSize:"12px",fontWeight:"600",textAlign:"center",marginBottom:"20px",letterSpacing:"0.5px"},children:"DEMO: Here is what your customers experience next"}),(t==="form"||t==="calendar"||t==="confirming"||t==="confirmed")&&t==="form"&&e.jsxs("div",{children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"Schedule Your Free Inspection"}),e.jsx("p",{className:"embediq-step-subtitle",children:"Customers fill out their contact info to lock in the estimate."})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:Re.map((c,o)=>e.jsxs("div",{className:"embediq-form-group",children:[e.jsxs("label",{className:"embediq-label",children:[c.label," ",o<2&&e.jsx("span",{className:"embediq-required",children:"*"})]}),e.jsxs("div",{style:{position:"relative"},children:[e.jsx("input",{type:"text",readOnly:!0,value:o<i?c.value:"",className:"embediq-input",style:{transition:"all 0.3s ease",borderColor:o<i?"#06B6D4":void 0,background:o<i?"#f0fdfa":void 0}}),o===i&&e.jsx("div",{style:{position:"absolute",right:"12px",to
1p:"50%",transform:"translateY(-50%)",width:"8px",height:"16px",borderRight:"2px solid #06B6D4",animation:"embediq-blink 0.8s infinite"}}),o<i&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#06B6D4",strokeWidth:"3",style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)"},children:e.jsx("path",{d:"M20 6L9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},c.label))})]}),t==="calendar"&&e.jsxs("div",{children:[e.jsxs("div",{className:"embediq-step-header",children:[e.jsx("h2",{className:"embediq-step-title",children:"Pick an Inspection Date"}),e.jsx("p",{className:"embediq-step-subtitle",children:"Customers choose a convenient time. You control availability."})]}),e.jsxs("div",{style:{background:"#f9fafb",borderRadius:"12px",padding:"20px",marginBottom:"16px"},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:"600",color:"#374151",marginBottom:"16px",textAlign:"center"},children:"March 2026"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"8px",marginBottom:"20px"},children:de.map((c,o)=>e.jsxs("button",{disabled:!c.available,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:"12px 8px",border:n===o?"2px solid #06B6D4":"2px s
1olid #e5e7eb",borderRadius:"10px",background:c.available?n===o?"#ecfeff":"white":"#f3f4f6",cursor:c.available?"pointer":"not-allowed",opacity:c.available?1:.4,transition:"all 0.3s ease",fontSize:"12px"},children:[e.jsx("span",{style:{color:"#6b7280",fontWeight:"500"},children:c.day}),e.jsx("span",{style:{fontSize:"18px",fontWeight:"700",color:n===o?"#06B6D4":"#1f2937"},children:c.date})]},c.date))}),n!==null&&e.jsxs("div",{style:{animation:"embediq-fadeIn 0.3s ease"},children:[e.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:"#374151",marginBottom:"10px"},children:["Available times for ",de[n].day," ",de[n].date]}),e.jsx("div",{style:{display:"flex",gap:"8px"},children:Ot.map((c,o)=>e.jsx("button",{style:{flex:1,padding:"10px",border:l===o?"2px solid #06B6D4":"2px solid #e5e7eb",borderRadius:"8px",background:l===o?"#ecfeff":"white",color:l===o?"#06B6D4":"#374151",fontWeight:l===o?"700":"500",fontSize:"13px",cursor:"pointer",transition:"all 0.3s ease"},children:c},c))})]})]})]}),t==="confirming"&&e.jsxs("div",{style:{textAlign:"center",padding:"40px 20px"},children:[e.jsx("div",{className:"embediq-spinner",style:{marginBottom:"20px"}}),e.jsx("h2",{className:"embediq-step-title",style:{fontSize:"20px"},children:"Booking inspection..."}),e.jsx("p",{className:"embediq-step-subtitle",children:"Sending confirmation to the homeowner and your team"}),e.jsx("div",{style:{width:"100%",height:"6px",background:"#e5e7eb",borderRadius:"3px",marginTop:"24px",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",background:"linear-gradient(90deg, #06B6D4, #0891B2)",borderRadius:"3px",width:`${u}%`,transition:"width 0.1s linear"}})})]}),t==="confirmed"&&e.jsxs("div",{style:{animation:"embediq-fadeIn 0.4s ease"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:"24px"},children:[e.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"50%",background:"#ecfdf5",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px"},children:e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#22c55e",strokeWidth:"2.5",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h2",{className:"embediq-step-title",children:"Inspection Booked!"}),e.jsx("p",{className:"embediq-step-subtitle",children:"The homeowner gets a confirmation email. You get the lead."})]}),e.jsxs("div",{style:{background:"#f9fafb",borderRadius:"12px",padding:"16px",marginBottom:"20px"},children:[e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Customer"}),e.jsx("span",{className:"embediq-summary-value",children:"Sarah Johnson"})]}),e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Property"}),e.jsx("span",{className:"embediq-summary-value",style:{fontSize:"12px"},children:m})]}),e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Estimate"}),e.jsxs("span",{className:"embediq-summary-value",children:["$",d?.min.toLocaleString()," - $",d?.max.toLocaleString()]})]}),e.jsxs("div",{className:"embediq-summary-item",children:[e.jsx("span",{className:"embediq-summary-label",children:"Inspection"}),e.jsx("span",{className:"embediq-summary-value",children:"Tue Mar 18, 11:30 AM"})]})]}),e.jsxs("div",{style:{background:"linear-gradient(135deg, #06B6D4, #0891B2)",borderRadius:"12px",padding:"20px",color:"white",marginBottom:"20px"},children:[e.jsx("div",{style:{fontWeight:"700",fontSize:"15px",marginBottom:"12px"},children:"What you receive as the contractor:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",fontSize:"13px"},children:["Full contact info (name, email, phone)","Satellite-verified roof measurements","Price range the homeowner saw","Booked inspection date and time","Lead delivered to your CRM instantly"].map(c=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",children:e.jsx("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{children:c})]},c))})]}),e.jsx("button",{onClick:()=>j("estimate"),className:"embediq-back-link",style:{marginBottom:"8px"},children:"â Back to estimate"})]})]})}function $t({embedId:t,inline:s=!1}){const[i,a]=g.useState(s),[n,r]=g.useState(!1),[l,x]=g.useState(!0),[u,f]=g.useState(null),[h,d]=g.useState(!1),m=g.useRef(null),j=g.useRef(null),{step:c,settings:o,setSettings:q,reset:N}=R();g.useEffect(()=>{async function F(){try{console.log("Loading embed:",t);const T=await Ue(Ge(Ve,"publicEmbeds",t));if(console.log("Public doc exists:",T.exists()),T.exists()){const E=T.data();console.log("Embed data:",E),q(E.settings,t)}else console.log("Embed not found in publicEmbeds"),f(`Embed not found (ID: ${t})`)}catch(T){console.error("Failed to load embed settings:",T),f(`Failed to load embed: ${T.message}`)}finally{x(!1)}}F()},[t,q]),g.useEffect(()=>()=>{m.current&&clearTimeout(m.current),j.current&&clearTimeout(j.current)},[]),g.useEffect(()=>{if(!(s||i||!o||!(o.showTooltip!==!1)))return m.current=setTimeout(()=>{r(!0)},1e3),()=>{m.current&&clearTimeout(m.current)}},[s,i,o]),g.useEffect(()=>{if(!(!n||h))return j.current=setTimeout(()=>{r(!1)},1e4),()=>{j.current&&clearTimeout(j.current)}},[n,h]);const w=g.useCallback(()=>{d(!0),o?.showTooltip!==!1&&!i&&r(!0)},[o,i]),b=g.useCallback(()=>{d(!1)},[]),k=()=>{a(!1),N()},p=()=>{a(!0),r(!1)};if(l)return s?e.jsx("div",{className:"embediq-loading",children:e.jsx("div",{className:"embediq-spinner"})}):null;if(u||!o)return s?e.jsx("div",{className:"embediq-error",children:u||"Unable to load widget"}):null;const M=()=>{switch(c){case"address":return e.jsx(Se,{});case"roof-confirm":return e.jsx(jt,{});case"slope":return e.jsx(yt,{});case"material-selection":return e.jsx(St,{});case"estimate":return e.jsx(kt,{});case"product-catalog":return e.jsx(Pt,{});case"product-detail":return e.jsx(At,{});case"contact":return e.jsx(Dt,{});case"property-type":return e.jsx(Bt,{});case"demo-booking":return e.jsx(zt,{});case"success":return e.jsx(_t,{onClose:k});case"fallback":return e.jsx(Wt,{});default:return e.jsx(Se,{})}},C=o.tabColor||"#dc2626",P=o.tabText||"Get Instant Estimate",v=o.tooltipColor||"#ffffff",B=o.showTooltip!==!1;return s?e.jsx("div",{className:"embediq-inline",style:{"--embediq-primary":o.primaryColor},children:M()}):e.jsxs("div",{className:"embediq-widget",style:{"--embediq-primary":o.primaryColor},children:[e.jsx(bt,{text:P,onClick:p,primaryColor:C,onMouseEnter:w,onMouseLeave:b}),B&&n&&!i&&e.jsx(gt,{text:o.tooltipText,onClose:()=>r(!1),onClick:p,backgroundColor:v}),i&&e.jsx(xt,{onClose:k,children:M()})]})}function Kt({inline:t=!1}){const{id:s}=Ye();return s?e.jsx($t,{embedId:s,inline:t}):e.jsx("div",{style:{padding:"20px",textAlign:"center",color:"#666"},children:"Loading..."})}export{Kt 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.