1import{_ as ne,w as u,aE as ae,x as L,v as e,z as R,B as M,a2 as ie,ay as ce,aR as W,a3 as O,bG as le,C as de,cJ as me,D as ue,E as pe,F as fe,G as he,J as xe,bN as ge,K as ye,b as be,y as je,Y as Ce}from"./index-QqAfTWgn.js";import{F as Ne}from"./FieldbookMap-Dy7Fwu8M.js";import{T as _e}from"./TecPecLayer-Tc3M72oK.js";import{p as we}from"./parseShapefile-D9LSXRPs.js";import{u as Ee}from"./index-DcA_68i7.js";import{C as P}from"./card-C3_RA3DU.js";import{R as De,l as Se,g as ve}from"./zipShapefile-D6vUjHtQ.js";import{U as G}from"./upload-OLNSNMzK.js";import{F as Te}from"./file-archive-t7toaTyM.js";import{C as X}from"./circle-alert-ld5V0CB2.js";import{b as Ae,a as Pe,c as Me,d as Ie}from"./useReferenceData-DqRDw1qn.js";import{b as Le}from"./index-CxQrGTPe.js";import{T as ze,a as Be,b as k,c as F}from"./tabs-wP6BdUvc.js";import{L as Oe}from"./layers-BzRXWPWX.js";import{M as $e}from"./map-CkYrN_sr.js";import{L as ke}from"./list-qsV9Wotl.js";import{L as B}from"./loader-circle-CVQbnz9f.js";import{D as Fe}from"./database-Dos98ZPr.js";import{T as Ue}from"./trash-2-DsBIxsBk.js";import{C as Ge}from"./circle-check-big-CZzW0IHJ.js";import"./mapbox-gl-BBt_c3Qx.js";import"./useViewState-shOYv1Ip.js";import"./getViewState-mls5Yedy.js";import"./useFeatureHover-CJFrHmEY.js";import"./layer-CsjPYh03.js";import"./jszip.min-BEc87SH7.js";import"./jszip.min-DfcIk5j5.js";import"./_commonjs-dynamic-modules-CFlRrD3L.js";try{let s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="8f8b6023-2017-48d7-8bbd-bebf6d3c02a3",s._sentryDebugIdIdentifier="sentry-dbid-8f8b6023-2017-48d7-8bbd-bebf6d3c02a3")}catch{}const U=5e3,Re=["OCC_UNIQUE","COM_ID","COM_NAME","STATE_CATG","BDY_ID"],J={OCC_NUM:"OCC_UNIQUE",COMMU_ID:"COM_ID",COMMU_NAME:"COM_NAME",WACONSCODE:"STATE_CATG",COMWLTH_CS:"COMM_CATG",GEOM_ID:"BDY_ID",BUFF_VALUE:"BUFFER"},Ye=new Map(Object.entries(J).map(([s,t])=>[t,s])),Ze=new Map([["occurrence geometry","boundary"],["buffer geometry","buffer"]]);function $(s){var t;return s.kind==="zip"?s.group?(s.group.split("/").pop()??s.group).replace(/\.[^.]+$/,""):s.file.name.replace(/\.zip$/i,""):((t=s.components.shp)==null?void 0:t.name.replace(/\.shp$/i,""))??"TEC/PEC product"}const qe=/(?:^|[^a-z0-9])\d+(?:\.\d+)?\s*(?:m|km)(?:$|[^a-z0-9])/;function Ve(s){if(!s)return null;const t=$(s).toLowerCase(),o=t.includes("buffer")||qe.test(t),n=t.includes("boundar");return o===n?null:o?"buffer":"boundary"}function Z(s){if(s.length<1||s.length>2)throw new Error("Select one or two TEC/PEC shapefile products");const t=s.map(o=>({source:o,role:Ve(o)}));return ee(t),t}function Qe(s){if(s.kind==="zip")return{zip:s.file,zipGroup:s.group};if(!s.components.shp)throw new Error("Missing required .shp component");return{components:{shp:s.components.shp,shx:s.components.shx??null,dbf:s.components.dbf??null,prj:s.components.prj??null}}}function E(s,t){const o=Object.keys(s).find(n=>n.toUpperCase()===t);return o?s[o]:void 0}function Ke(s){const t={...s};for(const[o,n]of Object.entries(J)){const i=E(s,o);i!==void 0&&E(s,n)===void 0&&(t[n]=i)}return t}function z(s){return s==null?"":String(s).trim()}function He(s){if(s==null||s==="")return null;const t=Number(s);return Number.isFinite(t)?t:null}function We(s,t,o,n){if(s.geometry.type!=="Polygon"&&s.geometry.type!=="MultiPolygon")throw new Error(`${n} feature ${o+1} is ${s.geometry.type}; TEC/PEC imports require Polygon or MultiPolygon geometry`);const i=s.properties??{},c=E(i,"OCC_NUM")!==void 0||E(i,"COMMU_ID")!==void 0,f=c?Ke(i):i;let a=t;if(c){const m=z(E(f,"G_DATATYPE")).toLowerCase(),g=Ze.get(m)??null;if(g&&t&&g!==t)throw new Error(`${n} was read as the ${t} product from its filename, but its G_DATATYPE says ${z(E(f,"G_DATATYPE"))}. Rename it to include ${g==="buffer"?'"buffer"':'"boundaries"'} and drop it again.`);a??(a=g)}const b=Re.filter(m=>E(f,m)===void 0),x=E(f,"BUFFER");if(a==="buffer"&&(x==null||x==="")&&b.push("BUFFER"),b.length>0){const m=c?b.map(g=>Ye.get(g)??g):b;throw new Error(`${n} is missing required DBCA attribute${m.length===1?"":"s"}: ${m.join(", ")}`)}const j=z(E(f,"COM_ID")),h=z(E(f,"COM_NAME"));if(!h&&!j)throw new Error(`${n} feature ${o+1} has neither COM_NAME nor COM_ID`);const l=a==="buffer"?He(x):null,r={...f,geometry_role:a,buffer_distance_m:l};return{id:crypto.randomUUID(),label:h||j,class_code:j,geometry:s.geometry,properties:r}}function ee(s){if(s.length<1||s.length>
12)throw new Error("Select one or two TEC/PEC shapefile products");const t=s.flatMap(o=>o.role?[o.role]:[]);if(new Set(t).size!==t.length)throw new Error("The two TEC/PEC products must be one boundary and one buffered product")}const q=50;async function Xe(s){const t=$(s.source),o=await we(Qe(s.source),U+1);if(!o.sourceCrsResolved)throw new Error(`${t} needs a .prj file with a recognised coordinate reference system`);const n=[];for await(const i of o.features)n.push(i);if(n.length>U)throw new Error(`${t} contains more than ${U.toLocaleString()} features; split the product before importing`);if(n.length===0)throw new Error(`${t} contains no polygon features`);return{sourceSrid:o.sourceSrid,name:t,features:n.map((i,c)=>We(i,s.role,c,t))}}function Je(s){const t=ne(),[o,n]=u.useState({stage:"idle",imported:0,total:0});return{...ae({mutationFn:async c=>{ee(c),n({stage:"validating",imported:0,total:0});const f=await Promise.all(c.map(Xe)),a=f.reduce((l,r)=>l+r.features.length,0);n({stage:"importing",imported:0,total:a});const b=f.map(l=>l.name).join(" + ").slice(0,255),{data:x,error:j}=await L.from("context_source").insert({project_id:s,kind:"dbca_tec_pec",source_filename:b,source_org_name:"Department of Biodiversity, Conservation and Attractions",feature_count:0,species_count:0}).select("id").single();if(j||!x)throw new Error(`Failed to create TEC/PEC context source: ${(j==null?void 0:j.message)??"No row returned"}`);let h=0;try{for(const r of f)for(let m=0;m<r.features.length;m+=q){const g=r.features.slice(m,m+q),{data:_,error:w}=await L.rpc("import_context_areas",{p_project_id:s,p_context_source_id:x.id,p_source_srid:r.sourceSrid,p_features:g});if(w)throw new Error(`Failed to import ${r.name}: ${w.message}`);h+=(_==null?void 0:_.length)??0,n({stage:"importing",imported:h,total:a})}const{error:l}=await L.from("context_source").update({feature_count:h}).eq("id",x.id);if(l)throw new Error(`Failed to finalise TEC/PEC source: ${l.message}`)}catch(l){const{error:r}=await L.from("context_source").delete().eq("id",x.id),m=l instanceof Error?l.message:String(l);throw new Error(r?`${m}. Partial-import cleanup also failed: ${r.message}`:m)}return n({stage:"complete",imported:h,total:a}),{contextSourceId:x.id,featureCount:h}},onSuccess:()=>{t.invalidateQueries({queryKey:["contextData",s]})}}),progress:o}}const es=new Set(["shp","shx","dbf","prj","cpg"]);function ss(){return{shp:null,shx:null,dbf:null,prj:null,cpg:null}}function ts(s){const t=new Map;for(const o of s){const n=o.name.toLowerCase().match(/^(.*)\.([^.]+)$/);if(!n||!es.has(n[2]))continue;const i=n[1],c=t.get(i)??{key:i,components:ss()};c.components[n[2]]=o,t.set(i,c)}return[...t.values()]}function V(s){return De.filter(t=>!s[t]).map(t=>`.${t}`)}function rs(s){return{kind:"components",components:s.components}}function os({onChange:s,disabled:t}){const[o,n]=u.useState(null),[i,c]=u.useState([]),[f,a]=u.useState([]),[b,x]=u.useState(null),[j,h]=u.useState(!1),l=u.useMemo(()=>ts(f),[f]),r=u.useMemo(()=>{if(o){const y=i.map(C=>({kind:"zip",file:o,group:C}));try{return{products:Z(y),error:null}}catch(C){return{products:[],error:C instanceof Error?C.message:String(C)}}}const d=l.find(y=>V(y.components).length>0);if(d)return{products:[],error:`${d.key} is missing required shapefile components: ${V(d.components).join(", ")}`};try{return{products:Z(l.map(rs)),error:null}}catch(y){return{products:[],error:y instanceof Error?y.message:String(y)}}},[l,o,i]);u.useEffect(()=>{s(r.products)},[s,r.products]);const m=u.useCallback(async d=>{if(d.length!==0){h(!0),x(null);try{const y=d.find(C=>C.name.toLowerCase().endsWith(".zip"));if(y){if(d.length!==1){x("Drop either one DBCA ZIP or loose shapefile files");return}n(null),c([]),a([]);const C=await Se(y),D=ve(Object.values(C.files));if(D.length<1||D.length>2){x("DBCA Communities ZIP must contain one or two complete shapefile component sets (.shp, .shx, .dbf)");return}n(y),c(D.map(([N])=>N)),a([]);return}n(null),c([]),a(C=>{const D=new Map(C.map(N=>[N.name.toLowerCase(),N]));for(const N of d)D.set(N.name.toLowerCase(),N);return[...D.values()]})}
1catch{x("Could not read the DBCA Communities ZIP file")}finally{h(!1)}}},[]),g=u.useCallback(()=>{n(null),c([]),a([]),x(null)},[]),_=u.useCallback(d=>{if(o===d){g();return}a(y=>y.filter(C=>C!==d))},[g,o]),w=o?[o]:f,A=b??(w.length>0?r.error:null),{getRootProps:T,getInputProps:v,isDragActive:I}=Ee({onDrop:m,accept:{"application/zip":[".zip"],"application/x-zip-compressed":[".zip"],"application/x-esri-shape":[".shp"],"application/x-esri-shape-index":[".shx"],"application/x-dbf":[".dbf"],"text/plain":[".prj",".cpg"]},multiple:!0,disabled:t||j});return e.jsxs(P,{className:"space-y-4 p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium",children:"DBCA Communities products"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Upload the DBCA delivery ZIP, or drop the loose files for one or two products. Product roles are read from filenames: the boundary product from ",e.jsx("code",{children:"_boundaries"}),", the buffered one from"," ",e.jsx("code",{children:"_buffer"})," or its radius, such as ",e.jsx("code",{children:"_50km"})," or"," ",e.jsx("code",{children:"_2km"}),". A product whose filename says neither is imported without a role."]})]}),e.jsxs("div",{...T(),className:R("cursor-pointer rounded-lg border-2 border-dashed p-5 text-center transition-colors",I?"border-primary bg-primary/10":"border-gray-300 hover:border-gray-400",(t||j)&&"cursor-wait opacity-60"),children:[e.jsx("input",{...v()}),e.jsx(G,{className:"mx-auto mb-2 size-6 text-gray-400"}),e.jsx("p",{className:"text-sm text-gray-600",children:I?"Drop the DBCA data hereâ¦":"Drop a ZIP or loose shapefile files here, or click to browse"})]}),w.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-sm font-medium",children:[w.length," file",w.length===1?"":"s"," selected"]}),!t&&e.jsx(M,{variant:"ghost",size:"sm",onClick:g,children:"Clear"})]}),e.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:w.map(d=>e.jsxs("div",{className:"bg-secondary-background flex items-center justify-between rounded border p-2 text-sm",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.name.toLowerCase().endsWith(".zip")?e.jsx(Te,{className:"size-4 shrink-0"}):e.jsx(ie,{className:"size-4 shrink-0"}),e.jsx("span",{className:"truncate",children:d.name})]}),!t&&e.jsx(M,{variant:"ghost",size:"sm",className:"size-6 p-0 text-red-600",onClick:()=>_(d),children:e.jsx(ce,{className:"size-3"})})]},`${d.name}-${d.size}`))}),r.products.length>0&&e.jsxs("div",{className:"space-y-1 rounded border p-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Detected products"}),r.products.map(d=>{const y=W(d.role);return e.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[e.jsx("span",{className:"truncate",children:$(d.source)}),y&&e.jsx(O,{variant:d.role?"secondary":"outline",children:y})]},$(d.source))})]})]}),A&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-red-200 bg-red-50 p-2 text-xs text-red-700",children:[e.jsx(X,{className:"size-4 shrink-0"}),A]})]})}function Q(s){return String(s??"").replace(/\s+/g," ").trim().toLocaleLowerCase("en-AU")}function ns(s){const t=new Map;for(const o of s){const n=o.community_identifier.trim(),i=t.get(n);i?i.push(o):t.set(n,[o])}return t}function K(s,t){const o=String(s.COM_ID??"").trim();if(!o)return[];const n=t.get(o)??[];if(n.length===0)return[];const i=Q(s.COM_NAME),c=i?n.filter(a=>Q(a.community_name)===i):[],f=c.length>0?c:n;return[...new Set(f.map(a=>{var b;return(b=a.summary_description)==null?void 0:b.trim()}).filter(a=>!!a))]}function as(){const{project:s}=le(),t=s.id,{data:o,isLoading:n}=Ae(t),i=u.useMemo(()=>(o??[]).filter(p=>p.kind==="dbca_tec_pec"),[o]),{data:c}=Pe(t),f=Me(),a=Je(t),[b,x]=u.useState([]),[j,h]=u.useState(0),[l,r]=u.useState("upload"),[m,g]=u.useState(!0),[_,w]=u.useState(!0),[A,T]=u.useState(null),v=u.useMemo(()=>(c==null?void 0:c.features)??[],[c]),I=u.useMemo(()=>v.flatMap(p=>{var Y;const S=String(((Y=p.properties)==null?void 0:Y.COM_ID)??"").trim();return S?[S]:[]}),[v]),{data:d=[],isLoading:y,error:C}=Ie(I),D=u.useMemo(()=>ns(d),[d]),N=v.length>0,te=b.length>0&&!a.isPending,re=async()=>
1{if(b.length!==0){T(null);try{const p=await a.mutateAsync(b);je(`Imported ${p.featureCount} TEC/PEC polygons`),x([]),h(S=>S+1),r("map")}catch(p){T(p instanceof Error?p.message:String(p))}}},oe=async p=>{T(null);try{await f.mutateAsync({contextSourceId:p.id,projectId:t})}catch(S){T(S instanceof Error?S.message:String(S))}};return e.jsxs("div",{className:"w-full space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Oe,{className:"size-6"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"DBCA Communities"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Threatened and Priority Ecological Community boundaries and buffered areas"})]})]}),e.jsxs(ze,{value:l,onValueChange:r,children:[e.jsxs(Be,{children:[e.jsxs(k,{value:"upload",className:"gap-2",children:[e.jsx(G,{className:"size-4"}),"Upload"]}),e.jsxs(k,{value:"map",className:"gap-2",disabled:!N,children:[e.jsx($e,{className:"size-4"}),"Map",N&&e.jsx(O,{variant:"secondary",children:v.length})]}),e.jsxs(k,{value:"communities",className:"gap-2",disabled:!N,children:[e.jsx(ke,{className:"size-4"}),"Communities"]})]}),e.jsxs(F,{value:"upload",className:"space-y-6",children:[A&&e.jsx(se,{children:A}),e.jsxs(P,{className:"space-y-5 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Upload DBCA TEC/PEC Communities data"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Upload the DBCA delivery ZIP, or the loose files for one or two products. Product roles are read from their filenames where they say, and the products are stored together as one context source."})]}),e.jsx("div",{children:e.jsx(os,{onChange:x,disabled:a.isPending})},j),a.isPending&&e.jsx("div",{className:"rounded-md border p-3 text-sm",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"size-4 animate-spin"}),a.progress.stage==="validating"?"Validating detected shapefile productsâ¦":`Imported ${a.progress.imported.toLocaleString()} of ${a.progress.total.toLocaleString()} polygonsâ¦`]})}),e.jsxs(M,{className:"w-full",onClick:re,disabled:!te,children:[a.isPending?e.jsx(B,{className:"mr-2 size-4 animate-spin"}):e.jsx(G,{className:"mr-2 size-4"}),"Import detected Communities products"]})]}),e.jsxs(P,{className:"p-6",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Context Sources"}),e.jsx("p",{className:"text-muted-foreground mb-4 text-sm",children:"Previously imported DBCA Communities deliveries"}),n?e.jsx(B,{className:"mx-auto my-8 size-6 animate-spin"}):i.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"No Communities data imported yet."}):e.jsx("div",{className:"space-y-3",children:i.map(p=>e.jsxs("div",{className:"bg-secondary-background flex items-center justify-between gap-4 rounded-lg border p-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"size-4 shrink-0"}),e.jsx("span",{className:"truncate font-medium",children:p.source_filename||"DBCA Communities"}),e.jsx(O,{variant:"secondary",children:"Communities"})]}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[p.feature_count.toLocaleString()," polygons",p.created_at&&` ⢠Uploaded ${new Date(p.created_at).toLocaleDateString("en-AU")}`]})]}),e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(M,{variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",children:e.jsx(Ue,{className:"size-4"})})}),e.jsxs(ue,{children:[e.jsxs(pe,{children:[e.jsx(fe,{children:"Delete TEC/PEC source?"}),e.jsxs(he,{children:["This removes all"," ",p.feature_count.toLocaleString()," boundary and buffered polygons in the source. This action cannot be undone."]})]}),e.jsxs(xe,{children:[e.jsx(ge,{children:"Cancel"}),e.jsx(ye,{onClick:()=>oe(p),className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})]})]},p.id))})]})]}),e.jsxs(F,{value:"map",className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground mr-2 text-sm",children:"Visible products:"}),e.jsx(H,{active:m,onClick:()=>g(p=>!p),swatch:"bg-violet-600",children:"Boundaries"}),e.jsx(H,{active:_,onClick:()=>w(p=>!p),swatch:"bg-orange-500",children:"Buffered areas"})]}),e.jsx(P,{className:"h-[600px] overflow-hidden p-0",children:N&&e.jsx(Ne,{geoJSON:Le(be(c)),dataSourceId:"tec-pec-preview",className:"h-full",children:e.jsx(_e,{geoJSON:c,showBoundaries:m,showBuffers:_})})})]}),e.jsx(F,{value:"communities",children:e.jsx(P,{className:"p-6",children:e.jsx(is,{features:v,communityLookup:D,isLoadingDescriptions:y,descriptionsError:C})})})]})]})}function se({children:s}){return e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:[e.jsx(X,{className:"size-4 shrink-0"}),e.jsx("span",{children:s})]})}function H({active:s,onClick:t,swatch:o,children:n}){return e.jsxs(M,{variant:s?"secondary":"outline",size:"sm",onClick:t,className:s?void 0:"opacity-60",children:[e.jsx("span",{className:R("mr-2 size-3 rounded-sm",o)}),s?e.jsx(Ge,{className:"mr-1 size-3"}):null,n]})}function is({features:s,communityLookup:t,isLoadingDescriptions:o,descriptionsError:n}){const[i,c]=u.useState(""),f=u.useMemo(()=>{const h=i.trim().toLowerCase();return h?s.filter(l=>{const r=l.properties;return[r.label,r.class_code,r.COM_NAME,r.COM_ID,r.STATE_CATG,r.BDY_ID,...K(r,t)].some(m=>String(m??"").toLowerCase().includes(h))}):s},[t,s,i]),a=h=>s.filter(l=>{var r;return(((r=l.properties)==null?void 0:r.geometry_role)??null)===h}).length,b=a("boundary"),x=a("buffer"),j=a(null);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Ecological communities"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.length.toLocaleStr
1ing()," polygons â¢"," ",b.toLocaleString()," boundaries â¢"," ",x.toLocaleString()," buffered areas",j>0&&` ⢠${j.toLocaleString()} without a role`]})]}),e.jsx(Ce,{className:"w-72",placeholder:"Search communities, IDs or descriptionsâ¦",value:i,onChange:h=>c(h.target.value)})]}),n&&e.jsxs(se,{children:["Detailed DBCA descriptions could not be loaded:"," ",n.message]}),e.jsxs("div",{className:"max-h-[600px] overflow-auto",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-secondary sticky top-0",children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Community"}),e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Summary description"}),e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Role"}),e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Category"}),e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Buffer"}),e.jsx("th",{className:"px-3 py-2 text-left text-sm font-medium",children:"Boundary ID"})]})}),e.jsx("tbody",{children:f.map((h,l)=>{const r=h.properties,m=K(r,t),g=W(r.geometry_role);return e.jsxs("tr",{className:R("border-b",l%2===0&&"bg-muted/10"),children:[e.jsxs("td",{className:"max-w-lg px-3 py-2 text-sm",children:[e.jsx("div",{className:"font-medium",children:r.label||r.COM_NAME||r.COM_ID}),r.class_code&&r.class_code!==r.label&&e.jsx("div",{className:"text-muted-foreground text-xs",children:r.class_code})]}),e.jsx("td",{className:"text-muted-foreground max-w-2xl px-3 py-2 align-top text-sm",children:o?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(B,{className:"size-3 animate-spin"}),"Loadingâ¦"]}):m.length>0?e.jsx("div",{className:"space-y-2 whitespace-pre-line",children:m.map(_=>e.jsx("p",{children:_},_))}):"â"}),e.jsx("td",{className:"px-3 py-2",children:g&&e.jsx(O,{variant:"secondary",children:g})}),e.jsx("td",{className:"px-3 py-2 text-sm",children:r.STATE_CATG||r.COMM_CATG||"â"}),e.jsx("td",{className:"px-3 py-2 text-sm",children:r.buffer_distance_m==null?"â":`${r.buffer_distance_m.toLocaleString()} m`}),e.jsx("td",{className:"px-3 py-2 text-sm",children:String(r.BDY_ID??"â")})]},r.context_area_id??`${r.geometry_role}-${r.BDY_ID}-${l}`)})})]}),f.length===0&&e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"No communities match your search."})]})]})}const Bs=as;export{Bs as component}; 2//# sourceMappingURL=dbca-communities-CdqOhOQq.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.