PageSourceSearch

https://civ.quest/assets/ParcelInsightsModal-Cgt3z4an.js

js civ.quest collected 2026-10-04 05:51:10 UTC 5,687 bytes, 1 lines download raw bytes

1import{r as m,j as e}from"./react-vendor-BW9Nu_5l.js";import{P as v}from"./index-Bmz4n68Q.js";import{a as N}from"./geometry-DSbKbAFs.js";import{fd as k,n as j,X as E,L as C,q as I,b3 as L,U as P,aU as S,b6 as M,bk as U,b5 as z}from"./SSOProviderLogo-Cf_Gn5rN.js";import{M as T}from"./minimize-2-BDX3WVME.js";import{M as A}from"./maximize-2-nQjJPp3J.js";import{C as D}from"./check-circle-2-Dh4F8Svi.js";import"./vite-helpers-mg6Z-sIv.js";import"./firebase-C4P3A27n.js";import"./single-org-5b_TQwao.js";const R={waves:z,landmark:U,droplets:M,"land-plot":S,users:P,mountain:L};function _(a){return R[a]||j}function Q({isOpen:a,onClose:x,feature:o,enabledSourceKeys:u=[],title:b="Parcel Insights",themeColor:f="#0ea5e9",buttonColor:p}){const[n,g]=m.useState(!1),[y,c]=m.useState({}),d=v.filter(s=>u.includes(s.key));if(m.useEffect(()=>{if(!a||!(o!=null&&o.geometry)||d.length===0){c({});return}let s=!1;return c(Object.fromEntries(d.map(t=>[t.key,{status:"loading"}]))),N(o.geometry).then(t=>{s||!t||d.forEach(i=>{i.query(t).then(l=>{s||c(r=>({...r,[i.key]:{status:"done",items:l}}))}).catch(l=>{s||(console.warn(`[ParcelInsights] ${i.key} query failed:`,l),c(r=>({...r,[i.key]:{status:"error",error:l}})))})})}).catch(t=>{s||(console.warn("[ParcelInsights] Geometry projection failed:",t),c(Object.fromEntries(d.map(i=>[i.key,{status:"error",error:t}]))))}),()=>{s=!0}},[a,o,u.join(",")]),m.useEffect(()=>{const s=t=>{t.key==="Escape"&&a&&x()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[a,x]),m.useEffect(()=>(a?document.body.style.overflow="hidden":(document.body.style.overflow="",g(!1)),()=>{document.body.style.overflow=""}),[a]),!a)return null;const h=k(f)&&p?p:f;return e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"parcel-insights-title",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:x,"aria-hidden":"true"}),e.jsxs("div",{className:`relative bg-white shadow-2xl flex flex-col overflow-hidden animate-in fade-in zoom-in-95 duration-200 ${n?"rounded-none":"rounded-xl"}`,style:{width:n?"100vw":"min(680px, 94vw)",height:n?"100dvh":"min(78vh, 860px)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0",style:{backgroundColor:h},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(j,{className:"w-5 h-5 text-white flex-shrink-0","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{id:"parcel-insights-title",className:"text-base font-semibold text-white truncate max-w-md",children:"Parcel Insights"}),e.jsx("p",{className:"text-xs text-white/70 truncate",children:b})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>g(s=>!s),className:"p-2 rounded-lg hover:bg-white/20 transition-colors","aria-label":n?"Exit fullscreen":"Enter fullscreen","aria-pressed":n,children:n?e.jsx(T,{className:"w-5 h-5 text-white","aria-hidden":"true"}):e.jsx(A,{className:"w-5 h-5 text-white","aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:x,className:"p-2 rounded-lg hover:bg-white/20 transition-colors","aria-label":"Close Parcel Insights",children:e.jsx(E,{className:"w-5 h-5 text-white","aria-hidden":"true"})})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto bg-slate-50 p-4 space-y-3",children:[d.map(s=>{var l;const t=y[s.key]||{status:"loading"},i=_(s.icon);return e.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2.5 border-b border-slate-100",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${h}15`},children:e.jsx(i,{className:"w-4 h-4",style:{color:h},"aria-hidden":"true"})}),e.jsx("h3",{className:"text-sm font-semibold text-slate-800 flex-1",children:s.name}),t.status==="loading"&&e.jsx(C,{className:"w-4 h-4 animate-spin text-slate-400","aria-label":"Loading"})]}),e.jsxs("div",{className:"px-4 py-3",children:[t.status==="loading"&&e.jsxs("p",{className:"text-xs text-slate-400",children:["Checking ",s.name.toLowerCase(),"…"]}),t.status==="error"&&e.jsxs("div",{className:"flex items-center gap-2 text-amber-600",children:[e.jsx(I,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"}),e.jsx("p",{className:"text-xs",children:"This source is currently unavailable. Try again later."})]}),t.status==="done"&&(!t.items||t.items.length===0)&&e.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[e.jsx(D,{className:"w-4 h-4 flex-shrink-0 text-green-500","aria-hidden":"true"}),e.jsx("p",{className:"text-xs",children:s.emptyMessage||"Nothing found at this location."})]}
1),t.status==="done"&&((l=t.items)==null?void 0:l.length)>0&&e.jsx("ul",{className:"space-y-1.5",children:t.items.map((r,w)=>e.jsxs("li",{className:"flex items-baseline justify-between gap-3 text-sm",children:[e.jsx("span",{className:"font-medium text-slate-700",children:r.label}),r.value&&e.jsx("span",{className:"text-slate-500 text-xs text-right",children:r.value})]},w))})]}),e.jsx("div",{className:"px-4 pb-2.5",children:e.jsxs("p",{className:"text-[10px] text-slate-400",children:["Source: ",s.attribution]})})]},s.key)}),e.jsx("p",{className:"text-[10px] text-slate-400 px-1 pt-1",children:"Data is retrieved live from public federal and state services and is informational only — confirm regulatory determinations (flood zones, wetlands, historic status) with the issuing agency."})]})]})]})}export{Q 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.