PageSourceSearch

https://app.homesage.ai/assets/RenovationDetailsDialog-DaFlzrEk.js

js homesage.ai collected 2026-10-01 14:12:53 UTC 45,522 bytes, 2 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`10fe3c24c5890d34ac72202b7a4a8c6969b98944`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`02863e4b-422a-49b8-9af9-e479e1934311`,e._sentryDebugIdIdentifier=`sentry-dbid-02863e4b-422a-49b8-9af9-e479e1934311`)}catch{}})();import{a as e}from"./rolldown-runtime-BUlYmePi.js";import{n as t,t as n}from"./jsx-runtime-CK8UOX2c.js";import{t as r}from"./api-client-BHvLKpil.js";import{d as i,g as a,h as o,l as s,m as c,p as l,u}from"./dialog-DtNxEP_Q.js";import{t as d}from"./utils-B1PFnyRM.js";import{t as f}from"./createLucideIcon-DM8I-GOw.js";import{t as p}from"./arrow-right-BUbx3iH9.js";import{i as m,r as h}from"./types-PFXIlhux.js";import{t as g}from"./chevron-down-Ccg2x4vF.js";import{t as _}from"./circle-alert-Bdx6mVLF.js";import{t as v}from"./file-text-5QPCjVLP.js";import{t as y}from"./house-B8CLEX2R.js";import{t as b}from"./images-DxGsbx8r.js";import{t as x}from"./maximize-2-BeG2mUUT.js";import{t as S}from"./minimize-2-DwJnBEq9.js";import{t as C}from"./pencil-DxthI9e9.js";import{t as w}from"./useQuery-Z16X8PuQ.js";import{t as T}from"./info-tip-DjSGmHmI.js";import{t as E}from"./skeleton-CUHFV0_T.js";import{t as D}from"./query-keys-BRe7Y0Iz.js";import{a as O,o as k,r as A,t as j}from"./format-D0EX2Qwh.js";import{o as M}from"./index.modern-D5EMvqbZ.js";import{n as N,t as P}from"./holding-months-xsUDArEH.js";var F=f(`bed`,[[`path`,{d:`M2 4v16`,key:`vw9hq8`}],[`path`,{d:`M2 8h18a2 2 0 0 1 2 2v10`,key:`1dgv2r`}],[`path`,{d:`M2 17h20`,key:`18nfp3`}],[`path`,{d:`M6 8v9`,key:`1yriud`}]]),ee=f(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),I=e(t(),1),L=new Map;function R(e,t=!0){let n=M(`geocoding`),r=(e??``).trim(),i=r?L.get(r):void 0,[a,o]=(0,I.useState)(null);return(0,I.useEffect)(()=>{if(!t||!r||!n||L.has(r))return;let e=new n.Geocoder,i=!1;return e.geocode({address:r}).then(e=>{if(i)return;let t=e.results?.[0]?.geometry?.location,n=t?{lat:t.lat(),lng:t.lng()}:null;L.set(r,n),o(n)}).catch(()=>{i||(L.set(r,null),o(null))}),()=>{i=!0}},[t,r,n]),i===void 0?a:i}var z=n(),B=`AIzaSyCQKI87kVKSivL_exmG8bMpKlGFr-Om4jI`,V=250;function H(e){return e.interactive===!1?(0,z.jsx)(U,{...e}):(0,z.jsx)(te,{...e})}function U({lat:e,lng:t,className:n,fallback:r,ariaLabel:i}){let[a,o]=(0,I.useState)(!1);if(!Number.isFinite(e)||!Number.isFinite(t)||a)return(0,z.jsx)(z.Fragment,{children:r??null});let s=new URLSearchParams({size:`320x240`,location:`${e},${t}`,fov:`80`,pitch:`0`,radius:String(V),source:`outdoor`,return_error_code:`true`,key:B});return(0,z.jsx)(`img`,{src:`https://maps.googleapis.com/maps/api/streetview?${s.toString()}`,alt:i??`Street view`,className:n??`h-full w-full object-cover object-bottom`,loading:`lazy`,onError:()=>o(!0)})}function te({lat:e,lng:t,className:n,fallback:r,ariaLabel:i}){let a=(0,I.useRef)(null),o=M(`streetView`),[s,c]=(0,I.useState)(null);return(0,I.useEffect)(()=>{if(!o||!a.current)return;let n=new o.StreetViewService,r=!1;return n.getPanorama({location:{lat:e,lng:t},radius:V}).then(n=>{if(r||!a.current)return;let i=n.data.location?.pano;new o.StreetViewPanorama(a.current,{pano:i,position:{lat:e,lng:t},pov:{heading:0,pitch:0},zoom:1,addressControl:!1,enableCloseButton:!1,motionTracking:!1,motionTrackingControl:!1,fullscreenControl:!0}),c(!0)}).catch(()=>{r||c(!1)}),()=>{r=!0}},[o,e,t]),s===!1?(0,z.jsx)(z.Fragment,{children:r??null}):(0,z.jsx)(`div`,{ref:a,className:n??`h-full w-full`,"aria-label":i,role:i?`img`:void 0})}async function W(e,t=90){let{data:n}=await r.get(`/properties/market-outlook/`,{params:{zip:e,days:t}});return n}var ne=36e5,G=1;function K(e,t){return`fpr:market-outlook:${e}:${t}`}function re(e,t){if(typeof window>`u`||!e)return null;try{let n=window.sessionStorage.getItem(K(e,t));if(!n)return null;let r=JSON.parse(n);return r.v!==G||r.zip!==e||r.days!==t||Date.now()-r.cachedAt>ne?null:{data:r.data,cachedAt:r.cachedAt}}catch{return null}}function ie(e){if(!(typeof window>`u`)&&e.zip)try{let t={v:G,zip:e.zip,days:e.days,cachedAt:Date.now(),data:e.data};
1window.sessionStorage.setItem(K(e.zip,e.days),JSON.stringify(t))}catch{}}function ae(e,t=90){let n=e?re(e,t):null;return w({queryKey:D.marketOutlook(e??``,t),queryFn:async()=>{let n=await W(e,t);return ie({zip:e,days:t,data:n}),n},enabled:!!e,initialData:n?.data,initialDataUpdatedAt:n?.cachedAt,staleTime:36e5,gcTime:36e5,refetchOnWindowFocus:!1})}async function oe(e){let{data:t}=await r.post(`/properties/skip-tracing/property-owner-information/`,{address:e});return t}var q=21e4;async function se(e,t){if(t&&t.length>0){let n=new FormData;n.append(`property_address`,e);for(let e of t)n.append(`images`,e);let{data:i}=await r.post(`/properties/renovation-cost-breakdown/`,n,{timeout:q,headers:{"Content-Type":`multipart/form-data`}});return i}let{data:n}=await r.post(`/properties/renovation-cost-breakdown/`,{property_address:e},{timeout:q});return n}var J=12e4,Y=6e4;async function ce(e){let{data:t}=await r.get(`/solar/analysis/`,{params:{address:e,agent:`true`},timeout:J});return t}async function le(e){let{data:t}=await r.get(`/mortgage-lien/analysis/`,{params:{address:e},timeout:Y});return t}var ue=864e5,de=1;function fe(e,t){return`fpr:renovation:${e}:${t?`custom`:`default`}`}function pe(e,t){if(typeof window>`u`||!e)return null;try{let n=window.sessionStorage.getItem(fe(e,t));if(!n)return null;let r=JSON.parse(n);return r.v!==de||r.address!==e||r.custom!==t||Date.now()-r.cachedAt>ue?null:{data:r.data,cachedAt:r.cachedAt}}catch{return null}}function X(e){if(!(typeof window>`u`)&&e.address)try{let t={v:de,address:e.address,custom:e.hasImages,cachedAt:Date.now(),data:e.data};window.sessionStorage.setItem(fe(e.address,e.hasImages),JSON.stringify(t))}catch{}}function me(e,t,n){let r=!!(n&&n.length>0),i=e?pe(e,r):null;return w({queryKey:D.renovation(e??``,r),queryFn:async()=>{let t=await se(e,r?n:void 0);return X({address:e,hasImages:r,data:t}),t},enabled:t&&!!e,initialData:i?.data,initialDataUpdatedAt:i?.cachedAt,staleTime:1/0,gcTime:36e5,refetchOnWindowFocus:!1,retry:!1})}function he(e,t){return w({queryKey:D.owner(e??``),queryFn:()=>oe(e),enabled:t&&!!e,staleTime:1/0,gcTime:36e5,refetchOnWindowFocus:!1,retry:!1})}function Z(e){return 2e3*(e+1)}function ge(e){return typeof e==`object`&&e?e:{}}function _e(e){return(t,n)=>{if(t>=2)return!1;let{status:r,code:i}=ge(n);return r===0||i===`ECONNABORTED`||typeof r==`number`&&e.includes(r)}}var ve=_e([502,503]);function ye(e,t){return w({queryKey:D.solar(e??``),queryFn:()=>ce(e),enabled:t&&!!e,staleTime:1/0,gcTime:36e5,refetchOnWindowFocus:!1,retry:ve,retryDelay:Z})}var be=_e([502,504]);function xe(e,t){return w({queryKey:D.mortgageLien(e??``),queryFn:()=>le(e),enabled:t&&!!e,staleTime:1/0,gcTime:36e5,refetchOnWindowFocus:!1,retry:be,retryDelay:Z})}function Se(e,t,n){if(!e)return 0;let r=t/100/12,i=n*12;return Math.round(r===0?e/i:e*(r*(1+r)**+i)/((1+r)**+i-1))}function Ce(e,t,n,r){if(!e||!r)return e;let i=t/100/12,a=n*12;if(i===0)return Math.round(e-e/a*r);let o=e*(i*(1+i)**+a)/((1+i)**+a-1);return Math.round(e*(1+i)**+r-o*((1+i)**+r-1)/i)}function we(e,t,n=`flip`){let r=e.property_info?.status===`Sold`?e.property_value?.sold_price===`N/A`?e.property_value?.avm:e.property_value?.sold_price:e.property_value?.listing_price||e.property_value?.avm||0,i=Number(String(r??``).replace(/[$,]/g,``));if(!i||!Number.isFinite(i))return null;let a=k(e.property_value?.full_potential)??Math.round(i*1.15),o=Number(a)||i*1.15,s=k(e.rental_potential?.long_term?.expense_breakdown?.property_tax_monthly)||Math.round((k(e.listing_details?.listing_details?.tax_amt)??0)/12)||Math.round(i*.011/12),c=k(e.rental_potential?.long_term?.expense_breakdown?.insurance_monthly)||Math.round(i*.004/12),l=k(e.property_info?.location_community?.hoa_fee)??0,u=k(e.purchased_held?.closing_cost_at_purchase)??0,d=u&&i?u/i:.025,f=Math.round(o*.02),p=t?.property_summary,m=k(p?.renovation_cost_estimate)??0,h=k(e.renovation_cost?.estimated_renovation_cost)??0,g=m||h||Math.round(i*.13),_=!!t?.additional_costs,v=t?.additional_costs?.miscellaneous,y=t?.additional_costs?.contingency,b=Math.round(_?((k(v?.cost_low)??0)+(k(v?.cost_high)??0))/2:g*.05),x=Math.round(_?((k(y?.cost_low)??0)+(k(y?.cost_high)??0))/2:g*.1),S=g-b-x,C=Math.round(S*45/95.5),w=Math.round(S*38/95.5),T=Math.round(S*7.5/95.5),E=S-C-w-T,D=[{name:`Materials (45%)`,value:C},{name:`Labor / Contractor (38%)`,value:w},{name:`Permits & Inspections`,value:T,dummy:!p},{name:`Design Fees (5%)`,value:E},{name:`Miscellaneous`,value:b,dummy:!p},{name:`Contingency`,value:x,dummy:!p}];return{purchasePrice:i,arv:o,propertyTaxMonthly:s,insuranceMonthly:c,hoaMonthly:l,closingCostAtPurchasePct:d,flipClosingAtSale:f,originalRenovationTotal:n===`residence`?Math.round(g*.75):g,originalRenovationItems:D}}function Te(e,t){return{purchaseType:`cash`,downPayment:20,loanTerm:30,interestRate:7,purchasePrice:e.purchasePrice,renovationBudget:e.originalRenovationTotal,arvOverride:Math.round(e.arv),holdingPerio
1dAuto:!0,holdingPeriod:t===`flip`?7:6}}function Ee(e){let t=e.type===`flip`,n=t?e.sellingTotal:0,r=e.acquisitionTotal+e.renovationTotal+e.holdingTotal+n,i=(e,t)=>t===0?0:Math.round(e/t*1e3)/10,a,o,s,c,l,u=r;if(t)o=Math.round(e.arv-r),a=i(o,r),s=i(o,e.arv);else{let t=e.isCash?Math.round(e.arv-r):Math.round(e.arv-e.remainingLoanBalance);c=t,a=i(t,r),l=i(t,e.arv)}return{totalProjectCost:r,roi:a,profit:o,profitMargin:s,equity:c,equityMargin:l,breakEven:u,priceToArv:i(e.purchasePrice,e.arv),costsVsArvPct:i(r,e.arv)}}function De(e,t,n){let r=e===`flip`,{purchaseType:i,downPayment:a,loanTerm:o,interestRate:s,renovationBudget:c,arvOverride:l,holdingPeriodAuto:u,holdingPeriod:d,purchasePrice:f}=n,p=u?r?N(c):P(c,e):d,m=l,h=f??t.purchasePrice,g=i===`cash`,_=g?0:h*(1-a/100),v=Se(_,s,o),y=g?0:Math.round(_*.005),b=Math.round(h*.005),x=Math.round(h*t.closingCostAtPurchasePct),S=Math.round(h*.0025),C=[{name:`Purchase Price`,value:Math.round(h)},{name:`Closing Costs`,value:x},{name:`Home Inspection`,value:450},...g?[]:[{name:`Loan Origination (0.5%)`,value:y}],{name:`Title Insurance (0.5%)`,value:b},{name:`Other`,value:S}],w=C.reduce((e,t)=>e+t.value,0),T=t.originalRenovationTotal>0?c/t.originalRenovationTotal:1,E=t.originalRenovationItems.map(e=>({...e,value:Math.round(e.value*T)})),D=Math.round(c),O=Math.round(h*.001),k=[...g?[]:[{name:`Mortgage Payment`,value:v,monthly:!0}],{name:`Property Taxes`,value:t.propertyTaxMonthly||Math.round(h*.011/12),monthly:!0},{name:`Insurance`,value:t.insuranceMonthly||150,monthly:!0},{name:`Utilities`,value:200,monthly:!0},{name:`HOA`,value:Math.round(t.hoaMonthly),monthly:!0},{name:`Other`,value:O,monthly:!0}],A=k.reduce((e,t)=>e+t.value,0),j=Math.round(A*p),M=Math.round(m*.055),F=Math.round(m*.005),ee=Math.round(m*.02),I=Math.round(m*.001),L=[{name:`Agent Commission (5.5%)`,value:M},{name:`Closing Costs at Sale`,value:t.flipClosingAtSale},{name:`Staging`,value:3500},{name:`Transfer Taxes (0.5%)`,value:F},{name:`Seller Concessions (2%)`,value:ee},{name:`Other`,value:I}],R=L.reduce((e,t)=>e+t.value,0),z=!r&&!g?Ce(_,s,o,p):0,B={...Ee({type:e,isCash:g,arv:m,purchasePrice:h,acquisitionTotal:w,renovationTotal:D,holdingTotal:j,sellingTotal:R,remainingLoanBalance:z}),arv:Math.round(m),purchasePrice:Math.round(h),remainingLoanBalance:z,acquisition:{total:w,items:C},renovation:{total:D,items:E},holding:{total:j,months:p,monthly:Math.round(A),items:k}};return r&&(B.selling={total:R,items:L}),B}function Oe(e){return e/100}function ke(e,t){return e.manualMonths??N(t)}function Ae(e,t){let n=ke(e,t);return e.acquisitionTotal+Math.round(t)+Math.round(e.holdingMonthly*n)+e.sellingTotal}function je(e,t){let n=Ae(e,t);return n===0?0:Math.round(e.arv-n)/n*100}function Me(e,t){let n=Ae(e,t);return Math.round(e.arv-n)>=e.target*n}var Q=e=>Number.isFinite(e)&&e>=0;function Ne(e){let t={kind:`unachievable`,reason:`invalid-input`};if(!Number.isFinite(e.arv)||!Q(e.acquisitionTotal)||!Q(e.holdingMonthly)||!Q(e.sellingTotal)||!Q(e.target)||e.manualMonths!==void 0&&!Q(e.manualMonths))return t;if(!Me(e,0))return{kind:`unachievable`,reason:`target-missed`};let n=Math.max(1,Math.ceil(Math.max(e.arv,0))+1),r=0,i=1;for(;i<n&&Me(e,i);)r=i,i=Math.min(i*2,n);if(Me(e,i))return t;for(;i-r>1;){let t=r+Math.floor((i-r)/2);Me(e,t)?r=t:i=t}return{kind:`ok`,mar:r,monthsAtMar:ke(e,r)}}var Pe=20,Fe=200,Ie=28,Le=48,Re=100,$={cost:`The renovation figure this card is costing out. Starts at our estimate; drag the handle on the bar to test a different figure.`,mar:`The most you can spend on the renovation and still clear your target ROI. Set by the after-repair value, purchase price, and holding and selling costs — not by the estimate. Assumes cash at the asking price.`,conf:`How clearly the listing photos showed the work needed. It rates our estimate only, not the figures derived from it.`,sqft:`The Renovation cost divided by the home's total floor area, not by the area being renovated — so it compares across properties.`,tgt:`The minimum project ROI this deal must clear. Changing this will adju
1st the Maximum Allowable Renovation limit.`};function ze(e,t){return e>=t?`pos`:e>=0?`mid`:`neg`}var Be={pos:`var(--fpr-mar-pos)`,mid:`var(--fpr-mar-mid)`,neg:`var(--fpr-mar-neg)`};function Ve(e){if(e===null)return`linear-gradient(90deg, var(--fpr-mar-ramp-red), var(--fpr-mar-ramp-red))`;let t=Math.max(0,Math.min(100,e*100));return t<=0?`linear-gradient(90deg, var(--fpr-mar-ramp-red) 0%, var(--fpr-mar-ramp-red-dim) 100%)`:t>=100?`linear-gradient(90deg, var(--fpr-mar-ramp-green-dim) 0%, var(--fpr-mar-ramp-green) 100%)`:[`linear-gradient(90deg,`,`var(--fpr-mar-ramp-green-dim) ${Math.min(0,t-Ie)}%,`,`var(--fpr-mar-ramp-green) ${t}%,`,`var(--fpr-mar-ramp-red) ${t}%,`,`var(--fpr-mar-ramp-red-dim) ${Math.max(100,t+Ie)}%)`].join(` `)}function He(e){let t=Math.abs(e)<.05?0:e;return`${t<0?`-`:``}${Math.abs(t).toFixed(1)}%`}function Ue(e){return e==null?`bad`:e>=80?`high`:e>=60?`mid`:`bad`}function We({llm:e,flip:t,onOpenDetails:n,note:r,action:i}){let a=t.kind===`ready`?t.inputs:null,o=e.property_summary??{},s=o.renovation_cost_estimate,c=typeof s==`number`&&Number.isFinite(s)&&s>0,l=c?s:0,u=o.total_sqft,f=o.confidence_score,m=Ue(f),[h,g]=(0,I.useState)(l),[_,b]=(0,I.useState)(l);_!==l&&(b(l),g(l));let[x,S]=(0,I.useState)(Pe),[w,D]=(0,I.useState)(!1),O=(0,I.useMemo)(()=>a?{...a,target:Oe(x)}:null,[a,x]),k=(0,I.useMemo)(()=>O?Ne(O):null,[O]),A=k?.kind===`ok`?k.mar:null,M=a?.manualMonths??N(h),P=O?je(O,h):null,F=P!=null&&M>0?P*12/M:null,L=M>0?x*12/M:x,[R,B]=(0,I.useMemo)(()=>{let e=l*.5,t=l*1.5;return A!=null&&(A<e&&(e=Math.max(0,A-l*.08)),A>t&&(t=A+l*.08)),[e,t]},[l,A]),V=B-R,H=e=>V>0?(e-R)/V:0,U=e=>Math.min(1,Math.max(0,H(e))),te=e=>{let t=l+Math.round((e-l)/Re)*Re;return Math.min(B,Math.max(R,t))},W=(0,I.useRef)(null),ne=(0,I.useRef)(null),G=(0,I.useRef)(!1),K=(0,I.useRef)(0),[re,ie]=(0,I.useState)(!1),[ae,oe]=(0,I.useState)(!1),[q,se]=(0,I.useState)(!1),J=(0,I.useRef)(!1),Y=re||ae||q,ce=e=>{let t=W.current?.getBoundingClientRect();if(!t||t.width<=0)return;let n=Math.min(1,Math.max(0,(e-K.current-t.left)/t.width));g(te(R+n*V))},le=e=>{if(e.button!==0)return;let t=W.current?.getBoundingClientRect();if(!t)return;let n=ne.current?.contains(e.target)??!1;K.current=n?e.clientX-(t.left+U(h)*t.width):0,G.current=!0,se(!0),W.current?.setPointerCapture?.(e.pointerId),J.current=!0,ne.current?.focus({preventScroll:!0}),J.current=!1,n||ce(e.clientX),e.preventDefault()},ue=e=>{G.current&&ce(e.clientX)},de=e=>{G.current=!1,se(!1),K.current=0,W.current?.releasePointerCapture?.(e.pointerId)},fe=e=>{let t=e.key===`PageUp`||e.key===`PageDown`?1e3:Re,n=null;(e.key===`ArrowLeft`||e.key===`ArrowDown`||e.key===`PageDown`)&&(n=h-t),(e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`PageUp`)&&(n=h+t),e.key===`Home`&&(n=R),e.key===`End`&&(n=B),n!==null&&(e.preventDefault(),g(te(n)))},pe=e=>{let t=Number.parseFloat(e);Number.isFinite(t)&&t>=0&&S(Math.min(t,Fe))},X=c&&u&&u>0?Math.round(h/u):void 0,me=U(h),he=c&&!!k,Z=c&&t.kind===`pending`;return(0,z.jsxs)(`div`,{className:`relative flex max-w-full flex-col`,children:[(0,z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-[20px] gap-y-[16px] @max-[600px]:grid-cols-1`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-x-[52px] gap-y-[20px] @max-[900px]:gap-x-[38px] @max-[600px]:gap-x-[24px]`,children:[(0,z.jsxs)(Ge,{label:`Renovation cost`,tip:$.cost,children:[(0,z.jsxs)(`span`,{className:`relative block w-fit origin-left motion-safe:transition-[scale] motion-safe:duration-[140ms] motion-safe:ease-[var(--ease-out-quart)]`+(Y?` motion-safe:scale-[1.04]`:``),children:[(0,z.jsx)(`span`,{className:`block text-fpr-display font-semibold leading-none tabular-nums text-foreground @min-[640px]:text-[2rem]`,children:j(c?h:s)}),c&&he&&(0,z.jsx)(`span`,{"aria-hidden":!0,"data-testid":`reno-cost-link-rule`,className:d(`pointer-events-none absolute inset-x-0 -bottom-[6px] h-[2px] origin-left rounded-full bg-[var(--fpr-brand)]`,`motion-safe:transition-[scale,opacity] motion-safe:duration-[160ms] motion-safe:ease-[var(--ease-out-quart)]`,`motion-reduce:transition-opacity motion-reduce:duration-[120ms]`,Y?`opacity-100 motion-safe:scale-x-100 motion-safe:[transition-delay:40ms]`:`opacity-0 [transition-delay:0ms] motion-safe:scale-x-0`)})]}),(f!=null||X!=null)&&(0,z.jsxs)(`span`,{className:`mt-[3px] flex flex-wrap items-center gap-x-[6px] text-fpr-label font-semibold leading-tight text-muted-foreground`,children:[f!=null&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-[4px] whitespace-nowrap`,children:[`Confidence`,(0,z.jsxs)(`span`,{className:`tabular-nums`,style:{color:`var(--fpr-reno-conf-${m})`},children:[Math.round(f),`%`]}),(0,z.jsx)(T,{children:$.conf})]}),f!=null&&X!=null&&(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),X!=null&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-[4px] whitespace-nowrap`,children:[(0,z.jsx)(`span`,{className:`tabular-nums text-foreground`,children:j(X)}),`/ sqft`,(0,z.jsx)(T,{children:$.sqft})]})]})]}),(0,z.jsxs)(Ge,{label:`Max allowable renovation`,tip:$.mar,children:[(0,z.jsx)(Ke,{hasEstimate:c,waiting:Z,ceiling:A,marResult:k}),(he||Z)&&(0,z.jsxs)(`span`,{className:`mt-[3px] inline-flex flex-wrap items-center gap-x-[6px] gap-y-[4px] text-fpr-label font-semibold leading-tight text-muted-foreground`,children:[`Target project ROI`,(0,z.jsx)(T,{children:$.tgt}),w?(0,z.jsxs)(`span`,{className:`inline-flex items-center rounded-[4px] border border-[var(--fpr-brand)] bg-card px-[8px] py-[2px]`,children:[(0,z.jsx)(`input`,{type:`number`,autoF
1ocus:!0,min:0,max:Fe,step:1,defaultValue:x,"aria-label":`Target ROI percent`,onChange:e=>pe(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`Escape`)&&e.currentTarget.blur()},onBlur:e=>{pe(e.target.value),D(!1)},className:`w-[44px] border-0 bg-transparent text-center text-fpr-body font-semibold tabular-nums text-foreground outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`}),(0,z.jsx)(`span`,{className:`text-fpr-body text-muted-foreground`,children:`%`})]}):(0,z.jsxs)(`button`,{type:`button`,"aria-label":`Edit target ROI`,onClick:()=>D(!0),className:`inline-flex items-center gap-[4px] rounded-[4px] bg-muted-foreground/10 px-[12px] py-[2px] text-fpr-body font-semibold tabular-nums text-foreground transition-colors hover:bg-muted-foreground/20`,children:[x,`%`,(0,z.jsx)(C,{className:`size-3 text-muted-foreground`,"aria-hidden":!0})]})]})]}),Z&&(0,z.jsxs)(Ge,{label:`Project ROI`,children:[(0,z.jsx)(E,{className:`h-[2rem] w-[92px]`,"data-testid":`roi-placeholder`}),(0,z.jsx)(E,{className:`mt-[6px] h-[12px] w-[132px]`})]}),c&&P!=null&&F!=null&&(0,z.jsxs)(Ge,{label:`Project ROI`,children:[(0,z.jsx)(`span`,{className:`text-fpr-display font-semibold leading-none tabular-nums @min-[640px]:text-[2rem]`,style:{color:Be[ze(P,x)]},children:He(P)}),(0,z.jsxs)(`span`,{className:`mt-[3px] whitespace-nowrap text-fpr-label font-semibold leading-tight tabular-nums`,style:{color:Be[ze(F,L)]},children:[He(F),` per year · `,M,` mo project`]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center @max-[600px]:w-full @max-[600px]:justify-end`,children:[!n&&i,n&&(0,z.jsxs)(`button`,{type:`button`,onClick:n,className:`flex shrink-0 cursor-pointer items-center gap-[4px] rounded-[8px] border-2 border-[var(--fpr-brand)] bg-accent px-[13px] py-[7px] text-fpr-body font-semibold text-[var(--fpr-brand)] transition-colors duration-200 hover:border-[var(--fpr-brand-bright)]`,children:[`View Details`,(0,z.jsx)(p,{size:16,"aria-hidden":!0})]})]})]}),he?(0,z.jsxs)(`div`,{className:`mt-[44px] px-[13px]`,children:[(0,z.jsxs)(`div`,{ref:W,onPointerDown:le,onPointerMove:ue,onPointerUp:de,onPointerCancel:de,onLostPointerCapture:()=>{G.current=!1,se(!1),K.current=0},className:`relative h-[16px] cursor-pointer touch-none rounded-full bg-[var(--fpr-roi-track)]`,style:{backgroundImage:Ve(A==null?null:H(A))},children:[(0,z.jsx)(`div`,{"aria-hidden":!0,className:`absolute -top-[13px] -bottom-[13px] w-[2px] -translate-x-1/2 bg-muted-foreground shadow-[0_0_0_1px_var(--card)]`,style:{left:`${U(l)*100}%`}}),(0,z.jsx)(qe,{ratio:me,placement:`below`,className:`text-muted-foreground`,children:`Est. ${j(h)}`}),A!=null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(qe,{ratio:U(A),placement:`above`,className:`text-foreground`,children:[`Ceiling `,j(A)]}),(0,z.jsx)(`div`,{"aria-hidden":!0,className:`absolute -top-[13px] -bottom-[13px] z-[7] w-[3px] -translate-x-1/2 rounded-[2px] bg-foreground shadow-[0_0_0_1px_var(--card)]`,style:{left:`${U(A)*100}%`}})]}),(0,z.jsx)(`span`,{"aria-hidden":!0,"data-testid":`reno-grip-ring`,className:d(`pointer-events-none absolute top-1/2 z-[4] size-[32px] -translate-x-1/2 -translate-y-1/2 rounded-full border-[1.5px] border-[var(--fpr-brand)]`,`motion-safe:transition-[scale,opacity] motion-safe:duration-150 motion-safe:ease-[var(--ease-out-quart)]`,`motion-reduce:transition-opacity motion-reduce:duration-[120ms]`,q?`opacity-100 motion-safe:scale-[1.12]`:Y?`opacity-100 motion-safe:scale-[1.06]`:`opacity-45`),style:{left:`${me*100}%`}}),(0,z.jsx)(`div`,{ref:ne,role:`slider`,tabIndex:0,"aria-label":`Renovation budget`,"aria-valuemin":Math.round(R),"aria-valuemax":Math.round(B),"aria-valuenow":Math.round(h),"aria-valuetext":j(h),onKeyDown:fe,onPointerEnter:e=>{e.pointerType===`mouse`&&ie(!0)},onPointerLeave:()=>ie(!1),onFocus:()=>oe(!J.current),onBlur:()=>oe(!1),className:d(`absolute top-1/2 z-[5] size-[26px] -translate-x-1/2 -translate-y-1/2 cursor-grab touch-none rounded-full border-2 border-foreground bg-white shadow-[0_0_0_2px_var(--card),0_2px_6px_rgba(0,0,0,0.28)] active:cursor-grabbing`,`before:absolute before:-inset-[9px] before:content-['']`,`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--fpr-brand)] focus-visible:ring-offset-[3px] focus-visible:ring-offset-card`,`motion-safe:transition-[scale] motion-safe:duration-[140ms] motion-safe:ease-[var(--ease-out-quart)]`,q?`motion-safe:scale-[1.12]`:Y?`motion-safe:scale-[1.06]`:void 0),style:{left:`${me*100}%`}})]}),(0,z.jsxs)(`div`,{className:`mt-[24px] flex justify-between text-fpr-label font-semibold tabular-nums text-muted-foreground`,children:[(0,z.jsx)(`span`,{children:j(R)}),(0,z.jsx)(`span`,{children:j(B)})]})]}):Z?(0,z.jsx)(Je,{}):(0,z.jsx)(Ye,{icon:c?ee:y,title:c?`Deal figures unavailable`:`Nothing to renovate`,body:c?`The Flip & Residence section supplies the purchase, holding and selling costs this ceiling is sized against.`:`Already in good condition, so there is no renovation budget to size.`}),r&&(0,z.jsx)(Ye,{icon:v,title:r.title,body:r.body,tone:`warn`})]})}function Ge({label:e,tip:t,children:n}){return(0,z.jsxs)(`div`,{className:`flex flex-col gap-[4px]`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-[5px] whitespace-nowrap text-fpr-label font-semibold uppercase tracking-[0.08em] text-muted-foreground @max-[600px]:whitespace-normal`,children:[e,t&&(0,z.jsx)(T,{side:`top`,contentClassName:`max-w-[250px]`,children:t})]}),n]})}function Ke({hasEstimate:e,waiting:t,ceiling:n,marResult:r}){let i=`text-fpr-title font-semibold leading-none text-muted-foreground`;return e?t?(0,z.jsx)(E,{className:`h-[2rem] w-[124px]`,"data-testid":`mar-placeholder`}):r?r.kind===`unachievable`?(0,z.jsx)(`span`,{className:i,children:`Not achievable`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`text-fpr-display font-semibold leading-none tabular-nums @min-[640px]:text-[2rem]`,style:{color:`var(--fpr-brand)`},children:j(n)}),n===0&&(0,z.jsx)(`span`,{className:`mt-[3px] whitespace-nowrap text-fpr-label font-semibold leading-tight text-muted-foreground`,children:`Any spend above $0 misses the target`})]}):(0,z.jsx)(`span`,{className:i,children:`Unavailable`}):(0,z.jsx)(`span`,{className:i,children:`Not applicable`})}function qe({ratio:e,placement:t,className:n,children:r}){return(0,z.jsx)(`span`,{className:d(`pointer-events-none absolute left-[var(--pin-left)] -translate-x-1/2 whitespace-nowrap text-[10.5px] font-bold leading-none tabular-nums`,t===`below`?`top-[calc(100%+11px)]`:`bottom-[calc(100%+14px)]`,n),style:{"--pin-left":`clamp(${Le}px, ${e*100}%, calc(100% - ${Le}px))`},children:r})}function Je(){return(0,z.jsxs)(`div`,{role:`status`,"aria-label":`Loading deal figures`,className:`mt-[44px] px-[13px]`,children:[(0,z.jsx)(E,{className:`h-[16px] w-full rounded-full bg-[var(--fpr-roi-track)]`}),(0,z.jsxs)(`div`,{className:`mt-[24px] flex h-[15.4px] items-center justify-between`,children:[(0,z.jsx)(E,{className:`h-[12px] w-[56px]`}),(0,z.jsx)(E,{className:`h-[12px] w-[56px]`})]})]})}function Ye({icon:e,title:t,body:n,tone:r=`neutral`}){return(0,z.jsxs)(`div`,{className:`mt-[20px] flex items-center gap-[13px] rounded-[11px] border border-border bg-muted px-[18px] py-[16px]`,children:[(0,z.jsx)(`div`,{className:`flex size-[32px] shrink-0 items-center justify-center rounded-[8px] bg-[var(--fpr-roi-track)] text-muted-foreground`,children:(0,z.jsx)(e,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h4`,{className:d(`text-fpr-body font-semibold`,r===`warn`?`text-warning-text`:`text-foreground`),children:t}),(0,z.jsx)(`p`,{className:`mt-[2px] text-fpr-label text-muted-foreground`,children:n})]})]})}function Xe({open:e,onOpenChange:t,llm:n,lat:r,lng:f}){let[p,g]=(0,I.useState)(!0),v=n.property_summary??{},y=n.rooms??[],C=n.systems_and_exterior??[],w=n.non_visible_areas??[],T=n.cost_breakdown_summary,E=T?.grand_total_low??0,D=T?.grand_total_high??0,k=v.overall_condition_category,j=v.overall_condition_score,M=k?it(k):null,N=v.images_analyzed;return(0,z.jsx)(o,{open:e,onOpenChange:t,children:(0,z.jsxs)(c,{children:[(0,z.jsx)(l,{className:`fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),(0,z.jsxs)(i,{"aria-describedby":void 0,className:d(`font-fpr fixed z-50 flex flex-col overflow-hidden bg-card outline-none`,`data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,p?`inset-0 h-screen w-screen rounded-none`:`top-1/2 left-1/2 max-h-[92vh] w-[calc(100%-2rem)] max-w-[1200px] -translate-x-1/2 -translate-y-1/2 roun
1ded-[16px] shadow-2xl`),children:[(0,z.jsx)(a,{className:`sr-only`,children:`Renovation Cost Breakdown`}),(0,z.jsx)(`div`,{className:`sticky top-0 z-10 border-b border-border bg-card shadow-[0_1px_3px_0_rgb(0_0_0_/_0.1),0_1px_2px_-1px_rgb(0_0_0_/_0.1)]`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1600px] items-center justify-between gap-[24px] px-[24px] py-[20px] md:px-[40px]`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-[0_1_auto]`,children:[(0,z.jsx)(`p`,{className:`mb-[4px] text-fpr-label font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`Renovation Report`}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[12px]`,children:[(0,z.jsx)(`h2`,{className:`text-fpr-title font-semibold tracking-tight text-foreground`,children:O(v.address)}),k&&M&&(0,z.jsxs)(`span`,{className:`rounded-[8px] border px-[12px] py-[6px] text-fpr-body font-semibold tracking-wide`,style:{backgroundColor:M.bg,color:M.color,borderColor:M.border},children:[k,j!=null&&` (${j}/10)`]}),N!=null&&N>0&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-[6px] text-fpr-body font-medium text-muted-foreground`,children:[(0,z.jsx)(b,{className:`size-[16px]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`tabular-nums`,children:A(N)}),N===1?`image analyzed`:`images analyzed`]})]})]}),(0,z.jsxs)(`div`,{className:`hidden flex-[0_0_auto] items-center gap-[20px] md:flex`,children:[v.bedrooms!=null&&(0,z.jsxs)(`div`,{className:`flex items-center gap-[10px]`,children:[(0,z.jsx)(F,{className:`size-[24px] text-muted-foreground`,"aria-hidden":!0}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-fpr-label leading-none font-semibold text-muted-foreground`,children:`Bedrooms`}),(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold text-foreground`,children:A(v.bedrooms)})]})]}),v.bathrooms!=null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`h-[28px] w-px bg-border`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-[10px]`,children:[(0,z.jsx)(m,{className:`size-[24px] text-muted-foreground`,"aria-hidden":!0}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-fpr-label leading-none font-semibold text-muted-foreground`,children:`Bathrooms`}),(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold text-foreground`,children:A(v.bathrooms)})]})]})]}),v.total_sqft!=null&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`h-[28px] w-px bg-border`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-[10px]`,children:[(0,z.jsx)(h,{className:`size-[24px] text-muted-foreground`,"aria-hidden":!0}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-fpr-label leading-none font-semibold text-muted-foreground`,children:`Square Feet`}),(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold text-foreground`,children:A(v.total_sqft)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-[24px]`,children:[T&&(0,z.jsxs)(`div`,{className:`hidden rounded-[12px] border-[1.5px] border-border bg-muted px-[20px] py-[10px] text-center shadow-[0_1px_3px_rgba(0,0,0,0.05)] sm:block`,children:[(0,z.jsx)(`p`,{className:`mb-[2px] text-fpr-label font-semibold tracking-wide text-foreground whitespace-nowrap`,children:`Total Renovation Estimate`}),(0,z.jsxs)(`p`,{className:`text-fpr-title leading-tight font-semibold tracking-tight text-foreground tabular-nums whitespace-nowrap`,children:[`$`,(E/1e3).toFixed(0),`k – $`,(D/1e3).toFixed(0),`k`]})]}),(0,z.jsxs)(`div`,{className:`flex gap-[8px]`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>g(e=>!e),"aria-label":p?`Exit fullscreen`:`Fullscreen`,className:`flex size-[40px] items-center justify-center rounded-[10px] bg-muted text-foreground transition-colors hover:bg-accent`,children:p?(0,z.jsx)(S,{className:`size-[18px]`}):(0,z.jsx)(x,{className:`size-[18px]`})}),(0,z.jsx)(u,{"aria-label":`Close`,className:`flex size-[40px] items-center justify-center rounded-[10px] bg-muted text-foreground transition-colors hover:bg-[var(--fpr-close-hover-bg)] hover:text-[var(--fpr-close-hover-fg)]`,children:(0,z.jsx)(s,{className:`size-[18px]`})})]})]})]})}),(0,z.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,z.jsxs)(`div`,{className:`mx-auto w-full max-w-[1600px] px-[24px] py-[32px] md:px-[40px] md:py-[40p
1x]`,children:[(0,z.jsx)(Ze,{address:v.address,lat:r,lng:f,totalSqft:v.total_sqft,renovationEstimate:v.renovation_cost_estimate,renovationLow:E,renovationHigh:D,confidenceScore:v.confidence_score,summary:T}),v.major_red_flags&&v.major_red_flags.length>0&&(0,z.jsx)($e,{flags:v.major_red_flags}),(0,z.jsxs)(`div`,{className:`overflow-hidden rounded-[16px] border border-border bg-card shadow-[0_4px_6px_-1px_rgb(0_0_0_/_0.1),0_2px_4px_-2px_rgb(0_0_0_/_0.1)]`,children:[y.length>0&&(0,z.jsx)(et,{title:`Living Areas & Rooms`,defaultOpen:!0,children:y.map((e,t)=>(0,z.jsx)(tt,{name:e.room_type,category:e.room_condition_category,low:e.room_total_low,high:e.room_total_high,elements:e.elements},`${e.room_type}-${t}`))}),C.length>0&&(0,z.jsx)(et,{title:`Systems & Exterior`,children:C.map((e,t)=>(0,z.jsx)(tt,{name:e.system_type,category:e.condition_category,low:e.system_total_low,high:e.system_total_high,elements:e.elements},`${e.system_type}-${t}`))}),w.length>0&&(0,z.jsx)(et,{title:`Non-Visible Areas (Estimated)`,children:w.map((e,t)=>(0,z.jsx)(tt,{name:e.area_type,category:e.condition_category,low:e.area_total_low,high:e.area_total_high,elements:e.elements},`${e.area_type}-${t}`))})]}),T&&(0,z.jsx)(at,{summary:T}),v.estimation_notes&&(0,z.jsxs)(`div`,{className:`mt-[24px] flex items-start gap-[12px] rounded-[16px] border border-[var(--fpr-notes-border)] bg-[var(--fpr-notes-bg)] p-[24px]`,children:[(0,z.jsx)(_,{className:`size-[20px] shrink-0 text-[var(--fpr-notes-fg)]`,"aria-hidden":!0}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-[6px] text-fpr-body font-semibold tracking-wide text-[var(--fpr-notes-fg)] uppercase`,children:`Estimation Notes`}),(0,z.jsx)(`p`,{className:`text-fpr-body leading-relaxed font-medium text-[var(--fpr-notes-body)]`,children:v.estimation_notes})]})]})]})})]})]})})}function Ze({address:e,lat:t,lng:n,totalSqft:r,renovationEstimate:i,renovationLow:a,renovationHigh:o,confidenceScore:s,summary:c}){let l=i??(a>0||o>0?(a+o)/2:null),u=l!=null&&r&&r>0?Math.round(l/r):null,d=c?.direct_renovation_costs_low,f=c?.direct_renovation_costs_high,p=c?.miscellaneous_low,m=c?.miscellaneous_high,h=c?.contingency_low,g=c?.contingency_high,_=e?`https://www.google.com/maps?q=${encodeURIComponent(e)}`:void 0,v=t!=null&&n!=null,y=(0,z.jsx)(`div`,{className:`flex h-full w-full items-center justify-center px-[24px] text-center text-fpr-body text-muted-foreground`,children:v?`Street View imagery isn’t available near this address.`:`No coordinates available for Street View.`});return(0,z.jsxs)(`div`,{className:`mb-[24px] grid grid-cols-1 gap-[24px] lg:grid-cols-[60%_40%] lg:gap-0`,children:[(0,z.jsxs)(`div`,{className:`relative h-[420px] overflow-hidden rounded-[12px] border border-border bg-muted lg:rounded-r-none`,children:[v?(0,z.jsx)(H,{lat:t,lng:n,fallback:y}):y,e&&(0,z.jsxs)(`div`,{className:`absolute top-[16px] left-[16px] z-10 max-w-[80%] rounded-[10px] bg-card/95 px-[14px] py-[10px] shadow-[0_4px_12px_rgba(0,0,0,0.15)] backdrop-blur-sm`,children:[(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold text-foreground`,children:O(e)}),_&&(0,z.jsx)(`a`,{href:_,target:`_blank`,rel:`noreferrer noopener`,className:`mt-[2px] inline-block text-fpr-label font-semibold text-[var(--fpr-brand-link)] hover:underline`,children:`View on Google Maps`})]})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-[20px] rounded-[16px] border border-border bg-card p-[28px] shadow-[0_4px_6px_-1px_rgb(0_0_0_/_0.1),0_2px_4px_-2px_rgb(0_0_0_/_0.1)] lg:rounded-l-none lg:border-l-0`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-[8px] text-fpr-label font-semibold tracking-wider text-muted-foreground uppercase`,children:`Estimated Renovation`}),(0,z.jsx)(`p`,{className:`mb-[12px] text-fpr-display leading-none font-semibold tracking-tight text-foreground tabular-nums`,children:l==null?`—`:j(l)}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[10px]`,children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center rounded-[8px] bg-accent px-[12px] py-[6px] text-fpr-body font-semibold text-foreground tabular-nums`,children:[u==null?`—`:j(u),(0,z.jsx)(`span`,{className:`ml-[4px] text-fpr-label font-semibold text-muted-foreground`,children:`/ sqft`})]}),s!=null&&(0,z.jsxs)(`span`,{className:`text-fpr-body font-semibold text-foreground`,children:[s,`% Confidence`]})]})]}),(0,z.jsx)(`div`,{className:`h-px w-full bg-border`}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-[12px] text-fpr-label font-semibold tracking-wider text-muted-foreground uppercase`,children:`Cost Breakdown`}),(0,z.jsxs)(`ul`,{className:`flex flex-col gap-[8px]`,children:[(0,z.jsx)(Qe,{label:`Direct Costs`,low:d,high:f}),(0,z.jsx)(Qe,{label:`Miscellaneous`,low:p,high:m}),(0,z.jsx)(Qe,{label:`Contingency`,low:h,high:g})]})]})]})]})}function Qe({label:e,low:t,high:n}){return(0,z.jsxs)(`li`,{className:`flex items-center justify-between rounded-[10px] bg-muted/60 px-[14px] py-[10px]`,children:[(0,z.jsx)(`span`,{className:`text-fpr-body font-semibold text-muted-foreground`,children:e}),(0,z.jsx)(`span`,{className:`text-fpr-body font-semibold text-foreground tabular-nums`,children:nt(t,n)})]})}function $e({flags:e}){let t=e.length!==1;return(0,z.jsxs)(`div`,{className:`mb-[24px] rounded-[16px] border border-red-200 bg-red-50 p-[24px] dark:border-red-900 dark:bg-red-950/20`,children:[(0,z.jsxs)(`div`,{className:`mb-[20px] flex items-start gap-[14px]`,children:[(0,z.jsx)(`div`,{className:`flex size-[44px] shrink-0 items-center justify-center rounded-[12px] bg-red-100 dark:bg-red-900/40`,children:(0,z.jsx)(_,{className:`size-[24px] text-red-600 dark:text-red-400`,"aria-hidden":!0})}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold tracking-wider text-red-600 uppercase dark:text-red-400`,children:`Critical Issues Identified`}),(0,z.jsxs)(`p`,{className:`text-fpr-body font-medium text-red-700 dark:text-red-300`,children:[e.length,` major red flag`,t?`s`:``,` require`,t?``:`s`,` attention`]})]})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-1 gap-[12px] md:grid-cols-3`,children:e.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex items-start gap-[10px] rounded-[10px] border border-red-100 bg-card p-[16px] dark:border-red-900/40`,children:[(0,z.jsx)(`span`,{className:`mt-[7px] size-[8px] shrink-0 rounded-full bg-red-600 dark:bg-red-500`,"aria-hidden":!0}),(0,z.jsx)(`p`,{className:`text-fpr-body leading-relaxed text-foreground`,children:e})]},`${t}-${e.slice(0,24)}`))})]})}function et({title:e,defaultOpen:t=!1,children:n}){let[r,i]=(0,I.useState)(t);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex w-full items-center justify-between gap-[12px] border-b border-[var(--fpr-accordion-border)] bg-[var(--fpr-accordion-bg)] px-[24px] py-[20px] text-left transition-colors hover:bg-[var(--fpr-accordion-hover)] md:px-[32px]`,children:[(0,z.jsx)(`span`,{className:`text-fpr-body font-semibold tracking-[0.08em] text-[var(--fpr-accordion-text)] uppercase`,children:e}),(0,z.jsx)(g,{className:d(`size-[20px] text-[var(--fpr-accordion-chevron)] transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),r&&(0,z.jsx)(`div`,{className:`flex flex-col`,children:n})]})}function tt({name:e,category:t,low:n,high:r,elements:i}){let[a,o]=(0,I.useState)(!1),s=i??[],c=n??0,l=r??0,u=(c+l)/2;return(0,z.jsxs)(`div`,{className:`border-b border-border last:border-b-0`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex w-full items-center justify-between gap-[16px] bg-card px-[24px] py-[20px] text-left transition-colors hover:bg-muted md:px-[40px]`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-[16px]`,children:[(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold text-foreground`,children:O(e)}),t&&(0,z.jsx)(rt,{condition:t})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-[16px] md:gap-[24px]`,children:[(0,z.jsxs)(`div`,{className:`hidden items-center gap-[20px] md:flex md:min-w-[380px]`,children:[(0,z.jsx)(`span`,{className:`min-w-[70px] text-right text-fpr-body font-semibold text-foreground tabular-nums`,children:j(c)}),(0,z.jsxs)(`div`,{className:`relative min-w-[140px] flex-1`,children:[(0,z.jsx)(`div`,{className:`h-[8px] w-full rounded-[4px] bg-border`}),(0,z.jsx)(`div`,{className:`absolute top-0 left-0 h-[8px] w-full rounded-[4px] bg-[var(--fpr-brand)]/[0.7]`}),(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center`,children:(0,z.jsx)(`span`,{className:`relative -top-[16px] rounded-[4px] border-[1.5px] border-[var(--fpr-brand)] bg-card px-[8px] py-[2px] text-fpr-label font-semibold whitespace-nowrap text-[var(--fpr-brand-deep-text)] shadow-[0_1px_3px_rgba(0,0,0,0.1)] tabular-nums`,children:j(u)})})]}),(0,z.jsx)(`span`,{className:`min-w-[70px] text-left text-fpr-body font-semibold text-foreground tabular-nums`,children:j(l)})]}),(0,z.jsxs)(`span`,{className:`text-fpr-body font-semibold tracking-tight text-foreground tabular-nums md:hidden`,children:[j(c),` – `,j(l)]}),(0,z.jsx)(`div`,{className:d(`flex size-[36px] items-center justify-center rounded-[8px] bg-muted transition-transform`,a&&`rotate-180`),children:(0,z.jsx)(g,{className:`size-[20px] text-muted-foreground`,"aria-hidden":!0})})]})]}),a&&s.length>0&&(0,z.jsx)(`div`,{className:`border-t border-border bg-muted`,children:(0,z.jsx)(`div`,{className:`overflow-x-auto`,children:(0,z.jsxs)(`table`,{className:`w-full min-w-[400px] border-collapse`,children:[(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`bg-muted`,children:[(0,z.jsx)(`th`,{className:`px-[24px] py-[12px] text-left text-fpr-label font-semibold tracking-[0.05em] text-muted-foreground uppercase md:px-[40px]`,children:`Item / Action`}),(0,z.jsx)(`th`,{className:`w-[450px] px-[24px] py-[12px] text-right text-fpr-label font-semibold tracking-[0.05em] text-muted-foreground uppercase md:px-[40px]`,children:`Cost`})]})}),(0,z.jsx)(`tbody`,{children:s.map((e,t)=>(0,z.jsxs)(`tr`,{className:`border-t border-border hover:bg-card/50`,children:[(0,z.jsxs)(`td`,{className:`px-[24px] py-[16px] md:px-[40px]`,children:[(0,z.jsx)(`p`,{className:`mb-[4px] text-fpr-body font-semibold text-foreground`,children:O(e.element_name)}),e.action_required&&(0,z.jsx)(`p`,{className:`text-fpr-body text-muted-foreground`,children:O(e.action_required)})]}),(0,z.jsx)(`td`,{className:`px-[24px] py-[16px] text-right text-fpr-body font-semibold text-foreground tabular-nums md:px-[40px]`,children:nt(e.cost_low,e.cost_high)})]},`${e.element_name}-${t}`))})]})})})]})}function nt(e,t){return e==null&&t==null?`—`:e!=null&&t!=null&&e!==t?`${j(e)} – ${j(t)}`:j(e??t)}function rt({condition:e}){let t=it(e);return(0,z.jsx)(`span`,{className:`inline-flex items-center rounded-[8px] border px-[12px] py-[4px] text-fpr-label font-semibold tracking-wide uppercase`,style:{backgroundColor:t.bg,color:t.color,borderColor:t.border},children:e})}function it(e){let t=e?.toLowerCase()??``;return t.includes(`excellent`)?{bg:`var(--fpr-tone-ok-bg)`,color:`var(--fpr-tone-ok-fg)`,border:`var(--fpr-tone-ok-border)`}:t.includes(`good`)?{bg:`var(--fpr-tone-good-bg)`,color:`var(--fpr-tone-good-fg)`,border:`var(--fpr-tone-good-border)`}:t.includes(`outdated`)||t.includes(`fair`)?{bg:`var(--fpr-tone-warn-bg)`,color:`var(--fpr-tone-warn-fg)`,border:`var(--fpr-tone-warn-border)`}:t.includes(`very poor`)?{bg:`var(--fpr-tone-pink-bg)`,color:`var(--fpr-tone-pink-fg)`,border:`var(--fpr-tone-pink-border)`}:t.includes(`poor`)?{bg:`var(--fpr-tone-bad-bg)`,color:`var(--fpr-tone-bad-fg)`,border:`var(--fpr-tone-bad-border)`}:{bg:`var(--fpr-tone-slate-bg)`,color:`var(--fpr-tone-slate-fg)`,border:`var(--fpr-tone-slate-border-soft)`}}function at({summary:e}){let t=[{label:`Direct Renovation Costs`,low:e.direct_renovation_costs_low,high:e.direct_renovation_costs_high},{label:`Miscellaneous`,low:e.miscellaneous_low,high:e.miscellaneous_high,muted:!0}
1,{label:`Contingency`,low:e.contingency_low,high:e.contingency_high,muted:!0}];return(0,z.jsxs)(`div`,{className:`mt-[32px] overflow-hidden rounded-[16px] border border-border bg-card shadow-[0_4px_6px_-1px_rgb(0_0_0_/_0.1),0_2px_4px_-2px_rgb(0_0_0_/_0.1)]`,children:[(0,z.jsx)(`div`,{className:`border-b-2 border-[var(--fpr-brand-divider)] bg-muted px-[32px] py-[20px]`,children:(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold tracking-[0.06em] text-[var(--fpr-brand-link)] uppercase`,children:`Cost Summary`})}),t.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-[32px] py-[16px]`,children:[(0,z.jsx)(`p`,{className:d(`text-fpr-body`,e.muted?`font-medium text-muted-foreground`:`font-semibold text-foreground`),children:e.label}),(0,z.jsx)(`p`,{className:d(`text-fpr-body tabular-nums`,e.muted?`font-semibold text-muted-foreground`:`font-semibold text-foreground`),children:nt(e.low,e.high)})]},e.label)),(0,z.jsxs)(`div`,{className:`flex items-center justify-between bg-primary px-[32px] py-[24px] shadow-[0_4px_12px_rgba(81,119,252,0.2)]`,children:[(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold tracking-[0.05em] text-primary-foreground uppercase`,children:`Grand Total`}),(0,z.jsx)(`p`,{className:`text-fpr-body font-semibold tracking-tight text-primary-foreground tabular-nums`,children:nt(e.grand_total_low,e.grand_total_high)})]})]})}export{Ee as a,xe as c,me as d,pe as f,ee as g,R as h,Ce as i,ye as l,H as m,We as n,Te as o,ae as p,we as r,De as s,Xe as t,he as u};
2//# sourceMappingURL=RenovationDetailsDialog-DaFlzrEk.js.map

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.