var Xt=Object.defineProperty,Zt=Object.defineProperties;var Jt=Object.getOwnPropertyDescriptors;var Je=Object.getOwnPropertySymbols;var en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;var et=(l,i,r)=>i in l?Xt(l,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[i]=r,C=(l,i)=>{for(var r in i||(i={}))en.call(i,r)&&et(l,r,i[r]);if(Je)for(var r of Je(i))tn.call(i,r)&&et(l,r,i[r]);return l},I=(l,i)=>Zt(l,Jt(i));var R=(l,i,r)=>new Promise((p,k)=>{var f=y=>{try{w(r.next(y))}catch(F){k(F)}},o=y=>{try{w(r.throw(y))}catch(F){k(F)}},w=y=>y.done?p(y.value):Promise.resolve(y.value).then(f,o);w((r=r.apply(l,i)).next())});import{g as tt}from"./index-db918426-1786725044461.js";import{A as nn}from"./assets-cf9c305b-1786725044461.js";/* empty css */import{f as sn,e as nt,d as rn,c as st,M as an}from"./index-151544a4-1786725044461.js";import{a as ln,c as un,d as on,e as cn,f as dn,g as vn}from"./resourceDetailRows-3e3a25c8-1786725044461.js";import{q as rt,r as fn,s as gn}from"./screen2Standard-3427eaf8-1786725044461.js";import{c as mn,F as hn}from"./featurePanelLayout-f3191169-1786725044461.js";import{_ as wn}from"./TopicSwitcher-06eba150-1786725044461.js";import{_ as yn}from"./LayerPanel-48d446bf-1786725044461.js";import{a as at,_ as bn}from"./FeatureInfoPanel-8c5860b5-1786725044461.js";import{_ as pn}from"./_plugin-vue_export-helper-c27b6911-1786725044461.js";import{g as d,o as _,c as S,a as b,t as Me,F as $e,y as Ce,n as fe,K as ge,d as m,q as kn,h as _n,w as D,A as ne,b as j,C as it,x as lt,u as Pe,j as ve,z as Ln}from"./index-1786725044461.js";import{_ as ut}from"./index-262a2c3c-1786725044461.js";const Sn="/openApi/screen2/resource-management/ndvi-timeline";function Tn(){return R(this,null,function*(){var p;const l=yield fetch(Sn,{credentials:"include",headers:{Accept:"application/json"}});if(!l.ok){const k=new Error(`HTTP ${l.status}`);throw k.status=l.status,k}const i=yield l.json().catch(()=>({}));if((i==null?void 0:i.code)!==200||(i==null?void 0:i.success)!==!0)throw new Error((i==null?void 0:i.message)||"NDVI 时间轴加载失败");const r=Array.isArray((p=i==null?void 0:i.data)==null?void 0:p.items)?i.data.items:[];return xn(r)})}function xn(l=[]){const i=new Set;return l.map((r,p)=>{const k=Nn(ot(r,["url","layerName","layer_name","layer","name"]));if(!k)return null;const f=ot(r,["date","month","time","label"])||k,o=Pn(f);return{key:`${k}-${f||p}`,label:o,date:String(f),layerName:k,source:r}}).filter(Boolean).filter(r=>i.has(r.key)?!1:(i.add(r.key),!0))}function ot(l,i){for(const r of i)if((l==null?void 0:l[r])!==void 0&&(l==null?void 0:l[r])!==null&&(l==null?void 0:l[r])!=="")return l[r]}function Nn(l){const i=String(l||"").trim();return i&&i.startsWith("v3:resource_")?i:""}function Pn(l){const i=String(l||"").trim();if(!i)return"";const r=i.match(/(\d{4})[-_/年. ]?(0?[1-9]|1[0-2])(?:月)?/);return r?`${r[1]}.${String(Number(r[2])).padStart(2,"0")}`:i}const Mn={class:"grassland-ndvi-timeline-head"},$n={key:0,class:"grassland-ndvi-timeline-state"},Cn={key:1,class:"grassland-ndvi-timeline-state"},Fn={key:2,class:"grassland-ndvi-timeline-body"},Vn=["aria-checked","title","onClick"],An={class:"grassland-ndvi-timeline-label"},En=42,In=28,Rn={__name:"GrasslandNdviTimeline",props:{items:{type:Array,default:()=>[]},modelValue:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(l,{emit:i}){const r=l,p=i,k=d(()=>r.items.findIndex(c=>c.key===r.modelValue)),f=d(()=>k.value===-1?Math.max(0,r.items.length-1):k.value),o=d(()=>r.items[f.value]||null),w=d(()=>r.loading?"加载中":"未选择"),y=d(()=>r.items.length>7),F=d(()=>y.value?In:En),se=d(()=>X(f.value)),re=d(()=>q(f.value));function Y(c){if(!r.items.length)return;const v=Math.min(r.items.length-1,Math.max(0,f.value+c));p("update:modelValue",r.items[v].key)}function ae(c){!c||c.key===r.modelValue||p("update:modelValue",c.key)}function Q(c){return!r.items.length||c<0?0:r.items.length===1?.5:c/(r.items.length-1)}function X(c){const v=Q(c),M=L(v*100),h=F.value*(1-v*2);return`calc(${M}% ${h<0?"-":"+"} ${L(Math.abs(h))}px)`}function q(c){const v=Q(c);return v<=0?"0px":`calc(${L(v*100)}% - ${L(F.value*2*v)}px)`}function L(c){return Number(c.toFixed(4)).toString()}return(c,v)=>{var M;return _(),S("div",{class:fe(["grassland-ndvi-timeline",{"is-dense":y.value}])},[b("div",Mn,[v[2]||(v[2]=b("span",null,"草地健康/退化",-1)),b("strong",null,Me(((M=o.value)==null?void 0:M.label)||w.value),1)]),l.loading?(_(),S("div",$n,"加载月份数据")):l.items.length?(_(),S("div",Fn,[b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"上一期",onClick:v[0]||(v[0]=h=>Y(-1))},"‹"),b("div",{class:"grassland-ndvi-timeline-track",style:ge({"--timeline-active-left":se.value,"--timeline-fill-width":re.value,"--timeline-edge-offset":`${F.value}px`}),role:"radiogroup","aria-label":"草地健康退化月份"},[v[4]||(v[4]=b("div",{class:"grassland-ndvi-timeline-line"},null,-1)),v[5]||(v[5]=b("div",{class:"grassland-ndvi-timeline-fill"},null,-1)),v[6]||(v[6]=b("div",{class:"grassland-ndvi-timeline-thumb"},[b("i")],-1)),(_(!0),S($e,null,Ce(l.items,(h,z)=>{var H,T;return _(),S("button",{key:h.key,class:fe(["grassland-ndvi-timeline-mark",{"is-active":h.key===((H=o.value)==null?void 0:H.key),"is-past":z<=f.value,"is-staggered":y.value&&z%2===1}]),type:"button",role:"radio","aria-checked":h.key===((T=o.value)==null?void 0:T.key),style:ge({left:X(z)}),title:h.date,onClick:Z=>ae(h)},[v[3]||(v[3]=b("span",{class:"grassland-ndvi-timeline-tick"},null,-1)),b("span",An,Me(h.label),1)],14,Vn)}),128))],4),b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"下一期",onClick:v[1]||(v[1]=h=>Y(1))},"›")])):(_(),S("div",Cn,"暂无月份数据"))],2)}}},qn=pn(Rn,[["__scopeId","data-v-3b86bca9"]]),Bn={class:"forest-grass-wet"},Gn={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},Dn={class:"fgw-left"},jn={class:"fgw-side-stack is-left"},zn={class:"fgw-right"},Hn={class:"fgw-side-stack is-right"},On={key:1,class:"fgw-ndvi-timeline"},Wn={class:"fgw-bottom-topic"},Un={key:0,class:"loading"},Kn={class:"loading-progress"},Yn={class:"value"},cs={__name:"index",props:{showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["topic-stats"],setup(l,{expose:i,emit:r}){const p=l,k=r,f=m(null),o=m(sn[0].key),w=m(""),y=m([]),F=m([]),se=m("idle"),re=m(!1),Y=m({title:"业务统计",rows:[]}),ae=m({title:"业务统计",rows:[]}),Q=m([]),X=m([]),q=m(null),L=m(""),c=m(null),v=m(!1),M=m(!1),h=m(null),z=m(0),H=m(p.showLoading),T=m([]),Z=m("idle"),V=m(""),B=m({type:"idle",text:"等待 GeoServer 图层加载"});let J=null,x=!1,me=!1,O=!1,A=null,he=0,we=0,ye=0,W=0,ie=0,le=!1,be=!1;const ct={图斑编号:"patch_no",图斑号:"patch_no",湿地编号:"land_number",草地编号:"land_number",林地类型:"dlmc",地类:"landUseName",地类名称:"landUseName",所在乡镇:"townName",所在区域:"full_name",面积:"acreage",图斑面积:"acreage",湿地面积:"acreage",草场面积:"acreage",草原类:"grassTypeName",草原型:"grassMinType",草原等级:"grasslandLevel",草原类型:"basic_type_name",小斑干草产量:"xbGcYield",小斑鲜草产量:"xbXcYield",鲜草产量:"xcYield",干草产量:"gcYield",海拔:"elevation",地貌:"landformName",权属单位:"qsdwmc",坐落单位:"zldwmc",林班:"lin_ban",小班:"xiao_ban",森林类别:"sen_lin_lb",林种:"lin_zhong",公益林等级:"gjgyl_bhdj",保护等级:"bh_dj",质量等级:"zl_dj",优势树种:"you_shi_sz",起源:"qi_yuan",龄组:"ling_zu",郁闭度:"yu_bi_du",林地权属:"ld_qs",土地使用权属:"tdsyqs",林木权属:"lmqs",生态区位:"stqwmc",坡度等级:"slope"},dt=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]),vt=[{topicKey:"wetland",layerKey:"wetland-distribution",name:"湿地分布",legendName:"湿地资源"},{topicKey:"grassland",layerKey:"grassland-distribution",name:"草地分布",legendName:"草地资源"},{topicKey:"woodland",layerKey:"woodland-distribution",name:"林地分布",legendName:"林地资源"}],ft=new Set(["code","msg","message","success","data","result","grassland","wetland","woodland","basicGrassland","dyColumn","geom","wkt","geometry","the_geom","theGeom","shape","shape_leng","shape_length","length","perimeter","gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].map(e=>e.toLowerCase())),gt=d(()=>nt(o.value)),mt=d(()=>rn(o.value)),ue=d(()=>vt.map(e=>Nt(e)).filter(Boolean)),oe=d(()=>o.value==="overview"?ue.value:mt.value),Fe=d({get(){return o.value==="overview"?y.value:w.value},set(e){if(o.value==="overview"){y.value=Array.isArray(e)?e.map(String).filter(Boolean):[];return}w.value=String(e||"")}}),ee=d(()=>w.value?st(o.value,w.value):null),U=d(()=>o.value==="grassland"&&w.value==="grassland-health"),ht=d(()=>U.value),wt=d(()=>T.value.find(e=>e.key===V.value)||null),K=d(()=>{var e;return(((e=ee.value)==null?void 0:e.legends)||[]).find(t=>t.key===L.value)||null}),yt=d(()=>ue.value.flatMap(e=>e.legends||[])),pe=d(()=>{var e;return o.value==="overview"?yt.value:((e=ee.value)==null?void 0:e.legends)||[]}),bt=d(()=>oe.value.length>0),Ve=d(()=>oe.value.length<=6&&pe.value.length<=8),Ae=d(()=>{if(!Ve.value)return 430;const e=Math.max(1,oe.value.length),t=Math.max(1,Math.ceil(pe.value.length/2)),n=e*34+Math.max(0,e-1)*5,s=30+t*28;return Math.max(220,Math.min(430,72+n+s))}),pt=d(()=>{var s;if(o.value==="overview"){const a=new Set(y.value),u=ue.value.filter(g=>a.has(g.key));return Pt(u)}const e=ee.value;if(!e)return null;let t=(s=K.value)!=null&&s.cqlFilter?I(C({},e),{cqlFilter:K.value.cqlFilter,activeLegend:K.value,name:K.value.name||e.name}):e;const n=wt.value;return U.value&&!(n!=null&&n.layerName)?null:(U.value&&(t=I(C({},t),{layerName:n.layerName,name:`${e.name} ${n.label}`,timelineDate:n.label,timelineItem:n})),t)}),Ee=m(typeof window=="undefined"?1080:window.innerHeight),Ie=rt.sideCardWidth;d(()=>rt.sideCardGap);const Re=d(()=>fn(Ee.value)),kt=d(()=>gn(Re.value,2)),ke=d(()=>!!h.value),qe=d(()=>{var e,t,n,s;return ln(((t=(e=c.value)==null?void 0:e.properties)==null?void 0:t.resourceType)||Ue((n=c.value)==null?void 0:n.layer),((s=c.value)==null?void 0:s.properties)||{})}),_t=hn,Be=d(()=>mn({point:h.value?xt(h.value):null,rowCount:c.value?qe.value.length||xe(c.value):0,loading:M.value,empty:v.value||!c.value,preferredTop:190,preserveDesiredHeight:!0})),Lt=d(()=>Be.value.height),St=d(()=>Be.value.style),Tt=d(()=>{var s,a,u,g,E,P,$,te,G;const e=String(((a=(s=c.value)==null?void 0:s.properties)==null?void 0:a.resourceType)||"").toLowerCase();if(["basicgrassland","basic-grassland"].includes(e))return"基本/一般草原详情";const t=((g=(u=c.value)==null?void 0:u.layer)==null?void 0:g.overviewTopicKey)||((P=(E=c.value)==null?void 0:E.layer)==null?void 0:P.topicKey)||o.value;return{grassland:"草地详情",wetland:"湿地详情",woodland:"林地详情"}[t]||`${((te=($=c.value)==null?void 0:$.layer)==null?void 0:te.name)||((G=gt.value)==null?void 0:G.name)||"资源"}详情`});function xt(e){const t=document.querySelector(".forest-grass-wet"),n=t==null?void 0:t.getBoundingClientRect();return!(n!=null&&n.width)||!(n!=null&&n.height)?e:{x:(e.x-n.left)/n.width*1920,y:(e.y-n.top)/n.height*1080}}function _e(){Ee.value=typeof window=="undefined"?1080:window.innerHeight}function Nt({topicKey:e,layerKey:t,name:n,legendName:s}){var g;const a=st(e,t);if(!a||a.key!==t)return null;const u=((g=a.legends)==null?void 0:g[0])||{};return I(C({},a),{name:n,overviewTopicKey:e,legends:[I(C({},u),{key:`overview-${t}`,name:s,selectable:!1})]})}function Pt(e=[]){const t=e.filter(Boolean);if(!t.length)return null;const[n,...s]=t;return I(C({},n),{overlayLayers:s})}kn(()=>{_e(),window.addEventListener("resize",_e),document.addEventListener("pointerdown",Qe,!0),Mt(),Se(o.value,""),ce(o.value,"")}),_n(()=>{x=!0,A&&window.clearTimeout(A),window.removeEventListener("resize",_e),document.removeEventListener("pointerdown",Qe,!0)}),D(o,e=>{le=!0,L.value="",w.value="",e==="overview"&&(y.value=[]),N(),B.value={type:"idle",text:"等待 GeoServer 图层加载"},Se(e,""),ce(e,"",null),ne(()=>{le=!1})}),D(w,()=>{le||(be=!0,L.value="",N(),B.value={type:w.value?"loading":"idle",text:w.value?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},o.value!=="woodland"&&Se(o.value,w.value),ce(o.value,w.value,null),ne(()=>{be=!1}))}),D(y,()=>{o.value==="overview"&&(L.value="",N(),B.value={type:y.value.length?"loading":"idle",text:y.value.length?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},q.value=Ye("overview",y.value.join(",")))},{deep:!0}),D(L,()=>{le||be||(N(),ce(o.value,w.value,K.value))}),D(U,e=>{if(e){Ft();return}V.value=""}),D(V,()=>{U.value&&N()}),D(()=>p.active,e=>{var t,n,s,a;f.value&&(e?(Le(),(n=(t=f.value).resume)==null||n.call(t)):(a=(s=f.value).pause)==null||a.call(s))});function Mt(){var n;J=new nn;const e={progress:0};J.instance.on("onProgress",(s,a,u)=>{const g=Math.floor(a/u*100);tt.to(e,{progress:g,onUpdate:()=>{z.value=Math.floor(e.progress)}})});const t=()=>{x||me||(me=!0,Le())};J.instance.on("onLoad",t),(n=J.ready)==null||n.then(t).catch(()=>{x||(B.value={type:"error",text:"地图资源加载失败"})})}function Le(){x||!p.active||!me||O||(O=!0,A&&window.clearTimeout(A),A=window.setTimeout(()=>{A=null,Ge()},600))}function Ge(e=0){return R(this,null,function*(){var n,s,a,u,g;if(x)return;if(!p.active){O=!1;return}if(yield ne(),!p.active){O=!1;return}if(!!((s=(n=f.value)==null?void 0:n.loadMap)!=null&&s.call(n,J)||(u=(a=f.value)==null?void 0:a.hasMap)!=null&&u.call(a))){yield Qt(),yield ne(),(g=f.value)==null||g.play();return}if(e<24){window.setTimeout(()=>Ge(e+1),120);return}O=!1})}function $t(){A&&(window.clearTimeout(A),A=null)}function De(){var e,t,n,s;(t=(e=f.value)==null?void 0:e.resume)==null||t.call(e),(s=(n=f.value)==null?void 0:n.refreshView)==null||s.call(n)}function Ct(){var e,t;if(N(),B.value={type:"loading",text:"地图正在复位"},(t=(e=f.value)==null?void 0:e.hasMap)!=null&&t.call(e)){De(),B.value={type:"success",text:"地图已复位"};return}$t(),O=!1,ne(()=>{Le()})}i({refreshMapView:De,resetMap:Ct});function Se(n){return R(this,arguments,function*(e,t=w.value){const s=e==="woodland"?"":t,a=++we;re.value=!0,se.value="loading";try{const u=yield un(e,2023);if(x||a!==we||e!==o.value||e!=="woodland"&&(s||"")!==(w.value||""))return;ze(u,e)}catch(u){if(x||a!==we||e!==o.value)return;ze(I(C({},on(e)),{status:"error"}),e)}})}function Ft(e=!1){return R(this,null,function*(){if(!U.value)return;if(!e&&T.value.length){je();return}const t=++ye;Z.value="loading";try{const n=yield Tn();if(x||t!==ye)return;T.value=n,Z.value=n.length?"success":"empty",je()}catch(n){if(x||t!==ye)return;T.value=[],V.value="",Z.value="error"}})}function je(){if(!T.value.length){V.value="";return}T.value.some(t=>t.key===V.value)||(V.value=T.value[T.value.length-1].key)}function ze(e,t){var s,a,u;const n=Vt(e);F.value=n.core||[],Y.value=n.left||{title:"业务统计",rows:[]},ae.value=n.right||{title:"业务统计",rows:[]},Q.value=(s=n.leftPanels)!=null&&s.length?n.leftPanels:[Y.value],X.value=(a=n.rightPanels)!=null&&a.length?n.rightPanels:[ae.value],se.value=n.status,re.value=!1,k("topic-stats",{topicKey:t,topicName:nt(t).name,items:((u=n.top)!=null&&u.length?n.top:n.core||[]).slice(0,4)})}function Vt(e){return e||{}}function He(e,t){return`${o.value}-${t}-${(e==null?void 0:e.key)||(e==null?void 0:e.title)||"panel"}`}function Te(e){var n;const t=((n=e==null?void 0:e.rows)==null?void 0:n.length)||0;return(e==null?void 0:e.span)===1?!1:(e==null?void 0:e.span)===2?!0:(e==null?void 0:e.type)==="spotlight"||(e==null?void 0:e.type)==="metric"||(e==null?void 0:e.type)==="column"&&t<=5?!1:(e==null?void 0:e.type)==="rank"&&t>4||(e==null?void 0:e.type)==="split"&&t>4||(e==null?void 0:e.type)==="donut"&&t>5||(e==null?void 0:e.type)==="structure"&&t>4||(e==null?void 0:e.type)==="bar"&&t>4||(e==null?void 0:e.type)==="line"&&t>6}function Oe(e){return Te(e)?kt.value:Re.value}function xe(e){const t=(e==null?void 0:e.properties)||{};return Object.keys(t).filter(s=>We(s,t[s])).length}function We(e,t){return t==null||t===""||Array.isArray(t)||typeof t=="object"?!1:!ft.has(String(e||"").toLowerCase())}function At(){if(o.value==="overview"){const e=new Set(y.value);return ue.value.filter(t=>e.has(t.key)).slice().reverse()}return ee.value?[ee.value]:[]}function Ue(e={}){const t=String(e.overviewTopicKey||o.value||"").toLowerCase(),n=`${e.key||""} ${e.layerName||""} ${t}`.toLowerCase();return n.includes("basic-grassland")||n.includes("t_basic_grassland")?"basicGrassland":t==="woodland"||n.includes("woodland")||n.includes("t_woodland")?"woodland":t==="wetland"||n.includes("wetland")||n.includes("shidi")?"wetland":t==="grassland"||n.includes("grassland")||n.includes("caodi")?"grassland":""}function Et(e={}){const t=Ke(e.lng),n=Ke(e.lat);return t===""||n===""?"":`POINT(${t} ${n})`}function Ke(e){const t=Number(e);return Number.isFinite(t)?t.toFixed(8).replace(/\.?0+$/,""):""}function It(){return R(this,arguments,function*(e={}){var E,P,$,te,G,Xe;const t=Number((E=e==null?void 0:e.lngLat)==null?void 0:E.lng),n=Number((P=e==null?void 0:e.lngLat)==null?void 0:P.lat),s=At();if(!Number.isFinite(t)||!Number.isFinite(n)||!s.length){N();return}const a=++W,u=ie,g=e.screen||{x:960,y:540};h.value=null,c.value=null,v.value=!1,M.value=!0,(te=($=f.value)==null?void 0:$.clearSelectedFeature)==null||te.call($);try{for(const Ze of s){const de=yield Rt(Ze,{lng:t,lat:n});if(a!==W||x)return;if(de){c.value=de,h.value=Ne(de,g),v.value=!1,(Xe=(G=f.value)==null?void 0:G.highlightFeature)==null||Xe.call(G,de,{highlightTone:"v21"});return}}a===W&&ie===u&&N()}catch(Ze){a===W&&ie===u&&N()}finally{a===W&&(M.value=!1)}})}function Rt(e,t){return R(this,null,function*(){const n=Ue(e);if(!n)return null;const s=Et(t),a=yield vn(n,s),u=qt(a,n);if(!Gt(u))return null;const g=jt(u,e,t,n);return xe(g)>0?g:null})}function qt(e,t){var s,a,u,g,E;const n=[e==null?void 0:e[t],e==null?void 0:e.grassland,e==null?void 0:e.wetland,e==null?void 0:e.woodland,e==null?void 0:e.basicGrassland,(s=e==null?void 0:e.data)==null?void 0:s[t],(a=e==null?void 0:e.data)==null?void 0:a.grassland,(u=e==null?void 0:e.data)==null?void 0:u.wetland,(g=e==null?void 0:e.data)==null?void 0:g.woodland,(E=e==null?void 0:e.data)==null?void 0:E.basicGrassland,e==null?void 0:e.data,e==null?void 0:e.result,e];for(const P of n){const $=Bt(P);if($)return $}return null}function Bt(e){return Array.isArray(e)?e.find(t=>t&&typeof t=="object")||null:e&&typeof e=="object"?e:null}function Gt(e){return!e||typeof e!="object"?!1:Array.isArray(e.dyColumn)&&e.dyColumn.some(Dt)?!0:Object.keys(e).some(t=>We(t,e[t]))}function Dt(e={}){const t=e==null?void 0:e.value;return t==null||t===""?!1:!!String((e==null?void 0:e.field)||(e==null?void 0:e.title)||"").trim()}function jt(e,t,n,s){const a=Ht(e),u=zt(e);return{id:e.id||e.patchNo||e.patch_no||e.landNumber||e.land_number||`${s}-${n.lng}-${n.lat}`,properties:a,feature:{type:"Feature",properties:a,geometry:u},geometry:u,layer:t,lngLat:n}}function zt(e={}){return e.geometry||e.geom||e.wkt||e.the_geom||e.theGeom||e.geo||e.geometryWkt||e.geometry_wkt||e.shape||null}function Ht(e={}){const t=C({},e);return(Array.isArray(e.dyColumn)?e.dyColumn:[]).forEach(s=>{const a=s==null?void 0:s.value;if(a==null||a==="")return;const u=ct[String((s==null?void 0:s.title)||"").trim()],g=String((s==null?void 0:s.field)||"").trim();[g,Ot(g),u].filter(Boolean).forEach(P=>{(t[P]===void 0||t[P]===null||t[P]==="")&&(t[P]=a)})}),t}function Ot(e){return String(e||"").replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function ce(s,a){return R(this,arguments,function*(e,t,n=K.value){const u=++he;if(!t||!Wt(t,n)){q.value=Ye(e,t);return}try{const g=yield cn(e,t);if(x||u!==he||e!==o.value||t!==w.value||((n==null?void 0:n.key)||"")!==L.value)return;q.value=I(C({},g),{hideTownLabelStats:!0})}catch(g){if(x||u!==he)return;q.value=I(C({},dn(e,t)),{status:"error",hideTownLabelStats:!0})}})}function Wt(e,t=null){return!!(t!=null&&t.key)||dt.has(e)}function Ye(e,t){return{status:"disabled",topicKey:e,layerKey:t,title:"",unit:"",hideTownLabelStats:!0,rows:[]}}function Ut(e){var n,s;ie+=1;const t=(s=(n=e==null?void 0:e.feature)!=null?n:e)!=null?s:null;if(!t||xe(t)<=0){N();return}c.value=t,v.value=!1,h.value=Ne(t,(e==null?void 0:e.screen)||h.value)}function Ne(e,t=null){var n,s,a,u;return((s=(n=f.value)==null?void 0:n.getVectorFeatureAnchorScreen)==null?void 0:s.call(n,e))||((u=(a=f.value)==null?void 0:a.getVectorFeatureScreen)==null?void 0:u.call(a,e))||t}function Kt(){if(!ke.value||!c.value)return;const e=Ne(c.value,h.value);if(!e)return;const t=h.value;t&&Math.abs(Number(t.x)-Number(e.x))<.5&&Math.abs(Number(t.y)-Number(e.y))<.5||(h.value=e)}function Yt(e){B.value=e}function N(){var e,t;W+=1,c.value=null,v.value=!1,M.value=!1,h.value=null,(t=(e=f.value)==null?void 0:e.clearSelectedFeature)==null||t.call(e)}function Qe(e){if(!ke.value)return;const t=document.querySelector(".fgw-map-feature-info"),n=document.querySelector(".forest-grass-wet .cesium-map"),s=e.target;t&&s instanceof Node&&t.contains(s)||n&&s instanceof Node&&n.contains(s)||N()}function Qt(){return H.value?new Promise(e=>{tt.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{H.value=!1,e()}})}):Promise.resolve()}return(e,t)=>(_(),S("div",Bn,[j(an,{ref_key:"mapSceneRef",ref:f,"active-layer":pt.value,"map-ranking":q.value,"admin-boundary-line-scale":1.65,"initial-zoom":9,"auto-apply-layer-map-view":!1,"max-zoom":21,"hide-town-label-stats":"","enable-imagery-feature-pick":!1,"emit-empty-feature-info-on-miss":!1,"enable-town-polygon-pick":!1,onFeatureLoading:t[0]||(t[0]=n=>M.value=n),onFeatureInfo:Ut,onMapClick:It,onLayerStatus:Yt,onViewChange:Kt},null,8,["active-layer","map-ranking"]),b("div",Gn,[b("div",Dn,[b("div",jn,[(_(!0),S($e,null,Ce(Q.value,n=>(_(),it(ut,{key:He(n,"left"),class:fe(["fgw-side-card left-card",{"is-double":Te(n)}]),title:n.title,width:Pe(Ie),height:Oe(n)},{default:lt(()=>[j(at,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),b("div",zn,[b("div",Hn,[(_(!0),S($e,null,Ce(X.value,n=>(_(),it(ut,{key:He(n,"right"),class:fe(["fgw-side-card right-card",{"is-double":Te(n)}]),title:n.title,width:Pe(Ie),height:Oe(n)},{default:lt(()=>[j(at,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),bt.value?(_(),S("div",{key:0,class:"fgw-map-layer-tools",style:ge({height:`${Ae.value}px`})},[j(yn,{modelValue:Fe.value,"onUpdate:modelValue":t[1]||(t[1]=n=>Fe.value=n),"selected-legend-key":L.value,"onUpdate:selectedLegendKey":t[2]||(t[2]=n=>L.value=n),"topic-key":o.value,layers:oe.value,legends:pe.value,multiple:o.value==="overview",width:248,height:Ae.value,compact:Ve.value},null,8,["modelValue","selected-legend-key","topic-key","layers","legends","multiple","height","compact"])],4)):ve("",!0),ht.value?(_(),S("div",On,[j(qn,{modelValue:V.value,"onUpdate:modelValue":t[3]||(t[3]=n=>V.value=n),items:T.value,loading:Z.value==="loading"},null,8,["modelValue","items","loading"])])):ve("",!0),ke.value?(_(),S("div",{key:2,class:"fgw-map-feature-info",style:ge(St.value)},[j(bn,{title:Tt.value,feature:c.value,empty:v.value,loading:M.value,width:Pe(_t),height:Lt.value,rows:qe.value,closable:"",onClose:N},null,8,["title","feature","empty","loading","width","height","rows"])],4)):ve("",!0),b("div",Wn,[j(wn,{modelValue:o.value,"onUpdate:modelValue":t[4]||(t[4]=n=>o.value=n)},null,8,["modelValue"])])]),H.value?(_(),S("div",Un,[t[6]||(t[6]=Ln('
LOADING
',1)),b("div",Kn,[b("span",Yn,Me(z.value),1),t[5]||(t[5]=b("span",{class:"unit"},"%",-1))])])):ve("",!0)]))}};export{cs as default};