@map-colonies/react-components 4.7.1 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- (function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@turf/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@map-colonies/react-core/dist/linear-progress/styles","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.reactComponents={},d.jsxRuntime,d.React,d.dateFns,d.locale,d.pickers,d.DateFnsUtils,d.styles,d.core,d.reactCore,d.useMediaQuery,d.DatePicker,d.datePickerHebrewLocale,d.moment,d.rewind,d.ol,null,d.coordinate,d.control,d.MousePosition,d.proj,d.layer,d.source,d.format,d.interaction,d.Draw,d.VectorTile,d.style,d.WMTSTileGrid,d.extent,d.OlTileWMS,d.OlXYZ,d.VectorTileSource,d.OlExtLegend,d.OlExtLegendCtrl,null,d.TableHead,d.utils,d.CssBaseline,d.ScopedCssBaseline,d.ReactDOM,d.resium,d.Cesium,d.lodash,d.booleanPointInPolygon,null,d.viewerCesiumNavigationMixin,null,d.turf,d.bbox,d.bboxPolygon,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize))})(this,function(d,o,c,ge,Ae,be,Re,ve,Z,G,mn,et,yn,Le,vn,tt,Zr,nt,We,$e,it,rt,qe,Ue,En,Cn,Tn,De,wn,ot,Sn,bn,Ln,st,Mn,Jr,_n,at,Pn,In,An,me,S,z,Dn,Qr,On,Rr,kn,lt,ct,xn,dt,F,Nn,Bn){"use strict";var Yr=Object.defineProperty;var Xr=(d,o,c)=>o in d?Yr(d,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[o]=c;var ee=(d,o,c)=>(Xr(d,typeof o!="symbol"?o+"":o,c),c);function je(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const ut=je(c),m=je(S),ht=je(kn);var ae=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(ae||{}),ue=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(ue||{}),Oe=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Oe||{});const R={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:ue.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:ue.EN},renderAsButton:!0,offset:0,disableFuture:!0}},ce=e=>{const{children:n,...t}=e;return o.jsx(Z.Box,{...t,children:n})},Ke=e=>{const n=e.type==="dark";return c.useMemo(()=>gt(e,n),[n,e])},gt=(e,n=!1)=>ve.createTheme({palette:{type:n?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:n?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:n?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),eo="",Fn=2,Vn=.5,Gn=ve.makeStyles(e=>ve.createStyles({container:{padding:e.spacing(Fn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Vn)}})),pt=e=>{var Y,k,q,N;const n=Gn(),t=G.useTheme(),i=Ke(t),[s,r]=c.useState(null),[u,g]=c.useState(null),[f,y]=c.useState(R.DATE_RANGE_PICKER.dateFormat),T=e.controlsLayout??R.DATE_RANGE_PICKER.controlsLayout,_=e.disableFuture??R.DATE_RANGE_PICKER.disableFuture,b=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,D=((k=e.local)==null?void 0:k.endPlaceHolderText)??R.DATE_RANGE_PICKER.local.endPlaceHolderText,x=((q=e.local)==null?void 0:q.setText)??R.DATE_RANGE_PICKER.local.setText,Q=(((N=e.local)==null?void 0:N.calendarLocale)??R.DATE_RANGE_PICKER.local.calendarLocale)===ue.HE?Ae.he:Ae.enUS;c.useEffect(()=>{r(e.from??null)},[e.from]),c.useEffect(()=>{g(e.to??null)},[e.to]),c.useEffect(()=>{y(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const H=Boolean(ge.isValid(s)&&!u||ge.isValid(u)&&!s||s&&u&&ge.isValid(s)&&ge.isValid(u)&&ge.isBefore(s,u)),K=()=>{e.onChange({from:s&&ge.isValid(s)?s:void 0,to:u&&ge.isValid(u)?u:void 0})};return o.jsx(Z.ThemeProvider,{theme:i,children:o.jsx(ce,{className:`${n.container} drpContainer`,display:"flex",flexDirection:T,width:T==="column"?e.contentWidth:"unset",children:o.jsxs(be.MuiPickersUtilsProvider,{utils:Re,locale:Q,children:[o.jsx(be.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:U=>r(U),value:s,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(be.KeyboardDateTimePicker,{variant:"inline",placeholder:D,className:n.margin,onChange:U=>g(U),value:u,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(G.ThemeProvider,{options:t,children:o.jsx(G.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:K,disabled:!H,children:x})})]})})})},ft=e=>{const{children:n,...t}=e;return o.jsx(Z.Popover,{...t,children:n})},to="",Hn=e=>{var k,q;const[n,t]=c.useState(null),[i,s]=c.useState(null),[r,u]=c.useState(R.DATE_RANGE_PICKER.dateFormat),[g,f]=c.useState(null),y=N=>{f(N.currentTarget)},T=N=>{N.currentTarget.tagName==="I"?f(N.currentTarget.previousElementSibling):f(N.currentTarget)},_=()=>{f(null)},b=Boolean(g),D=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??R.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const x=((k=e.local)==null?void 0:k.startPlaceHolderText)??R.DATE_RANGE_PICKER.local.startPlaceHolderText,W=((q=e.local)==null?void 0:q.endPlaceHolderText)??R.DATE_RANGE_PICKER.local.endPlaceHolderText,Q=e.renderAsButton===void 0?R.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,H=e.offset===void 0?R.DATE_RANGE_PICKER.offset:e.offset,K=e.disableFuture===void 0?R.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=c.useMemo(()=>`${n?ge.format(n,r):x} - ${i?ge.format(i,r):W}`,[n,i,r,x,W]);return o.jsxs(o.Fragment,{children:[Q?o.jsx(G.Button,{style:{width:e.width},raised:!0,onClick:y,className:"drpOpener",children:Y}):o.jsx(G.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:T,trailingIcon:{icon:"date_range",tabIndex:0,onClick:T}}),o.jsx(ft,{open:b,anchorEl:g,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(pt,{controlsLayout:D,contentWidth:((g==null?void 0:g.clientWidth)??0)-H,dateFormat:r,disableFuture:K,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:N,to:U})=>{t(N??null),s(U??null),e.onChange({from:N,to:U}),_()}})})]})},ke=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,zn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:r="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:g="",startTimeInputClassName:f="",startTimeLabel:y="",startTimeWrapperClassName:T=""})=>o.jsxs("div",{className:`timeRangeWrapper ${g}`,children:[o.jsx("div",{className:`startTimeWrapper ${T}`,children:o.jsx(G.TextField,{label:y,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Le(n).format("HH:mm"),onChange:_=>{const b=Le(n),D=Le(_.currentTarget.value,"HH:mm"),x=b.set({hours:D.get("hours"),minutes:D.get("minutes")});i(x.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${u}`,children:o.jsx(G.TextField,{label:r,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Le(e).format("HH:mm"),onChange:_=>{const b=Le(e),D=Le(_.currentTarget.value,"HH:mm"),x=b.set({hours:D.get("hours"),minutes:D.get("minutes")});t(x.toDate())}})})]}),Wn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>o.jsx(G.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:r=>{n==null||n(r),t==null||t()},ref:s,value:e})),$n=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[r,u]=c.useState(),g=c.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return c.useEffect(()=>{for(const f of g){const y=i.startDate&&i.endDate&&ge.isSameDay(f.startDate,i.startDate)&&ge.isSameDay(f.endDate,i.endDate);r?f.id===r&&(y||u(void 0)):y&&u(f.id)}},[i,r,g]),o.jsx("div",{className:"shortcutsContainer",children:g.map((f,y)=>{const T=()=>{e(f.startDate),n(f.endDate)};return o.jsx(G.Button,{type:"button",className:`shortcut ${r===f.id?"selected":""}`,onClick:_=>{T(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+y)})})},qn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:r,onChange:u,inputName:g,showMonthYearDropdown:f,withShortcuts:y,locale:T="en"}=e,[_,b]=c.useState(null),[D,x]=c.useState(null),[W,Q]=c.useState(!1),H=r?{startDate:_,endDate:D}:_;c.useEffect(()=>{T==="he"&&et.registerLocale("he",yn)},[T]),c.useEffect(()=>{var k,q;((k=e.startDate)==null?void 0:k.toString())!==(_==null?void 0:_.toString())&&b(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(D==null?void 0:D.toString())&&x(e.endDate)},[e.startDate,e.endDate,_,D]);const K=c.useMemo(()=>{let k="pickerContainer"+(T==="he"?" pickerContainer-rtl":"");return y&&r&&(k+=" pickerContainer-withShortcuts"),k},[T,y,r]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:K,style:{direction:T==="he"?"rtl":"ltr"},children:o.jsx(et,{...e,ref:n,onClickOutside:()=>Q(!1),open:W,startDate:ke(H)?_:void 0,selected:_,endDate:ke(H)?D:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:k=>`pickerWeek ${(i==null?void 0:i(k))??""}`,dayClassName:k=>`pickerDay ${(i==null?void 0:i(k))??""}`,monthClassName:k=>`pickerMonth ${(s==null?void 0:s(k))??""}`,onChange:(k,q)=>{if(Array.isArray(k)){const[N,U]=k;b(N),x(U),u==null||u({startDate:N,endDate:U&&ge.endOfDay(U)},q)}else b(k),u==null||u(k,q)},customInput:o.jsx(Wn,{name:g,onInputClick:()=>{Q(!0)}}),showTimeInput:!!(y&&r),timeInputLabel:"",customTimeInput:y&&ke(H)&&o.jsx($n,{onShortcut:k=>{u==null||u(k),Q(!1)},shortcuts:y,setEndDate:x,setStartDate:b,dateRange:H}),showMonthYearDropdown:void 0,...Y})})}),no="",Un=e=>{const n=G.useTheme(),t=Ke(n),{format:i=R.DATE_PICKER.dateFormat,variant:s=R.DATE_PICKER.variant,disableFuture:r=R.DATE_PICKER.disableFuture,local:u,onChange:g,showTime:f=R.DATE_PICKER.showTime,value:y,...T}=e,{placeHolderText:_=R.DATE_PICKER.local.placeHolderText,calendarLocale:b}=u??{placeHolderText:R.DATE_PICKER.local.placeHolderText,calendarLocale:ue.EN},D=b===ue.HE?Ae.he:Ae.enUS,x=W=>{g(W)};return o.jsx(Z.ThemeProvider,{theme:t,children:o.jsxs(be.MuiPickersUtilsProvider,{utils:Re,locale:D,children:[f&&o.jsx(be.KeyboardDateTimePicker,{variant:s,placeholder:_,onChange:x,value:y,disableFuture:r,format:i,...T}),!f&&o.jsx(be.KeyboardDatePicker,{variant:s,placeholder:_,onChange:x,value:y,disableFuture:r,format:i,...T})]})})},jn=18,Kn=ve.makeStyles(e=>ve.createStyles({drawingButton:{width:e.spacing(jn)},fullWidth:{width:"100%",marginTop:"36px"}})),Yn=e=>{const n=Kn(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:r,onStartDraw:u,onReset:g}=e,f=T=>{i(T.currentTarget)},y=()=>{i(null)};return s?o.jsx(G.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(G.Button,{className:n.drawingButton,raised:!0,onClick:r,children:"Cancel Draw"})}):o.jsxs(ce,{position:"relative",children:[o.jsx(G.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(G.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(G.Menu,{className:n.fullWidth,open:Boolean(t),onClose:y,children:[o.jsx(G.MenuItem,{onClick:()=>{u(ae.POLYGON),y()},children:"Polygon"}),o.jsx(G.MenuItem,{onClick:()=>{u(ae.BOX),y()},children:"Box"}),o.jsx(G.MenuItem,{onClick:()=>{g(),y()},children:"Clear"})]})]})},io="";var pe=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(pe||{});const xe=5,Ne=2,mt=c.createContext(null),Xn=mt.Provider,yt=35,vt=32,Zn=10,Jn=e=>e!==void 0&&e!==pe.WGS84?it.transform([yt,vt],pe.WGS84,e):[yt,vt],Qn=e=>{switch(e){case pe.WEB_MERCATOR:return n=>nt.format(n,"Mercator: {y}m, {x}m",Ne);case pe.WGS84:return n=>nt.format(n,"WGS84: {y}°N {x}°E",xe);default:return n=>""}},Te=()=>{const e=c.useContext(mt);if(e===null)throw new Error("map context is null, please check the provider");return e},Et=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[r]=c.useState(new tt.Map({view:new tt.View({projection:s??pe.WGS84}),controls:We.defaults()}));c.useEffect(()=>{r.getView().setCenter(e.center??Jn(e.projection))},[r,e.center,e.projection]),c.useEffect(()=>{r.getView().setZoom(e.zoom??Zn)},[r,e.zoom,e.projection]);const u=(g,f)=>{f.getControls().forEach(T=>{T instanceof g&&f.removeControl(T)})};return c.useEffect(()=>{r.setTarget(n.current),t!==void 0&&t?r.addControl(new We.FullScreen):u(We.FullScreen,r)},[r,t]),c.useEffect(()=>{i!==void 0&&i?(u($e,r),r.addControl(new $e({coordinateFormat:Qn(s??pe.WGS84),projection:s??pe.WGS84,undefinedHTML:"&nbsp;"}))):u($e,r)},[r,i,s]),o.jsxs(Xn,{value:r,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},Ct=c.createContext(null),Rn=Ct.Provider,_e=()=>{const e=c.useContext(Ct);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Tt=({options:e,children:n})=>{const t=Te(),[i]=c.useState(new rt.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),o.jsx(Rn,{value:i,children:n})},wt=c.createContext(null),ei=wt.Provider,St=()=>{const e=c.useContext(wt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},bt=({children:e})=>{const n=Te(),[t]=c.useState(new rt.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(ei,{value:t,children:e})},Lt=c.createContext(null),ti=Lt.Provider,Mt=()=>{const e=c.useContext(Lt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},_t=({children:e})=>{const n=St(),[t]=c.useState(new qe.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(ti,{value:t,children:e})},Pt=({geometry:e,fitOptions:n,fit:t,featureStyle:i})=>{const s=Mt(),r=Te();return c.useLayoutEffect(()=>{const g=new Ue.GeoJSON().readFeature(e);return t&&s.on("addfeature",function(){r.getView().fit(s.getExtent(),n)}),i&&g.setStyle(i),s.addFeature(g),()=>{s.removeFeature(g)}},[e,s,t]),null},It=e=>{const n=_e();return c.useEffect(()=>{n.setSource(new qe.OSM)},[n]),null},At=({drawType:e,onPolygonSelected:n})=>{const t=Te();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case ae.BOX:i.geometryFunction=Cn.createBox();break;case ae.POLYGON:i.type="Polygon";break;default:return}const s=new En.Draw(i);t.addInteraction(s);const r=u=>{const f=new Ue.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(f)};return s.on("drawend",r),()=>{s.un("drawend",r),t.removeInteraction(s)}},[n,e,t]),null},ro="",ni=e=>{const n=t=>{const i=vn(t);e.onPolygonSelection(i)};return o.jsxs(Et,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(Tt,{children:o.jsx(It,{})}),e.selectionPolygon&&o.jsx(bt,{children:o.jsx(_t,{children:o.jsx(Pt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(At,{drawType:e.drawType,onPolygonSelected:n})]})},Ye=1.5,ii=80,ri=ve.makeStyles(e=>ve.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(Ye),top:e.spacing(Ye)},contentContainer:{marginTop:e.spacing(Ye),width:e.spacing(ii)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),oi=e=>{var f;const[n,t]=c.useState(),[i,s]=c.useState(),r=ri(),u=y=>{s(y),t(void 0),e.handlePolygonSelected(y)},g=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:r.map,children:[o.jsxs("div",{className:`${r.absolute}`,children:[o.jsxs(Z.Paper,{className:r.filtersContainer,children:[o.jsx(Yn,{onCancelDraw:()=>t(void 0),onReset:g,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((y,T)=>o.jsx("div",{className:r.filtersMargin,children:y},T))]}),o.jsx(Z.Paper,{color:"red",className:`${r.contentContainer}`,children:e.children})]}),o.jsx(ni,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})},Dt=new De.Fill({color:"rgba(255,255,255,0.4)"}),Ot=new De.Stroke({color:"#3399CC",width:1.25}),kt=[new De.Style({image:new De.Circle({fill:Dt,stroke:Ot,radius:5}),fill:Dt,stroke:Ot})],xt=c.createContext(null),si=xt.Provider,Nt=()=>{const e=c.useContext(xt);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},ai=({children:e,options:n,style:t})=>{const i=Te(),[s]=c.useState(new Tn({...n,style:t||kt}));return c.useEffect(()=>(i.addLayer(s),()=>{i.removeLayer(s)}),[i,s]),c.useEffect(()=>{s.setStyle(t||kt)},[s,t]),o.jsx(si,{value:s,children:e})},Xe=20,li=256,ci=2,di=2,ui="REST",hi=e=>{const n=it.get(e.projection),t=n.getExtent(),i=new Array(Xe),s=new Array(Xe),r=ot.getWidth(t)/li,u=e.heightWidthRatio!==void 0?e.heightWidthRatio:di,g=e.requestEncoding!==void 0?e.requestEncoding:ui;for(let y=0;y<Xe;++y)i[y]=r/Math.pow(ci,y)/u,s[y]=y.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new wn({origin:ot.getTopLeft(t),resolutions:i,matrixIds:s}),style:e.style,requestEncoding:g,wrapX:e.wrapX!==void 0?e.wrapX:!0}},gi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new qe.WMTS(t))},[n,t]),null},pi=e=>{const{attributions:n,url:t,params:i,serverType:s,transition:r}=e;return{attributions:n,url:t,params:i,serverType:s,transition:r}},fi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Sn(t))},[n,t]),null},mi=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},yi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new bn(t))},[n,t]),null},vi=c.createContext(null),Ei=()=>{const e=c.useContext(vi);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},Ci=e=>{const{url:n}=e;return{url:n,format:new Ue.MVT}},Ti=({children:e,options:n})=>{const t=Nt();return c.useEffect(()=>{t.setSource(new Ln(n))},[n,t]),null},wi=({legendItems:e,title:n,isCollapsed:t})=>{const i=Te();return c.useEffect(()=>{const s=new st({title:n??"",margin:5,maxWidth:300}),r=new Mn({legend:s,collapsed:t===void 0?!0:t});i.addControl(r);const u=new st({margin:4});return e.forEach(g=>{u.addItem({title:g.title,style:g.style,typeGeom:"Polygon"})}),s.addItem(u),()=>{i.removeControl(r)}},[i,e,n,t]),o.jsx(o.Fragment,{})};function Si(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:r}=e,u=g=>f=>{s(f,g)};return o.jsx(_n,{children:o.jsxs(Z.TableRow,{children:[r&&o.jsx(Z.TableCell,{}),n.map(g=>o.jsx(Z.TableCell,{align:g.numeric?"right":"left",padding:g.disablePadding?"none":"default",sortDirection:i===g.id?t:!1,children:o.jsx(Z.TableSortLabel,{active:i===g.id,direction:i===g.id?t:"asc",onClick:u(g.id),children:g.label})},g.id))]})})}const bi=at.createSvgIcon(ut.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Li=at.createSvgIcon(ut.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Mi(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:r,isCollapseable:u,collapsedElement:g}=e,[f,y]=c.useState(!1),T=n.length,_=()=>{s==null||s(r)};return o.jsxs(o.Fragment,{children:[o.jsxs(Z.TableRow,{hover:!0,selected:t,onClick:_,children:[u&&o.jsx(Z.TableCell,{padding:"checkbox",children:o.jsx(Z.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),y(!f)},children:f?o.jsx(Li,{}):o.jsx(bi,{})})}),n.map(b=>o.jsx(Z.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(i[b.id]):i[b.id]},b.id+r.toString()))]}),u&&o.jsx(Z.TableRow,{children:o.jsx(Z.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:T+1,children:o.jsx(Z.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:g==null?void 0:g(i)})})})]})}function _i(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:r,items:u,onRequestSort:g,onRowSelected:f,isCollapseable:y,collapsedElement:T,isDense:_,page:b,rowsPerPage:D,count:x,handleChangePage:W,handleChangeRowsPerPage:Q}=e,H=(K,Y)=>{const k=n===Y&&i==="asc";s(k?"desc":"asc"),t(Y),g(Y,k?"desc":"asc")};return o.jsxs(Z.TableContainer,{component:Z.Paper,children:[o.jsxs(Z.Table,{size:_?"small":"medium",children:[o.jsx(Si,{headCells:r,onRequestSort:H,order:i,orderBy:n,isCollapseable:y}),o.jsxs(Z.TableBody,{children:[u.map((K,Y)=>o.jsx(Mi,{item:K,rowIndex:Y,isCollapseable:y,cellsMetadata:r,collapsedElement:T,isRowSelected:!1,onRowSelected:f},Y)),(u.length===0||D>u.length)&&o.jsx(Z.TableRow,{style:{height:(_?33:53)*(D-u.length)},children:o.jsx(Z.TableCell,{colSpan:y?r.length+1:r.length,children:u.length===0&&o.jsx(Z.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(Z.TablePagination,{rowsPerPage:D,rowsPerPageOptions:[5,10],component:"div",count:x,page:b,onPageChange:W,onRowsPerPageChange:Q})]})}const Pi=e=>{const{children:n,...t}=e;return o.jsx(Pn,{...t,children:n})},Ii=e=>{const{children:n,...t}=e;return o.jsx(In,{...t,children:n})},Bt=e=>e*Math.PI/180,Be=e=>e*(180/Math.PI),Ai=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(Bt(85.362/2))/Math.sin(Bt(85.362/2))),oo="",Ft=(e,n,t)=>{let i;if(e.scene.mode!==S.SceneMode.SCENE2D)i=e.scene.pickPosition(new S.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;i=e.camera.pickEllipsoid(new S.Cartesian2(n,t),s)}return S.Cartographic.fromCartesian(i)},Di=(e,n,t)=>{const i=Ft(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]}}},Vt=(e,n,t)=>{try{const i=Ft(e,n,t);return{longitude:S.Math.toDegrees(i.longitude),latitude:S.Math.toDegrees(i.latitude)}}catch{return}};class Oi extends S.PolylineDashMaterialProperty{}class ki extends S.ConstantProperty{}class xi extends S.ConstantPositionProperty{}class Ni extends S.Cartesian2{}class Bi extends S.Cartesian3{}class Gt extends S.Cartographic{}class Fi extends S.BoundingSphere{}class Vi extends S.Ellipsoid{}class Gi extends S.GeographicTilingScheme{}class Hi extends S.Rectangle{}class zi extends S.Resource{}class Wi extends S.EllipsoidTerrainProvider{}class $i extends S.CesiumTerrainProvider{}const qi=S.VerticalOrigin,Ui=S.LabelStyle,Ht=e=>{const n=re(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(r=>{if(r!=null&&r.endPosition){const u={...r.endPosition};u.x=Math.ceil(u.x),u.y=Math.ceil(u.y),s(u)}},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const r=n.scene.globe.ellipsoid;if(i){const u=Vt(n,i.x,i.y);if(u){const g=new Gt(u.longitude,u.latitude);if(t.current){let f="";switch(e.projection){case pe.WEB_MERCATOR:{const T=new S.WebMercatorProjection(r).project(g);f=`Mercator: ${T.y.toFixed(Ne)}m, ${T.x.toFixed(Ne)}m`,t.current.style.width="220px";break}case pe.WGS84:{const y=g.longitude.toFixed(xe);f=`WGS84: ${g.latitude.toFixed(xe)}°N ${y}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[i,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},so="",Ze=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],ji=(e,n,t,i)=>{const s=z.get(i,"METERS_UNIT")??"m",r=z.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},g=new S.EllipsoidGeodesic,f=new Date().getTime();if(f<u.lastLegendUpdate+250)return;u.lastLegendUpdate=f;const y=e.scene.canvas.clientWidth,T=e.scene.canvas.clientHeight,_=e.scene.camera.getPickRay(new S.Cartesian2(y/2|0,T-1)),b=e.scene.camera.getPickRay(new S.Cartesian2(1+y/2|0,T-1)),D=e.scene.globe,x=D.pick(_,e.scene),W=D.pick(b,e.scene);if(!x||!W)return;const Q=D.ellipsoid.cartesianToCartographic(x),H=D.ellipsoid.cartesianToCartographic(W);g.setEndPoints(Q,H);const K=g.surfaceDistance,Y=100;let k;for(let q=Ze.length-1;!z.isNumber(k)&&q>=0;--q)Ze[q]/K<Y&&(k=Ze[q]);if(z.isNumber(k)){let q="";k>=1e3?q=`${(k/1e3).toString()} ${r}`:q=`${k.toString()} ${s}`,u.barWidth=k/K|0,u.distanceLabel=q}t(u)},zt=e=>{const n=re(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const r=f=>{ji(n,t,i,e.locale)},u=new S.EventHelper,g=f=>{n.scene.globe.tilesLoaded&&(r(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,g),n.camera.moveEnd.addEventListener(r),()=>{try{z.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(r)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[n,e.locale,t]);const s=r=>5+(125-r)/2;return o.jsx("div",{className:"scalePosition",children:z.isNumber(t.barWidth)&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scale-tracker-label",children:o.jsx("bdi",{children:t.distanceLabel})}),o.jsx("div",{className:"scale-tracker-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},ao="",Wt=(e,n)=>{const i=z.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,r=n.canvas.height,u=z.get(n.camera.frustum,"sseDenominator")??1;for(let g=0;g<=19;g++)if(i.getLevelMaximumGeometricError(g)*r/(e*u)<s.maximumScreenSpaceError)return g;return null},Ki=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let r=1e8;r>i;r=r-i){const u=Wt(r,n);if(u===null)break;if(u!==s){let g=r,f=r+i;for(;f-g>e;)r=g+(f-g)/2,Wt(r,n)===u?g=r:f=r;t.push({level:u,height:Math.round(r)}),s=u,t.length>=2&&(i=(t[t.length-2].height-r)/1e3)}}return t},$t=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=re(),[i,s]=c.useState(1),r=Ki(1,t),u=c.useCallback(()=>{const T=t.camera,_=.5;let b=0;switch(t.scene.mode){case ie.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(T.positionWC).height;break;case ie.SCENE2D:b=(T.frustum.right-T.frustum.left)*_;break;case ie.COLUMBUS_VIEW:b=T.position.z;break;default:b=0;break}if(r.length>0){const D=r.reduce((x,W)=>Math.abs(W.height-b)<Math.abs(x.height-b)?W:x);s(D.level)}},[t,r]),g=c.useCallback(()=>{let T=0;t.scene.globe._surface.forEachRenderedTile(function(_){T=Math.max(T,_.level)}),s(T)},[t]),y=c.useMemo(()=>({CALCULATION:u,RENDERED_TILES:g}),[u,g])[n];return c.useEffect(()=>{const T=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&y()});return t.camera.moveEnd.addEventListener(y),()=>{try{typeof z.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(y),T())}catch(_){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',_)}}},[t,y]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:i}),o.jsx("div",{className:"zoomLevelLabel",children:z.get(e,"ZOOM_LABEL")??"zoom"})]})},lo="",Yi=-1,Xi=e=>{const n=re(),[t,i]=c.useState(),{sceneModes:s}=e,r=u=>s.findIndex(g=>g===u)>Yi;return c.useEffect(()=>{i(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[r(ie.SCENE3D)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z"})})}),onClick:()=>{n.scene.morphTo3D(),i(ie.SCENE3D)}}),r(ie.SCENE2D)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z"})})}),onClick:()=>{n.scene.morphTo2D(),i(ie.SCENE2D)}}),r(ie.COLUMBUS_VIEW)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z"})})}),onClick:()=>{n.scene.morphToColumbusView(),i(ie.COLUMBUS_VIEW)}})]})},co="",Zi=ve.makeStyles(e=>ve.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Ji=e=>{const n=re(),{baseMaps:t}=e,[i,s]=c.useState(" "),[r,u]=c.useState(),g=Zi();c.useEffect(()=>{const y=t==null?void 0:t.maps.find(T=>T.isCurrent);y&&(u(y),s(y.title!==void 0?y.title:" "))},[t]);const f=y=>{var T,_;if(t){(T=n.layersManager)==null||T.removeBaseMapLayers();const b=t.maps.find(D=>D.id===y);b&&((_=n.layersManager)==null||_.setBaseMapLayers(b),u(b),t.maps.forEach(D=>{D.isCurrent=b===D}))}};return o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mapLabel",children:i}),o.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(y=>o.jsx("li",{className:`mapContainer ${g.mapContainer} ${y===r?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:y.thumbnail,onMouseOver:()=>{s(y.title)},onMouseOut:()=>{s((r==null?void 0:r.title)!==void 0?r.title:" ")},onClick:()=>{f(y.id)}})},y.id))})]})},uo="",Je="ic_settings_24px",Qi=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:r}=e,u=c.useRef(null),g=z.get(r,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=z.get(r,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",y=z.get(r,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const T=_=>{var x;const b=_.target,D=z.get(u,"current");D&&!D.contains(b)&&b.id!==Je&&((x=b.parentElement)==null?void 0:x.id)!==Je&&(document.removeEventListener("click",T,!1),t(!1))};return document.addEventListener("click",T,!1),()=>{document.removeEventListener("click",T,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(G.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Je,x:"288",y:"24",children:o.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!n)}}),n&&o.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:o.jsxs(G.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(G.DialogTitle,{children:g}),o.jsxs(G.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(ce,{className:"mapScenesContainer",children:o.jsx(Xi,{sceneModes:i})}),o.jsx(ce,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:y}),o.jsx(Ji,{baseMaps:s})]})})]})]})})]})},ho="",Ri=()=>{const e=re(),n=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return o.jsx("div",{className:"zoom-buttons-container",children:n.map(t=>o.jsx(G.Icon,{icon:o.jsx("div",{className:"zoom-button",children:o.jsx("svg",{fill:"#fff",width:"10px",height:"10px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:o.jsx("path",{d:t.iconPath})})}),onClick:t.onClick}))})},go="",er=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:o.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),o.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),tr=({onClick:e})=>o.jsx(ce,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(G.Icon,{icon:er,className:"mapLegendIcon"})}),nr=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const r=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const y=o.jsx(ce,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(G.Tooltip,{content:t,children:y}):y},[t]),g=c.useCallback(()=>[typeof e=="string"&&o.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&o.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return o.jsxs(ce,{className:"mapLegend",children:[u(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:r}),o.jsx(ce,{className:"legendActionsContainer",children:g()})]})},ir=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>o.jsx(ce,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),r=c.useCallback(()=>e.length?e.map((u,g)=>o.jsx(nr,{legend:u,docText:n,imgText:t},`${u.layer}_${g}`)):s(),[e]);return o.jsx(ce,{className:"mapLegendsList",children:r()})},rr=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:r=[]})=>e?o.jsxs(G.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(G.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(G.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(G.DrawerContent,{className:"sidebarContent",children:[o.jsx(G.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(ir,{noLegendsText:i,legends:r,actionsTexts:s})]})]}):null,ye=document.createElement("canvas"),le=ye.getContext("2d"),qt=e=>{const i=(e==null?void 0:e.data)??[];for(let s=3;s<i.length;s+=4)if(i[s]<255)return!0;return!1},or=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{try{le==null||le.clearRect(0,0,ye.width,ye.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){ye.width=e.width,ye.height=e.height,le==null||le.drawImage(e,0,0);const r=le==null?void 0:le.getImageData(0,0,ye.width,ye.height),u=qt(r);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{ye.width=s.width,ye.height=s.height,le==null||le.drawImage(s,0,0);const r=le==null?void 0:le.getImageData(0,0,ye.width,ye.height);qt(r)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Fe=(e,n)=>{const{west:t,east:i,north:s,south:r}=e,{west:u,east:g,north:f,south:y}=n;return t>=u&&i<=g&&s<=f&&r>=y},Ve=3,Ge="hasTransparency";function Qe(e,n,t,i,s){return setTimeout(()=>{var g;const r=(g=this.layerListInstance.find(f=>{var y,T;return((y=f._imageryProvider._resource)==null?void 0:y._url)===((T=this._resource)==null?void 0:T._url)}))==null?void 0:g.meta,u=z.get(r,Ge)===!0;this.tileTransparencyCheckedCounter<Ve&&!u&&or(s==null?void 0:s.url,this).then(f=>{var y;(y=this.mapViewer.layersManager)==null||y.addMetaToLayer({[Ge]:f},T=>T._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class Ut extends S.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Ve);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}class jt extends S.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Ve);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}class Kt extends S.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);ee(this,"layerListInstance");ee(this,"mapViewer");ee(this,"maxTilesForTransparencyCheck",Ve);ee(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}const sr=1,ar=-1,Yt="TRANSPARENT_BASE_LAYER";class lr{constructor(n,t,i,s){ee(this,"mapViewer");ee(this,"legendsList");ee(this,"layerUpdated");ee(this,"layers");ee(this,"legendsExtractor");ee(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,this.layerManagerFootprintMetaFieldPath=s,i&&this.layerUpdated.addEventListener(i,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(r=>{const u=Object.keys(r);u.length===1&&u[0]===Ge&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}addMetaToLayer(n,t){const i=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(i).then(s=>{const r=this.layers.find(t);r&&(r.meta={...r.meta??{},...n},this.setLegends(),this.layerUpdated.raiseEvent(n))})}setBaseMapLayers(n){n.baseRasteLayers.sort((i,s)=>i.zIndex-s.zIndex).forEach((i,s)=>{this.addRasterLayer(i,s,n.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(Yt),this.addTransparentImageryProvider())}addRasterLayer(n,t,i){let s;switch(n.type){case"XYZ_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Ut(r,this.mapViewer):new S.UrlTemplateImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new jt(r,this.mapViewer):new S.WebMapServiceImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Kt(r,this.mapViewer):new S.WebMapTileServiceImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}s&&(s.alpha=n.opacity,s.meta={parentBasetMapId:i,...n},n.show!==void 0&&(s.show=n.show))}removeLayer(n){const t=this.findLayerById(n);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!z.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!z.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex;if(i)for(let r=0;r<t;r++)this.mapViewer.imageryLayers.raise(i);this.updateLayersOrder(n,s,s+t)}lower(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex,r=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=r&&(t=u-r),i)for(let g=0;g<t;g++)this.mapViewer.imageryLayers.lower(i);this.updateLayersOrder(n,s,s-t)}raiseToTop(n){const t=this.findLayerById(n),i=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(n,i,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(n){const t=this.findLayerById(n),i=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(n,s-i)}length(){return this.mapViewer.imageryLayers.length}show(n,t){const i=this.get(n);i!==void 0&&(i.show=t)}showAllNotBase(n){this.layers.filter(i=>!z.get(i.meta,"parentBasetMapId")).forEach(i=>{var s;this.show((s=i.meta)==null?void 0:s.id,n)})}get(n){const t=this.findLayerById(n),i=this.mapViewer.imageryLayers.indexOf(t);return i?this.mapViewer.imageryLayers.get(i):void 0}pickImageryLayers(n){var s;const t=this.mapViewer.camera.getPickRay(n);let i;return t&&(i=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(r=>!z.get(r.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t,i=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Di(this.mapViewer,n,t);return this.layers.filter(g=>!z.get(g.meta,"parentBasetMapId")).filter(g=>{const f=z.get(g.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?Dn(s.geometry,{type:"Feature",properties:{},geometry:f})&&(i?g.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",g.meta),!1)}).sort((g,f)=>{var y,T;return((y=f.meta)==null?void 0:y.zIndex)-((T=g.meta)==null?void 0:T.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:Yt,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!z.get(t.meta,"parentBasetMapId")).length}findLayerById(n){return this.layers.find(t=>t.meta!==void 0?t.meta.id===n:!1)}updateLayersOrder(n,t,i){const s=t>i?sr:ar,r=t<i?t:i,u=t<i?i:t;this.layers.forEach(g=>{var y;if(!z.get(g.meta,"parentBasetMapId")){const T=(y=g.meta)==null?void 0:y.zIndex;g.meta.zIndex=T>=r&&T<=u&&T!==t?T+s:T===t?i:T}})}hideNonRelevantLayers(){var n,t;for(const i of this.layers)((n=i.meta)==null?void 0:n.relevantToExtent)!==i.show&&i.imageryProvider.ready&&(i.show=((t=i.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var n,t;try{const i=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const r=this.layers[s],u=!z.isEmpty(i)&&!z.isEmpty(r.rectangle)&&S.Rectangle.intersection(i,r.rectangle);for(let g=this.layers.length-1;g>=s;g--){if(((n=r.meta)==null?void 0:n.skipRelevancyCheck)===!0){r.meta={...r.meta,relevantToExtent:!0};continue}const f=this.layers[g],y=((t=f.meta)==null?void 0:t[Ge])===!0;if(r!==f)if(u instanceof S.Rectangle){if(Fe(i,r.rectangle))if(Fe(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}else r.meta={...r.meta??{},relevantToExtent:!0};if(Fe(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}if(Fe(r.rectangle,f.rectangle)){if(r.meta={...r.meta??{},relevantToExtent:y},!y)break}else r.meta={...r.meta??{},relevantToExtent:!0}}else r.meta={...r.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(r.meta={...r.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(i){console.error(i)}}}const po="",fo="",cr=e=>{const n=re(),{enableCompass:t=!0,enableZoomControls:i=!1,lockCompassNavigation:s=!1,locale:r={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof z.get(n,"cesiumNavigation")>"u"){n.extend(On,{enableCompass:t,enableZoomControls:i,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const u=document.querySelector(".compass");u&&r.DIRECTION&&u.classList.add(r.DIRECTION)}},[n,t,i,r.DIRECTION,s]),null},Xt=212,Zt=260,dr=0;class ur extends S.Viewer{constructor(t,i){super(t,i);ee(this,"layersManager");ee(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Jt=c.createContext(null),hr=Jt.Provider,re=()=>{const e=c.useContext(Jt);if(e===null)throw new Error("map context is null, please check the provider");return e},gr=e=>{var $,te,se,Ce,fe,de,he,Ie;const n=c.useRef(null),[t,i]=c.useState(),[s,r]=c.useState(),[u,g]=c.useState(),[f,y]=c.useState(),[T,_]=c.useState(),[b,D]=c.useState(),[x,W]=c.useState(),[Q,H]=c.useState(!1),[K,Y]=c.useState(),k=c.useRef(),[q,N]=c.useState(),[U,oe]=c.useState([]),[a,l]=c.useState(),[C,h]=c.useState(!1),E=c.useRef(),[p,w]=c.useState(void 0),[v,L]=c.useState(!1),[I,P]=c.useState(),[M,A]=c.useState(),O={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},j=(X,V,ne,we,Se)=>{const Me=t.container,gn=Me.clientWidth,pn=Me.clientHeight,fn=we+Se;return{left:`${gn-X<ne?X-(ne-(gn-X)):X}px`,top:`${pn-V<fn?V-(fn-(pn-V)):V}px`}},J=c.useCallback(X=>{if(n.current!==null){const V=n.current.cesiumElement,ne={x:X.offsetX,y:X.offsetY};h(!1),w(ne),P(Vt(V,ne.x,ne.y)),h(!0),E.current=X}},[n]);c.useEffect(()=>{var X;if(n.current!==null){const V=n.current.cesiumElement;e.imageryContextMenu&&(V.scene.canvas.removeEventListener("contextmenu",J),V.scene.canvas.addEventListener("contextmenu",J))}i((X=n.current)==null?void 0:X.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var X;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new lr(t,(X=e.legends)==null?void 0:X.mapLegendsExtractor,()=>{var V;oe((V=t.layersManager)==null?void 0:V.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{N(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var V,ne;l(e.baseMaps);const X=(V=e.baseMaps)==null?void 0:V.maps.find(we=>we.isCurrent);X&&t&&((ne=t.layersManager)==null||ne.setBaseMapLayers(X))},[e.baseMaps,t]),c.useEffect(()=>{r(e.projection??pe.WGS84)},[e.projection]),c.useEffect(()=>{Y(e.locale)},[e.locale]),c.useEffect(()=>{g(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{y(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{_(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{D(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{W(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{const X=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const V=()=>{const ne=t.camera.positionCartographic;return{longitude:Be(ne.longitude),latitude:Be(ne.latitude),height:ne.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const ne=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),we=t.scene.camera.getPickRay(ne),Se=t.scene.globe.pick(we,t.scene);if(!Se)return{longitude:0,latitude:0,height:0};const Me=t.scene.globe.ellipsoid.cartesianToCartographic(Se);return Me!==void 0?{longitude:Be(Me.longitude),latitude:Be(Me.latitude),height:t.scene.camera.positionCartographic.height}:V()}else return V()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==S.SceneMode.MORPHING){const V=t.camera,ne={position:X(),direction:V.direction.clone(),up:V.up.clone(),right:V.right.clone(),transform:V.transform.clone(),frustum:V.frustum.clone()};k.current=ne}}),x&&t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded===!0?H(!1):H(!0)}))},[t]),c.useEffect(()=>{const X=()=>{if(t&&k.current){const V=k.current;t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V.position.longitude,V.position.latitude,V.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(X),()=>{if(t)try{t.scene.morphComplete.removeEventListener(X)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const X=e.zoom,V=e.center;t&&z.isNumber(X)&&z.isArray(V)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V[0],V[1],Ai(X)),duration:0})},[e.zoom,e.center,t]),c.useEffect(()=>{A(e.displayZoomButtons??!0)},[e.displayZoomButtons]);const B=c.useCallback(()=>t&&An.createPortal(o.jsxs(o.Fragment,{children:[x&&Q&&o.jsx(G.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),o.jsxs(ce,{className:"sideToolsContainer",children:[o.jsx(Qi,{sceneModes:q,baseMaps:a,locale:K}),o.jsx(tr,{onClick:()=>L(!v)})]}),o.jsxs(ce,{className:"toolsContainer",children:[u&&o.jsx(Ht,{projection:s}),f&&o.jsx($t,{locale:K,valueBy:"RENDERED_TILES"}),T&&o.jsx(zt,{locale:K}),b&&o.jsx(cr,{locale:K})]}),M&&o.jsx(Ri,{})]}),document.querySelector(".cesium-viewer")),[a,K,t,s,q,u,T,v,Q]);return o.jsx(me.Viewer,{className:"viewer",full:!0,ref:n,...O,children:o.jsxs(hr,{value:t,children:[o.jsx(rr,{title:($=e.legends)==null?void 0:$.title,isOpen:v,toggleSidebar:()=>L(!v),noLegendsText:(te=e.legends)==null?void 0:te.emptyText,legends:((se=e.legends)==null?void 0:se.legendsList)??U,actionsTexts:(Ce=e.legends)==null?void 0:Ce.actionsTexts}),e.children,B(),e.imageryContextMenu&&C&&p&&I&&c.cloneElement(e.imageryContextMenu,{data:(fe=t==null?void 0:t.layersManager)==null?void 0:fe.findLayerByPOI(p.x,p.y,!1),position:{x:p.x,y:p.y},coordinates:I,style:j(p.x,p.y,((de=e.imageryContextMenuSize)==null?void 0:de.width)??Zt,((he=e.imageryContextMenuSize)==null?void 0:he.height)??Xt,((Ie=e.imageryContextMenuSize)==null?void 0:Ie.dynamicHeightIncrement)??dr),size:e.imageryContextMenuSize??{height:Xt,width:Zt},handleClose:()=>{h(!C)},contextEvt:E.current})]})})},pr=0,fr=e=>{const n=re();return o.jsx(me.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const i=n.scene;i.globe.depthTestAgainstTerrain=!0;const s=S.Cartographic.fromCartesian(t.boundingSphere.center),r=e.heightFromGround??pr;if(r){const u=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),g=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+r),f=S.Cartesian3.subtract(g,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(f)}}})},He=180,Qt=.001,Rt=e=>Math.abs(e)/e,en=e=>{He-Math.abs(e[0])<Qt&&(e[0]=Rt(e[0])*(He-1)),He/2-Math.abs(e[1])<Qt&&(e[1]=Rt(e[1])*(He/2-1))},tn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{en(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{en(t)})});break}},mr=e=>{const{data:n,...t}=e,i=z.cloneDeep(n);return i&&(typeof i.features<"u"?i.features.forEach(s=>{tn(s.geometry)}):tn(i)),o.jsx(me.GeoJsonDataSource,{data:i,...t})},Pe=e=>{const{meta:n,...t}=e,i=re();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),o.jsx(me.ImageryLayer,{...t})},yr=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new jt(n,i):new S.WebMapServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},vr=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new Kt(n,i):new S.WebMapTileServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Er=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new Ut(n,i):new S.UrlTemplateImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Cr=e=>{const{options:n,...t}=e;return o.jsx(Pe,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(n)})},nn=e=>o.jsx(me.Entity,{...e}),Tr=e=>o.jsx(me.EntityDescription,{...e}),rn=e=>o.jsx(me.EntityDescription,{...e}),on=e=>o.jsx(me.PolygonGraphics,{...e}),sn=e=>o.jsx(me.RectangleGraphics,{...e}),an=e=>o.jsx(me.CustomDataSource,{...e}),wr=e=>o.jsx(me.PolylineGraphics,{...e}),mo="";var Ee=function(){var e=m.Ellipsoid.WGS84,n,t=m.Material.fromType(m.Material.ColorType);function i(a,l=new m.Color(1,1,0,.5),C=new m.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=C,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,C=new m.ScreenSpaceEventHandler(a.canvas);function h(p,w){if(l._handlersMuted!=!0){var v=a.pick(w);v&&v.primitive&&v.primitive[p]&&v.primitive[p](w)}}C.setInputAction(function(p){h("leftClick",p.position)},m.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(p){h("leftDoubleClick",p.position)},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var E;C.setInputAction(function(p){if(l._handlersMuted!=!0){var w=a.pick(p.endPosition);E&&(!w||E!=w.primitive)&&(!(E.isDestroyed&&E.isDestroyed())&&E.mouseOut(p.endPosition),E=null),w&&w.primitive&&(w=w.primitive,w.mouseOut&&(E=w),w.mouseMove&&w.mouseMove(p.endPosition))}},m.ScreenSpaceEventType.MOUSE_MOVE),C.setInputAction(function(p){h("leftUp",p.position)},m.ScreenSpaceEventType.LEFT_UP),C.setInputAction(function(p){h("leftDown",p.position)},m.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,C){a[l]=C},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;U(a,"mouseMove",function(C){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(C,"Click to edit this shape")}),U(a,"mouseOut",function(C){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),U(a,"leftClick",function(C){a.setEditMode(!0)})},i.prototype.startDrawing=function(a){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=a,this.muteHandlers(!0)},i.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},i.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},i.prototype.setHighlighted=function(a){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=a&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=a},i.prototype.disableAllEditMode=function(){this.setEdited(void 0)},i.prototype.setEdited=function(a){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=a};var s={ellipsoid:m.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},r=N(s,{appearance:new m.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=N(s,{}),g=N(s,{}),f=N(s,{}),y=N(r,{rotation:0}),T=N(s,{width:5,geodesic:!0,granularity:1e4,appearance:new m.PolylineMaterialAppearance({aboveGround:!1}),material:t}),_=function(){function a(){}return a.prototype.initialiseOptions=function(l){q(this,l),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},a.prototype.setAttribute=function(l,C){this[l]=C,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,C,h){if(!m.defined(this.ellipsoid))throw new m.DeveloperError("this.ellipsoid must be defined.");if(!m.defined(this.appearance))throw new m.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new m.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!m.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var E=this.getGeometry();if(!E)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:E,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:m.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new m.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var p=this._primitive;p.appearance.material=this.material,p.debugShowBoundingVolume=this.debugShowBoundingVolume,p.update(l,C,h),this._outlinePolygon&&this._outlinePolygon.update(l,C,h)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),m.destroyObject(this)},a.prototype.setStrokeStyle=function(l,C){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=C)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=C)},a}();i.ExtentPrimitive=function(){function a(l){if(!m.defined(l.extent))throw new m.DeveloperError("Extent is required");l=N(l,r),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new _,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(m.defined(this.extent))return new m.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.RectangleOutlineGeometry({rectangle:this.extent})},a}(),i.PolygonPrimitive=function(){function a(l){l=N(l,r),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new _,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<3))return m.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return m.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),i.CirclePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.radius)))throw new m.DeveloperError("Center and radius are required");l=N(l,r),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new _,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setRadius=function(l){this.setAttribute("radius",Math.max(.1,l))},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getRadius=function(){return this.getAttribute("radius")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.radius))return new m.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),i.EllipsePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.semiMajorAxis)&&m.defined(l.semiMinorAxis)))throw new m.DeveloperError("Center and semi major and semi minor axis are required");l=N(l,y),this.initialiseOptions(l)}return a.prototype=new _,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setSemiMajorAxis=function(l){l<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",l)},a.prototype.setSemiMinorAxis=function(l){l>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",l)},a.prototype.setRotation=function(l){return this.setAttribute("rotation",l)},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},a.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},a.prototype.getRotation=function(){return this.getAttribute("rotation")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.semiMajorAxis)&&m.defined(this.semiMinorAxis))return new m.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),i.PolylinePrimitive=function(){function a(l){l=N(l,T),this.initialiseOptions(l)}return a.prototype=new _,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.setWidth=function(l){this.setAttribute("width",l)},a.prototype.setGeodesic=function(l){this.setAttribute("geodesic",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getWidth=function(){return this.getAttribute("width")},a.prototype.getGeodesic=function(l){return this.getAttribute("geodesic")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<2))return new m.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var b={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},D={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},x={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,C){var h=new i.BillboardGroup(this,l);return h.addBillboards(a,C),h},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=N(l,b);var C=new m.BillboardCollection;this._scene.primitives.add(C),this._billboards=C,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var C=this._billboards.add({show:!0,position:a,pixelOffset:new m.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new m.Cartesian3(0,0,0),horizontalOrigin:m.HorizontalOrigin.CENTER,verticalOrigin:m.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(l){let p=function(v){E.enableRotate=v},w=function(){for(var v=0,L=h._orderedBillboards.length;v<L&&h._orderedBillboards[v]!=C;++v);return v};var h=this,E=this._scene.screenSpaceCameraController;if(l.dragHandlers){var h=this;U(C,"leftDown",function(L){function I(A){C.position=A;for(var O=0,j=h._orderedBillboards.length;O<j&&h._orderedBillboards[O]!=C;++O);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(w(),A)}function P(A){M.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(w(),A)}var M=new m.ScreenSpaceEventHandler(h._scene.canvas);M.setInputAction(function(A){var O=h._scene.camera.pickEllipsoid(A.endPosition,e);O?I(O):P(O)},m.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(A){P(h._scene.camera.pickEllipsoid(A.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(w(),h._scene.camera.pickEllipsoid(L,e))})}l.onDoubleClick&&U(C,"leftDoubleClick",function(v){l.onDoubleClick(w())}),l.onClick&&U(C,"leftClick",function(v){l.onClick(w())}),l.tooltip&&(U(C,"mouseMove",function(v){h._drawHelper._tooltip.showAt(v,l.tooltip())}),U(C,"mouseOut",function(v){h._drawHelper._tooltip.setVisible(!1)}))}return C},i.BillboardGroup.prototype.insertBillboard=function(a,l,C){this._orderedBillboards.splice(a,0,this.createBillboard(l,C))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var C=0;C<a.length;C++)this.addBillboard(a[C],l)},i.BillboardGroup.prototype.updateBillboardsPositions=function(a){for(var l=0;l<a.length;l++)this.getBillboard(l).position=a[l]},i.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},i.BillboardGroup.prototype.getBillboard=function(a){return this._orderedBillboards[a]},i.BillboardGroup.prototype.removeBillboard=function(a){this._billboards.remove(this.getBillboard(a)),this._orderedBillboards.splice(a,1)},i.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},i.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},i.prototype.startDrawingMarker=function(l){var l=N(l,b);this.startDrawing(function(){p.remove(),w.destroy(),E.setVisible(!1)});var C=this,h=this._scene;h.primitives;var E=this._tooltip,p=new i.BillboardGroup(this,l),w=new m.ScreenSpaceEventHandler(h.canvas);w.setInputAction(function(v){if(v.position!=null){var L=h.camera.pickEllipsoid(v.position,e);L&&(p.addBillboard(L),C.stopDrawing(),l.callback(L))}},m.ScreenSpaceEventType.LEFT_CLICK),w.setInputAction(function(v){var L=v.endPosition;if(L!=null){var I=h.camera.pickEllipsoid(L,e);I?E.showAt(L,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(I))):E.showAt(L,"<p>Click on the globe to add your marker.</p>")}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=N(l,r);this.startDrawingPolyshape(!0,l)},i.prototype.startDrawingPolyline=function(l){var l=N(l,T);this.startDrawingPolyshape(!1,l)},i.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){E.remove(v),I.remove(),P.destroy(),p.setVisible(!1),H(h)});var C=this,h=this._scene,E=h.primitives,p=this._tooltip,w=a?3:2,v;a?v=new Ee.PolygonPrimitive(l):v=new Ee.PolylinePrimitive(l),v.asynchronous=!1,E.add(v);var L=[],I=new i.BillboardGroup(this,b),P=new m.ScreenSpaceEventHandler(h.canvas);Q(h),P.setInputAction(function(M){if(M.position!=null){var A=h.camera.pickEllipsoid(M.position,e);A&&(L.length==0&&(L.push(A.clone()),I.addBillboard(L[0])),L.length>=w&&(v.positions=L,v._createPrimitive=!0),L.push(A),I.addBillboard(A))}},m.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(M){var A=M.endPosition;if(A!=null)if(L.length==0)p.showAt(A,"<p>Click to add first point</p>");else{var O=h.camera.pickEllipsoid(A,e);O&&(L.pop(),O.y+=1+Math.random(),L.push(O),L.length>=w&&(v.positions=L,v._createPrimitive=!0),I.getBillboard(L.length-1).position=O,p.showAt(A,"<p>Click to add new point ("+L.length+")</p>"+(L.length>w?"<p>Double click to finish drawing</p>":"")))}},m.ScreenSpaceEventType.MOUSE_MOVE),P.setInputAction(function(M){var A=M.position;if(A!=null){if(L.length<w+2)return;var O=h.camera.pickEllipsoid(A,e);O&&(H(h),C.stopDrawing(),typeof l.callback=="function"&&(L.length-1,l.callback(L)))}},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function W(a){return e.cartographicArrayToCartesianArray([m.Rectangle.northwest(a),m.Rectangle.northeast(a),m.Rectangle.southeast(a),m.Rectangle.southwest(a)])}function Q(a){a&&(a.canvas.style.cursor="crosshair")}function H(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=N(l,r);this.startDrawing(function(){v!=null&&E.remove(v),L!=null&&L.remove(),I.destroy(),p.setVisible(!1),H(h)});var C=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=null,I=new m.ScreenSpaceEventHandler(h.canvas);Q(h);function P(M){v==null&&(v=new Ee.ExtentPrimitive({extent:M,material:l.material}),v.asynchronous=!1,E.add(v)),v.setExtent(M);var A=W(M);L==null?(L=new i.BillboardGroup(C,b),L.addBillboards(A)):L.updateBillboardsPositions(A)}I.setInputAction(function(M){if(M.position!=null){var A=h.camera.pickEllipsoid(M.position,e);if(A)if(v==null){w=e.cartesianToCartographic(A);var O=K(w,w);P(O)}else C.stopDrawing(),typeof l.callback=="function"&&l.callback(K(w,e.cartesianToCartographic(A)))}},m.ScreenSpaceEventType.LEFT_DOWN),I.setInputAction(function(M){var A=M.endPosition;if(A!=null)if(v==null)p.showAt(A,"<p>Click to start drawing rectangle</p>");else{var O=h.camera.pickEllipsoid(A,e);if(O){var j=K(w,e.cartesianToCartographic(O));P(j),p.showAt(A,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingCircle=function(l){var l=N(l,r);this.startDrawing(function(){w!=null&&E.remove(w),v.remove(),L.destroy(),p.setVisible(!1)});var C=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=new m.ScreenSpaceEventHandler(h.canvas);L.setInputAction(function(I){if(I.position!=null){var P=h.camera.pickEllipsoid(I.position,e);P&&(w==null?(w=new i.CirclePrimitive({center:P,radius:0,asynchronous:!1,material:l.material}),E.add(w),v=new i.BillboardGroup(C,b),v.addBillboards([P])):(typeof l.callback=="function"&&l.callback(w.getCenter(),w.getRadius()),C.stopDrawing()))}},m.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(I){var P=I.endPosition;if(P!=null)if(w==null)p.showAt(P,"<p>Click to start drawing the circle</p>");else{var M=h.camera.pickEllipsoid(P,e);M&&(w.setRadius(m.Cartesian3.distance(w.getCenter(),M)),v.updateBillboardsPositions(M),p.showAt(P,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.enhancePrimitives=function(){var a=this;m.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var h=this,E=this;function p(w){a._scene.screenSpaceCameraController.enableRotate=w}U(h,"leftDown",function(w){function v(P){h.position=P,E.executeListeners({name:"drag",positions:P})}function L(P){I.destroy(),p(!0),E.executeListeners({name:"dragEnd",positions:P})}var I=new m.ScreenSpaceEventHandler(a._scene.canvas);I.setInputAction(function(P){var M=a._scene.camera.pickEllipsoid(P.endPosition,e);M?v(M):L(M)},m.ScreenSpaceEventType.MOUSE_MOVE),I.setInputAction(function(P){L(a._scene.camera.pickEllipsoid(P.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1)}),oe(h)};function l(h){a._scene,!(this._highlighted&&this._highlighted==h)&&this._editMode!==!0&&(this._highlighted=h,h?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(m.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function C(h){if(this._editMode!=h)if(a.disableAllHighlights(),h){a.setEdited(this);var E=a._scene,p=this;if(this._markers==null){let O=function(B,$){var te=B-1<0?$.length-1:B-1;te<v.countBillboards()&&(v.getBillboard(te).position=J(te)),te=B,te<v.countBillboards()&&(v.getBillboard(te).position=J(te))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},J=function(B){var $=p.positions;return e.cartographicToCartesian(new m.EllipsoidGeodesic(e.cartesianToCartographic($[B]),e.cartesianToCartographic($[B<$.length-1?B+1:0])).interpolateUsingFraction(.5))};var w=new i.BillboardGroup(a,D),v=new i.BillboardGroup(a,x),L={dragHandlers:{onDrag:function(B,$){p.positions[B]=$,O(B,p.positions),p._createPrimitive=!0},onDragEnd:function(B,$){p._createPrimitive=!0,j()}},onDoubleClick:function(B){p.positions.length<4||(p.positions.splice(B,1),p._createPrimitive=!0,w.removeBillboard(B),v.removeBillboard(B),O(B,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};w.addBillboards(p.positions,L),this._markers=w;for(var I=[],P=0,M=p.positions.length+(this.isPolygon?0:-1);P<M;P++)I.push(J(P));var A={dragHandlers:{onDragStart:function(B,$){this.index=B+1,p.positions.splice(this.index,0,$),p._createPrimitive=!0},onDrag:function(B,$){p.positions[this.index]=$,p._createPrimitive=!0},onDragEnd:function(B,$){w.insertBillboard(this.index,$,L),v.getBillboard(this.index-1).position=J(this.index-1),v.insertBillboard(this.index,J(this.index),A),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};v.addBillboards(I,A),this._editMarkers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(B){var $=E.pick(B.position);$&&$.primitive||p.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop(),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}Ee.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this;h.isPolygon=!1,h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=C;var E=this.width;h.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(E*2)):this.setWidth(E))},h.getExtent=function(){return m.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},oe(h),h.setEditMode(!1)}},Ee.PolygonPrimitive.prototype.setEditable=function(){var h=this;h.asynchronous=!1,a._scene,a.registerEditableShape(h),h.setEditMode=C,h.setHighlighted=l,oe(h),h.setEditMode(!1)},Ee.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;a.registerEditableShape(h),h.asynchronous=!1,h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let L=function(){h.executeListeners({name:"onEdited",extent:h.extent})};var w=new i.BillboardGroup(a,D),v={dragHandlers:{onDrag:function(I,P){var M=w.getBillboard((I+2)%4).position;h.setExtent(K(e.cartesianToCartographic(M),e.cartesianToCartographic(P))),w.updateBillboardsPositions(W(h.extent))},onDragEnd:function(I,P){L()}},tooltip:function(){return"Drag to change the corners of this extent"}};w.addBillboards(W(h.extent),v),this._markers=w,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(I){var P=E.pick(I.position);P&&!P.isDestroyed()&&P.primitive||h.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let I=function(){return m.EllipseOutlineGeometry(e,h.getCenter(),h.getSemiMajorAxis(),h.getSemiMinorAxis(),h.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),semiMajorAxis:h.getSemiMajorAxis(),semiMinorAxis:h.getSemiMinorAxis(),rotation:0})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,A){var O=m.Cartesian3.distance(h.getCenter(),A);M%2==0?h.setSemiMajorAxis(O):h.setSemiMinorAxis(O),v.updateBillboardsPositions(I())},onDragEnd:function(M,A){P()}},tooltip:function(){return"Drag to change the excentricity and radius"}};v.addBillboards(I(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var A=E.pick(M.position);A&&A.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(h){for(var E=m.CircleOutlineGeometry.createGeometry(new m.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:h})),p=0,w,v=[];p<E.attributes.position.values.length;p+=3)w=E.attributes.position.values,v.push(new m.Cartesian3(w[p],w[p+1],w[p+2]));return v},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let I=function(){return w.getCircleCartesianCoordinates(m.Math.PI_OVER_TWO)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),radius:h.getRadius()})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,A){h.setRadius(m.Cartesian3.distance(h.getCenter(),A)),v.updateBillboardsPositions(I())},onDragEnd:function(M,A){P()}},tooltip:function(){return"Drag to change the radius"}};v.addBillboards(I(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var A=E.pick(M.position);A&&A.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,C){if(!m.defined(C.container))throw new m.DeveloperError("Container is required");var h={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:T,polygonDrawingOptions:u,extentDrawingOptions:g,circleDrawingOptions:f};q(C,h);var E=this,p=document.createElement("DIV");p.className="toolbar",C.container.appendChild(p);function w(I,P,M,A){var O=document.createElement("DIV");O.className="button",O.title=M,p.appendChild(O),O.onclick=A;var j=document.createElement("SPAN");O.appendChild(j);var J=document.createElement("IMG");return J.src=P,j.appendChild(J),O}var v=l._scene;w("marker",C.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(I){E.executeListeners({name:"markerCreated",position:I})}})}),w("polyline",C.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(I){E.executeListeners({name:"polylineCreated",positions:I})}})}),w("polygon",C.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(I){E.executeListeners({name:"polygonCreated",positions:I})}})}),w("extent",C.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(I){E.executeListeners({name:"extentCreated",extent:I})}})}),w("circle",C.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(I,P){E.executeListeners({name:"circleCreated",center:I,radius:P})}})});var L=document.createElement("DIV");L.className="divider",p.appendChild(L),w("clear",C.clearIcon,"Remove all primitives",function(){v.primitives.removeAll()}),oe(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=N(l,{container:a}),new i.DrawHelperWidget(this,l)};function K(a,l){var C=new m.Rectangle;C.west=Math.min(a.longitude,l.longitude),C.east=Math.max(a.longitude,l.longitude),C.south=Math.min(a.latitude,l.latitude),C.north=Math.max(a.latitude,l.latitude);var h=m.Math.EPSILON7;return C.east-C.west<h&&(C.east+=h*2),C.north-C.south<h&&(C.north+=h*2),C}function Y(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function k(a,l){if(a==null||typeof a!="object"||a.constructor!=Object&&a.constructor!=Array)return a;if(a.constructor==Date||a.constructor==RegExp||a.constructor==Function||a.constructor==String||a.constructor==Number||a.constructor==Boolean)return new a.constructor(a);l=l||new a.constructor;for(var C in a)l[C]=typeof l[C]>"u"?k(a[C],null):l[C];return l}function q(a,l){a=a||{};var C;for(C in l)a[C]===void 0&&(a[C]=k(l[C]))}function N(a,l){var C=k(a),h;for(h in l)C[h]===void 0&&(C[h]=k(l[h]));return C}function U(a,l,C){a[l]=C}function oe(a){a._listeners={},a.addListener=function(l,C){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(C),this._listeners[l].length},a.executeListeners=function(l,C){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var h=0;h<this._listeners[l.name].length;h++)this._listeners[l.name][h](l);else C&&C(l)}}return i}();const Sr=2,br=(e,n)=>{switch(e){case ae.BOX:{if(n.features.length!==Sr)throw new Error(`${e} must have 2 points`);const t=z.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===Oe.BOTTOM_LEFT}),i=z.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===Oe.TOP_RIGHT});if(i&&t){if(t.geometry.coordinates[0]===i.geometry.coordinates[0]&&t.geometry.coordinates[1]===i.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],i.geometry.coordinates[0],i.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},ln=e=>{const n=e.map(t=>{const i=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},cn=e=>{const n=ht.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return ct(lt(n))},dn=e=>{const n=ht.lineString([[e.west,e.south],[e.east,e.north]]);return ct(lt(n)).geometry.coordinates[0].map(i=>S.Cartesian3.fromRadiansArray(i)[0])};class Lr extends S.Color{}const Mr=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:r,outlineWidth:u}=e,g=re(),[f,y]=c.useState();c.useEffect(()=>{y(new Ee(g,t,i))},[]),c.useEffect(()=>{if(f){const _=f;if(n.drawing)switch(n.type){case ae.POLYGON:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingPolygon({callback:b=>{n.handler({primitive:b,type:ae.POLYGON,geojson:ln(b)})}});break;case ae.BOX:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingExtent({callback:b=>{n.handler({primitive:b,type:ae.BOX,geojson:cn(b)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else _.stopDrawing(),g.scene.globe.depthTestAgainstTerrain=!0}},[n,f]);const T=_=>{try{let b=_.coordinates!==void 0?_.coordinates:br(_.type,_.geojson);if(r!==!0)switch(_.type){case ae.BOX:return o.jsx(sn,{coordinates:b,material:s??t});case ae.POLYGON:return o.jsx(on,{hierarchy:new S.PolygonHierarchy(b),material:s??t});default:return o.jsx(o.Fragment,{})}else{switch(_.type){case ae.BOX:b=dn(b);break;case ae.POLYGON:b=[...b,b[0]];break;default:return o.jsx(o.Fragment,{})}return o.jsx(wr,{clampToGround:!0,positions:b,width:u??1,material:s??t})}}catch(b){return console.error(b),o.jsx(o.Fragment,{})}};return o.jsx(an,{...e,children:e.drawings.map((_,b)=>o.jsxs(nn,{name:_.name,children:[o.jsxs(rn,{children:[o.jsxs("h1",{children:["Drawed Entity ",_.name]}),o.jsx("p",{children:"This is description of drawed entity"})]}),T(_)]},_.id))})},_r=e=>{const n=re();return c.useEffect(()=>{n.extend(S.viewerCesiumInspectorMixin)},[n]),o.jsx(o.Fragment,{})},Pr=-25,un=2,Ir=e=>{const n=re(),t=(r,u=",")=>r.slice(r.indexOf(`
1
+ (function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@turf/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@map-colonies/react-core/dist/linear-progress/styles","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.reactComponents={},d.jsxRuntime,d.React,d.dateFns,d.locale,d.pickers,d.DateFnsUtils,d.styles,d.core,d.reactCore,d.useMediaQuery,d.DatePicker,d.datePickerHebrewLocale,d.moment,d.rewind,d.ol,null,d.coordinate,d.control,d.MousePosition,d.proj,d.layer,d.source,d.format,d.interaction,d.Draw,d.VectorTile,d.style,d.WMTSTileGrid,d.extent,d.OlTileWMS,d.OlXYZ,d.VectorTileSource,d.OlExtLegend,d.OlExtLegendCtrl,null,d.TableHead,d.utils,d.CssBaseline,d.ScopedCssBaseline,d.ReactDOM,d.resium,d.Cesium,d.lodash,d.booleanPointInPolygon,null,d.viewerCesiumNavigationMixin,null,d.turf,d.bbox,d.bboxPolygon,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize))})(this,function(d,o,c,ge,Ae,be,Re,ve,Z,G,mn,et,yn,Le,vn,tt,Zr,nt,We,$e,it,rt,qe,Ue,En,Cn,Tn,De,wn,ot,Sn,bn,Ln,st,Mn,Jr,_n,at,Pn,In,An,me,S,z,Dn,Qr,On,Rr,kn,lt,ct,xn,dt,F,Nn,Bn){"use strict";var Yr=Object.defineProperty;var Xr=(d,o,c)=>o in d?Yr(d,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[o]=c;var R=(d,o,c)=>(Xr(d,typeof o!="symbol"?o+"":o,c),c);function je(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const ut=je(c),m=je(S),ht=je(kn);var ae=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(ae||{}),ue=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(ue||{}),Oe=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Oe||{});const ee={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:ue.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:ue.EN},renderAsButton:!0,offset:0,disableFuture:!0}},ce=e=>{const{children:n,...t}=e;return o.jsx(Z.Box,{...t,children:n})},Ke=e=>{const n=e.type==="dark";return c.useMemo(()=>gt(e,n),[n,e])},gt=(e,n=!1)=>ve.createTheme({palette:{type:n?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:n?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:n?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),eo="",Fn=2,Vn=.5,Gn=ve.makeStyles(e=>ve.createStyles({container:{padding:e.spacing(Fn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Vn)}})),pt=e=>{var Y,k,q,N;const n=Gn(),t=G.useTheme(),i=Ke(t),[s,r]=c.useState(null),[u,g]=c.useState(null),[f,y]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),C=e.controlsLayout??ee.DATE_RANGE_PICKER.controlsLayout,_=e.disableFuture??ee.DATE_RANGE_PICKER.disableFuture,b=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,D=((k=e.local)==null?void 0:k.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,x=((q=e.local)==null?void 0:q.setText)??ee.DATE_RANGE_PICKER.local.setText,Q=(((N=e.local)==null?void 0:N.calendarLocale)??ee.DATE_RANGE_PICKER.local.calendarLocale)===ue.HE?Ae.he:Ae.enUS;c.useEffect(()=>{r(e.from??null)},[e.from]),c.useEffect(()=>{g(e.to??null)},[e.to]),c.useEffect(()=>{y(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const H=Boolean(ge.isValid(s)&&!u||ge.isValid(u)&&!s||s&&u&&ge.isValid(s)&&ge.isValid(u)&&ge.isBefore(s,u)),K=()=>{e.onChange({from:s&&ge.isValid(s)?s:void 0,to:u&&ge.isValid(u)?u:void 0})};return o.jsx(Z.ThemeProvider,{theme:i,children:o.jsx(ce,{className:`${n.container} drpContainer`,display:"flex",flexDirection:C,width:C==="column"?e.contentWidth:"unset",children:o.jsxs(be.MuiPickersUtilsProvider,{utils:Re,locale:Q,children:[o.jsx(be.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:U=>r(U),value:s,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(be.KeyboardDateTimePicker,{variant:"inline",placeholder:D,className:n.margin,onChange:U=>g(U),value:u,disableFuture:_,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(G.ThemeProvider,{options:t,children:o.jsx(G.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:K,disabled:!H,children:x})})]})})})},ft=e=>{const{children:n,...t}=e;return o.jsx(Z.Popover,{...t,children:n})},to="",Hn=e=>{var k,q;const[n,t]=c.useState(null),[i,s]=c.useState(null),[r,u]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),[g,f]=c.useState(null),y=N=>{f(N.currentTarget)},C=N=>{N.currentTarget.tagName==="I"?f(N.currentTarget.previousElementSibling):f(N.currentTarget)},_=()=>{f(null)},b=Boolean(g),D=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const x=((k=e.local)==null?void 0:k.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,W=((q=e.local)==null?void 0:q.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,Q=e.renderAsButton===void 0?ee.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,H=e.offset===void 0?ee.DATE_RANGE_PICKER.offset:e.offset,K=e.disableFuture===void 0?ee.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=c.useMemo(()=>`${n?ge.format(n,r):x} - ${i?ge.format(i,r):W}`,[n,i,r,x,W]);return o.jsxs(o.Fragment,{children:[Q?o.jsx(G.Button,{style:{width:e.width},raised:!0,onClick:y,className:"drpOpener",children:Y}):o.jsx(G.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:C,trailingIcon:{icon:"date_range",tabIndex:0,onClick:C}}),o.jsx(ft,{open:b,anchorEl:g,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(pt,{controlsLayout:D,contentWidth:((g==null?void 0:g.clientWidth)??0)-H,dateFormat:r,disableFuture:K,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:N,to:U})=>{t(N??null),s(U??null),e.onChange({from:N,to:U}),_()}})})]})},ke=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,zn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:r="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:g="",startTimeInputClassName:f="",startTimeLabel:y="",startTimeWrapperClassName:C=""})=>o.jsxs("div",{className:`timeRangeWrapper ${g}`,children:[o.jsx("div",{className:`startTimeWrapper ${C}`,children:o.jsx(G.TextField,{label:y,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Le(n).format("HH:mm"),onChange:_=>{const b=Le(n),D=Le(_.currentTarget.value,"HH:mm"),x=b.set({hours:D.get("hours"),minutes:D.get("minutes")});i(x.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${u}`,children:o.jsx(G.TextField,{label:r,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Le(e).format("HH:mm"),onChange:_=>{const b=Le(e),D=Le(_.currentTarget.value,"HH:mm"),x=b.set({hours:D.get("hours"),minutes:D.get("minutes")});t(x.toDate())}})})]}),Wn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>o.jsx(G.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:r=>{n==null||n(r),t==null||t()},ref:s,value:e})),$n=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[r,u]=c.useState(),g=c.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return c.useEffect(()=>{for(const f of g){const y=i.startDate&&i.endDate&&ge.isSameDay(f.startDate,i.startDate)&&ge.isSameDay(f.endDate,i.endDate);r?f.id===r&&(y||u(void 0)):y&&u(f.id)}},[i,r,g]),o.jsx("div",{className:"shortcutsContainer",children:g.map((f,y)=>{const C=()=>{e(f.startDate),n(f.endDate)};return o.jsx(G.Button,{type:"button",className:`shortcut ${r===f.id?"selected":""}`,onClick:_=>{C(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+y)})})},qn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:r,onChange:u,inputName:g,showMonthYearDropdown:f,withShortcuts:y,locale:C="en"}=e,[_,b]=c.useState(null),[D,x]=c.useState(null),[W,Q]=c.useState(!1),H=r?{startDate:_,endDate:D}:_;c.useEffect(()=>{C==="he"&&et.registerLocale("he",yn)},[C]),c.useEffect(()=>{var k,q;((k=e.startDate)==null?void 0:k.toString())!==(_==null?void 0:_.toString())&&b(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(D==null?void 0:D.toString())&&x(e.endDate)},[e.startDate,e.endDate,_,D]);const K=c.useMemo(()=>{let k="pickerContainer"+(C==="he"?" pickerContainer-rtl":"");return y&&r&&(k+=" pickerContainer-withShortcuts"),k},[C,y,r]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:K,style:{direction:C==="he"?"rtl":"ltr"},children:o.jsx(et,{...e,ref:n,onClickOutside:()=>Q(!1),open:W,startDate:ke(H)?_:void 0,selected:_,endDate:ke(H)?D:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:k=>`pickerWeek ${(i==null?void 0:i(k))??""}`,dayClassName:k=>`pickerDay ${(i==null?void 0:i(k))??""}`,monthClassName:k=>`pickerMonth ${(s==null?void 0:s(k))??""}`,onChange:(k,q)=>{if(Array.isArray(k)){const[N,U]=k;b(N),x(U),u==null||u({startDate:N,endDate:U&&ge.endOfDay(U)},q)}else b(k),u==null||u(k,q)},customInput:o.jsx(Wn,{name:g,onInputClick:()=>{Q(!0)}}),showTimeInput:!!(y&&r),timeInputLabel:"",customTimeInput:y&&ke(H)&&o.jsx($n,{onShortcut:k=>{u==null||u(k),Q(!1)},shortcuts:y,setEndDate:x,setStartDate:b,dateRange:H}),showMonthYearDropdown:void 0,...Y})})}),no="",Un=e=>{const n=G.useTheme(),t=Ke(n),{format:i=ee.DATE_PICKER.dateFormat,variant:s=ee.DATE_PICKER.variant,disableFuture:r=ee.DATE_PICKER.disableFuture,local:u,onChange:g,showTime:f=ee.DATE_PICKER.showTime,value:y,...C}=e,{placeHolderText:_=ee.DATE_PICKER.local.placeHolderText,calendarLocale:b}=u??{placeHolderText:ee.DATE_PICKER.local.placeHolderText,calendarLocale:ue.EN},D=b===ue.HE?Ae.he:Ae.enUS,x=W=>{g(W)};return o.jsx(Z.ThemeProvider,{theme:t,children:o.jsxs(be.MuiPickersUtilsProvider,{utils:Re,locale:D,children:[f&&o.jsx(be.KeyboardDateTimePicker,{variant:s,placeholder:_,onChange:x,value:y,disableFuture:r,format:i,...C}),!f&&o.jsx(be.KeyboardDatePicker,{variant:s,placeholder:_,onChange:x,value:y,disableFuture:r,format:i,...C})]})})},jn=18,Kn=ve.makeStyles(e=>ve.createStyles({drawingButton:{width:e.spacing(jn)},fullWidth:{width:"100%",marginTop:"36px"}})),Yn=e=>{const n=Kn(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:r,onStartDraw:u,onReset:g}=e,f=C=>{i(C.currentTarget)},y=()=>{i(null)};return s?o.jsx(G.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(G.Button,{className:n.drawingButton,raised:!0,onClick:r,children:"Cancel Draw"})}):o.jsxs(ce,{position:"relative",children:[o.jsx(G.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(G.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(G.Menu,{className:n.fullWidth,open:Boolean(t),onClose:y,children:[o.jsx(G.MenuItem,{onClick:()=>{u(ae.POLYGON),y()},children:"Polygon"}),o.jsx(G.MenuItem,{onClick:()=>{u(ae.BOX),y()},children:"Box"}),o.jsx(G.MenuItem,{onClick:()=>{g(),y()},children:"Clear"})]})]})},io="";var pe=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(pe||{});const xe=5,Ne=2,mt=c.createContext(null),Xn=mt.Provider,yt=35,vt=32,Zn=10,Jn=e=>e!==void 0&&e!==pe.WGS84?it.transform([yt,vt],pe.WGS84,e):[yt,vt],Qn=e=>{switch(e){case pe.WEB_MERCATOR:return n=>nt.format(n,"Mercator: {y}m, {x}m",Ne);case pe.WGS84:return n=>nt.format(n,"WGS84: {y}°N {x}°E",xe);default:return n=>""}},Te=()=>{const e=c.useContext(mt);if(e===null)throw new Error("map context is null, please check the provider");return e},Et=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[r]=c.useState(new tt.Map({view:new tt.View({projection:s??pe.WGS84}),controls:We.defaults()}));c.useEffect(()=>{r.getView().setCenter(e.center??Jn(e.projection))},[r,e.center,e.projection]),c.useEffect(()=>{r.getView().setZoom(e.zoom??Zn)},[r,e.zoom,e.projection]);const u=(g,f)=>{f.getControls().forEach(C=>{C instanceof g&&f.removeControl(C)})};return c.useEffect(()=>{r.setTarget(n.current),t!==void 0&&t?r.addControl(new We.FullScreen):u(We.FullScreen,r)},[r,t]),c.useEffect(()=>{i!==void 0&&i?(u($e,r),r.addControl(new $e({coordinateFormat:Qn(s??pe.WGS84),projection:s??pe.WGS84,undefinedHTML:"&nbsp;"}))):u($e,r)},[r,i,s]),o.jsxs(Xn,{value:r,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},Ct=c.createContext(null),Rn=Ct.Provider,_e=()=>{const e=c.useContext(Ct);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Tt=({options:e,children:n})=>{const t=Te(),[i]=c.useState(new rt.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),o.jsx(Rn,{value:i,children:n})},wt=c.createContext(null),ei=wt.Provider,St=()=>{const e=c.useContext(wt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},bt=({children:e})=>{const n=Te(),[t]=c.useState(new rt.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(ei,{value:t,children:e})},Lt=c.createContext(null),ti=Lt.Provider,Mt=()=>{const e=c.useContext(Lt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},_t=({children:e})=>{const n=St(),[t]=c.useState(new qe.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(ti,{value:t,children:e})},Pt=({geometry:e,fitOptions:n,fit:t,featureStyle:i})=>{const s=Mt(),r=Te();return c.useLayoutEffect(()=>{const g=new Ue.GeoJSON().readFeature(e);return t&&s.on("addfeature",function(){r.getView().fit(s.getExtent(),n)}),i&&g.setStyle(i),s.addFeature(g),()=>{s.removeFeature(g)}},[e,s,t]),null},It=e=>{const n=_e();return c.useEffect(()=>{n.setSource(new qe.OSM)},[n]),null},At=({drawType:e,onPolygonSelected:n})=>{const t=Te();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case ae.BOX:i.geometryFunction=Cn.createBox();break;case ae.POLYGON:i.type="Polygon";break;default:return}const s=new En.Draw(i);t.addInteraction(s);const r=u=>{const f=new Ue.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(f)};return s.on("drawend",r),()=>{s.un("drawend",r),t.removeInteraction(s)}},[n,e,t]),null},ro="",ni=e=>{const n=t=>{const i=vn(t);e.onPolygonSelection(i)};return o.jsxs(Et,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(Tt,{children:o.jsx(It,{})}),e.selectionPolygon&&o.jsx(bt,{children:o.jsx(_t,{children:o.jsx(Pt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(At,{drawType:e.drawType,onPolygonSelected:n})]})},Ye=1.5,ii=80,ri=ve.makeStyles(e=>ve.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(Ye),top:e.spacing(Ye)},contentContainer:{marginTop:e.spacing(Ye),width:e.spacing(ii)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),oi=e=>{var f;const[n,t]=c.useState(),[i,s]=c.useState(),r=ri(),u=y=>{s(y),t(void 0),e.handlePolygonSelected(y)},g=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:r.map,children:[o.jsxs("div",{className:`${r.absolute}`,children:[o.jsxs(Z.Paper,{className:r.filtersContainer,children:[o.jsx(Yn,{onCancelDraw:()=>t(void 0),onReset:g,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((y,C)=>o.jsx("div",{className:r.filtersMargin,children:y},C))]}),o.jsx(Z.Paper,{color:"red",className:`${r.contentContainer}`,children:e.children})]}),o.jsx(ni,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})},Dt=new De.Fill({color:"rgba(255,255,255,0.4)"}),Ot=new De.Stroke({color:"#3399CC",width:1.25}),kt=[new De.Style({image:new De.Circle({fill:Dt,stroke:Ot,radius:5}),fill:Dt,stroke:Ot})],xt=c.createContext(null),si=xt.Provider,Nt=()=>{const e=c.useContext(xt);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},ai=({children:e,options:n,style:t})=>{const i=Te(),[s]=c.useState(new Tn({...n,style:t||kt}));return c.useEffect(()=>(i.addLayer(s),()=>{i.removeLayer(s)}),[i,s]),c.useEffect(()=>{s.setStyle(t||kt)},[s,t]),o.jsx(si,{value:s,children:e})},Xe=20,li=256,ci=2,di=2,ui="REST",hi=e=>{const n=it.get(e.projection),t=n.getExtent(),i=new Array(Xe),s=new Array(Xe),r=ot.getWidth(t)/li,u=e.heightWidthRatio!==void 0?e.heightWidthRatio:di,g=e.requestEncoding!==void 0?e.requestEncoding:ui;for(let y=0;y<Xe;++y)i[y]=r/Math.pow(ci,y)/u,s[y]=y.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new wn({origin:ot.getTopLeft(t),resolutions:i,matrixIds:s}),style:e.style,requestEncoding:g,wrapX:e.wrapX!==void 0?e.wrapX:!0}},gi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new qe.WMTS(t))},[n,t]),null},pi=e=>{const{attributions:n,url:t,params:i,serverType:s,transition:r}=e;return{attributions:n,url:t,params:i,serverType:s,transition:r}},fi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Sn(t))},[n,t]),null},mi=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},yi=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new bn(t))},[n,t]),null},vi=c.createContext(null),Ei=()=>{const e=c.useContext(vi);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},Ci=e=>{const{url:n}=e;return{url:n,format:new Ue.MVT}},Ti=({children:e,options:n})=>{const t=Nt();return c.useEffect(()=>{t.setSource(new Ln(n))},[n,t]),null},wi=({legendItems:e,title:n,isCollapsed:t})=>{const i=Te();return c.useEffect(()=>{const s=new st({title:n??"",margin:5,maxWidth:300}),r=new Mn({legend:s,collapsed:t===void 0?!0:t});i.addControl(r);const u=new st({margin:4});return e.forEach(g=>{u.addItem({title:g.title,style:g.style,typeGeom:"Polygon"})}),s.addItem(u),()=>{i.removeControl(r)}},[i,e,n,t]),o.jsx(o.Fragment,{})};function Si(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:r}=e,u=g=>f=>{s(f,g)};return o.jsx(_n,{children:o.jsxs(Z.TableRow,{children:[r&&o.jsx(Z.TableCell,{}),n.map(g=>o.jsx(Z.TableCell,{align:g.numeric?"right":"left",padding:g.disablePadding?"none":"default",sortDirection:i===g.id?t:!1,children:o.jsx(Z.TableSortLabel,{active:i===g.id,direction:i===g.id?t:"asc",onClick:u(g.id),children:g.label})},g.id))]})})}const bi=at.createSvgIcon(ut.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Li=at.createSvgIcon(ut.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Mi(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:r,isCollapseable:u,collapsedElement:g}=e,[f,y]=c.useState(!1),C=n.length,_=()=>{s==null||s(r)};return o.jsxs(o.Fragment,{children:[o.jsxs(Z.TableRow,{hover:!0,selected:t,onClick:_,children:[u&&o.jsx(Z.TableCell,{padding:"checkbox",children:o.jsx(Z.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),y(!f)},children:f?o.jsx(Li,{}):o.jsx(bi,{})})}),n.map(b=>o.jsx(Z.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(i[b.id]):i[b.id]},b.id+r.toString()))]}),u&&o.jsx(Z.TableRow,{children:o.jsx(Z.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:C+1,children:o.jsx(Z.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:g==null?void 0:g(i)})})})]})}function _i(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:r,items:u,onRequestSort:g,onRowSelected:f,isCollapseable:y,collapsedElement:C,isDense:_,page:b,rowsPerPage:D,count:x,handleChangePage:W,handleChangeRowsPerPage:Q}=e,H=(K,Y)=>{const k=n===Y&&i==="asc";s(k?"desc":"asc"),t(Y),g(Y,k?"desc":"asc")};return o.jsxs(Z.TableContainer,{component:Z.Paper,children:[o.jsxs(Z.Table,{size:_?"small":"medium",children:[o.jsx(Si,{headCells:r,onRequestSort:H,order:i,orderBy:n,isCollapseable:y}),o.jsxs(Z.TableBody,{children:[u.map((K,Y)=>o.jsx(Mi,{item:K,rowIndex:Y,isCollapseable:y,cellsMetadata:r,collapsedElement:C,isRowSelected:!1,onRowSelected:f},Y)),(u.length===0||D>u.length)&&o.jsx(Z.TableRow,{style:{height:(_?33:53)*(D-u.length)},children:o.jsx(Z.TableCell,{colSpan:y?r.length+1:r.length,children:u.length===0&&o.jsx(Z.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(Z.TablePagination,{rowsPerPage:D,rowsPerPageOptions:[5,10],component:"div",count:x,page:b,onPageChange:W,onRowsPerPageChange:Q})]})}const Pi=e=>{const{children:n,...t}=e;return o.jsx(Pn,{...t,children:n})},Ii=e=>{const{children:n,...t}=e;return o.jsx(In,{...t,children:n})},Bt=e=>e*Math.PI/180,Be=e=>e*(180/Math.PI),Ai=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(Bt(85.362/2))/Math.sin(Bt(85.362/2))),oo="",Ft=(e,n,t)=>{let i;if(e.scene.mode!==S.SceneMode.SCENE2D)i=e.scene.pickPosition(new S.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;i=e.camera.pickEllipsoid(new S.Cartesian2(n,t),s)}return S.Cartographic.fromCartesian(i)},Di=(e,n,t)=>{const i=Ft(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]}}},Vt=(e,n,t)=>{try{const i=Ft(e,n,t);return{longitude:S.Math.toDegrees(i.longitude),latitude:S.Math.toDegrees(i.latitude)}}catch{return}};class Oi extends S.PolylineDashMaterialProperty{}class ki extends S.ConstantProperty{}class xi extends S.ConstantPositionProperty{}class Ni extends S.Cartesian2{}class Bi extends S.Cartesian3{}class Gt extends S.Cartographic{}class Fi extends S.BoundingSphere{}class Vi extends S.Ellipsoid{}class Gi extends S.GeographicTilingScheme{}class Hi extends S.Rectangle{}class zi extends S.Resource{}class Wi extends S.EllipsoidTerrainProvider{}class $i extends S.CesiumTerrainProvider{}const qi=S.VerticalOrigin,Ui=S.LabelStyle,Ht=e=>{const n=re(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(r=>{if(r!=null&&r.endPosition){const u={...r.endPosition};u.x=Math.ceil(u.x),u.y=Math.ceil(u.y),s(u)}},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const r=n.scene.globe.ellipsoid;if(i){const u=Vt(n,i.x,i.y);if(u){const g=new Gt(u.longitude,u.latitude);if(t.current){let f="";switch(e.projection){case pe.WEB_MERCATOR:{const C=new S.WebMercatorProjection(r).project(g);f=`Mercator: ${C.y.toFixed(Ne)}m, ${C.x.toFixed(Ne)}m`,t.current.style.width="220px";break}case pe.WGS84:{const y=g.longitude.toFixed(xe);f=`WGS84: ${g.latitude.toFixed(xe)}°N ${y}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[i,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},so="",Ze=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],ji=(e,n,t,i)=>{const s=z.get(i,"METERS_UNIT")??"m",r=z.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},g=new S.EllipsoidGeodesic,f=new Date().getTime();if(f<u.lastLegendUpdate+250)return;u.lastLegendUpdate=f;const y=e.scene.canvas.clientWidth,C=e.scene.canvas.clientHeight,_=e.scene.camera.getPickRay(new S.Cartesian2(y/2|0,C-1)),b=e.scene.camera.getPickRay(new S.Cartesian2(1+y/2|0,C-1)),D=e.scene.globe,x=D.pick(_,e.scene),W=D.pick(b,e.scene);if(!x||!W)return;const Q=D.ellipsoid.cartesianToCartographic(x),H=D.ellipsoid.cartesianToCartographic(W);g.setEndPoints(Q,H);const K=g.surfaceDistance,Y=100;let k;for(let q=Ze.length-1;!z.isNumber(k)&&q>=0;--q)Ze[q]/K<Y&&(k=Ze[q]);if(z.isNumber(k)){let q="";k>=1e3?q=`${(k/1e3).toString()} ${r}`:q=`${k.toString()} ${s}`,u.barWidth=k/K|0,u.distanceLabel=q}t(u)},zt=e=>{const n=re(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const r=f=>{ji(n,t,i,e.locale)},u=new S.EventHelper,g=f=>{n.scene.globe.tilesLoaded&&(r(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,g),n.camera.moveEnd.addEventListener(r),()=>{try{z.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(r)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[n,e.locale,t]);const s=r=>5+(125-r)/2;return o.jsx("div",{className:"scalePosition",children:z.isNumber(t.barWidth)&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scale-tracker-label",children:o.jsx("bdi",{children:t.distanceLabel})}),o.jsx("div",{className:"scale-tracker-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},ao="",Wt=(e,n)=>{const i=z.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,r=n.canvas.height,u=z.get(n.camera.frustum,"sseDenominator")??1;for(let g=0;g<=19;g++)if(i.getLevelMaximumGeometricError(g)*r/(e*u)<s.maximumScreenSpaceError)return g;return null},Ki=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let r=1e8;r>i;r=r-i){const u=Wt(r,n);if(u===null)break;if(u!==s){let g=r,f=r+i;for(;f-g>e;)r=g+(f-g)/2,Wt(r,n)===u?g=r:f=r;t.push({level:u,height:Math.round(r)}),s=u,t.length>=2&&(i=(t[t.length-2].height-r)/1e3)}}return t},$t=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=re(),[i,s]=c.useState(1),r=Ki(1,t),u=c.useCallback(()=>{const C=t.camera,_=.5;let b=0;switch(t.scene.mode){case ie.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(C.positionWC).height;break;case ie.SCENE2D:b=(C.frustum.right-C.frustum.left)*_;break;case ie.COLUMBUS_VIEW:b=C.position.z;break;default:b=0;break}if(r.length>0){const D=r.reduce((x,W)=>Math.abs(W.height-b)<Math.abs(x.height-b)?W:x);s(D.level),t.currentZoomLevel=D.level}},[t,r]),g=c.useCallback(()=>{let C=0;t.scene.globe._surface.forEachRenderedTile(function(_){C=Math.max(C,_.level)}),s(C),t.currentZoomLevel=C},[t]),y=c.useMemo(()=>({CALCULATION:u,RENDERED_TILES:g}),[u,g])[n];return c.useEffect(()=>{const C=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&y()});return t.camera.moveEnd.addEventListener(y),()=>{try{typeof z.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(y),C())}catch(_){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',_)}}},[t,y]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:i}),o.jsx("div",{className:"zoomLevelLabel",children:z.get(e,"ZOOM_LABEL")??"zoom"})]})},lo="",Yi=-1,Xi=e=>{const n=re(),[t,i]=c.useState(),{sceneModes:s}=e,r=u=>s.findIndex(g=>g===u)>Yi;return c.useEffect(()=>{i(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[r(ie.SCENE3D)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z"})})}),onClick:()=>{n.scene.morphTo3D(),i(ie.SCENE3D)}}),r(ie.SCENE2D)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z"})})}),onClick:()=>{n.scene.morphTo2D(),i(ie.SCENE2D)}}),r(ie.COLUMBUS_VIEW)&&o.jsx(G.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z"})})}),onClick:()=>{n.scene.morphToColumbusView(),i(ie.COLUMBUS_VIEW)}})]})},co="",Zi=ve.makeStyles(e=>ve.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Ji=e=>{const n=re(),{baseMaps:t}=e,[i,s]=c.useState(" "),[r,u]=c.useState(),g=Zi();c.useEffect(()=>{const y=t==null?void 0:t.maps.find(C=>C.isCurrent);y&&(u(y),s(y.title!==void 0?y.title:" "))},[t]);const f=y=>{var C,_;if(t){(C=n.layersManager)==null||C.removeBaseMapLayers();const b=t.maps.find(D=>D.id===y);b&&((_=n.layersManager)==null||_.setBaseMapLayers(b),u(b),t.maps.forEach(D=>{D.isCurrent=b===D}))}};return o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mapLabel",children:i}),o.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(y=>o.jsx("li",{className:`mapContainer ${g.mapContainer} ${y===r?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:y.thumbnail,onMouseOver:()=>{s(y.title)},onMouseOut:()=>{s((r==null?void 0:r.title)!==void 0?r.title:" ")},onClick:()=>{f(y.id)}})},y.id))})]})},uo="",Je="ic_settings_24px",Qi=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:r}=e,u=c.useRef(null),g=z.get(r,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=z.get(r,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",y=z.get(r,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const C=_=>{var x;const b=_.target,D=z.get(u,"current");D&&!D.contains(b)&&b.id!==Je&&((x=b.parentElement)==null?void 0:x.id)!==Je&&(document.removeEventListener("click",C,!1),t(!1))};return document.addEventListener("click",C,!1),()=>{document.removeEventListener("click",C,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(G.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Je,x:"288",y:"24",children:o.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!n)}}),n&&o.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:o.jsxs(G.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(G.DialogTitle,{children:g}),o.jsxs(G.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(ce,{className:"mapScenesContainer",children:o.jsx(Xi,{sceneModes:i})}),o.jsx(ce,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:y}),o.jsx(Ji,{baseMaps:s})]})})]})]})})]})},ho="",Ri=()=>{const e=re(),n=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return o.jsx("div",{className:"zoom-buttons-container",children:n.map(t=>o.jsx(G.Icon,{icon:o.jsx("div",{className:"zoom-button",children:o.jsx("svg",{fill:"#fff",width:"10px",height:"10px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:o.jsx("path",{d:t.iconPath})})}),onClick:t.onClick}))})},go="",er=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:o.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),o.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),tr=({onClick:e})=>o.jsx(ce,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(G.Icon,{icon:er,className:"mapLegendIcon"})}),nr=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const r=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const y=o.jsx(ce,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(G.Tooltip,{content:t,children:y}):y},[t]),g=c.useCallback(()=>[typeof e=="string"&&o.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&o.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return o.jsxs(ce,{className:"mapLegend",children:[u(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:r}),o.jsx(ce,{className:"legendActionsContainer",children:g()})]})},ir=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>o.jsx(ce,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),r=c.useCallback(()=>e.length?e.map((u,g)=>o.jsx(nr,{legend:u,docText:n,imgText:t},`${u.layer}_${g}`)):s(),[e]);return o.jsx(ce,{className:"mapLegendsList",children:r()})},rr=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:r=[]})=>e?o.jsxs(G.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(G.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(G.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(G.DrawerContent,{className:"sidebarContent",children:[o.jsx(G.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(ir,{noLegendsText:i,legends:r,actionsTexts:s})]})]}):null,ye=document.createElement("canvas"),le=ye.getContext("2d"),qt=e=>{const i=(e==null?void 0:e.data)??[];for(let s=3;s<i.length;s+=4)if(i[s]<255)return!0;return!1},or=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{try{le==null||le.clearRect(0,0,ye.width,ye.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){ye.width=e.width,ye.height=e.height,le==null||le.drawImage(e,0,0);const r=le==null?void 0:le.getImageData(0,0,ye.width,ye.height),u=qt(r);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{ye.width=s.width,ye.height=s.height,le==null||le.drawImage(s,0,0);const r=le==null?void 0:le.getImageData(0,0,ye.width,ye.height);qt(r)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Fe=(e,n)=>{const{west:t,east:i,north:s,south:r}=e,{west:u,east:g,north:f,south:y}=n;return t>=u&&i<=g&&s<=f&&r>=y},Ve=3,Ge="hasTransparency";function Qe(e,n,t,i,s){return setTimeout(()=>{var g;const r=(g=this.layerListInstance.find(f=>{var y,C;return((y=f._imageryProvider._resource)==null?void 0:y._url)===((C=this._resource)==null?void 0:C._url)}))==null?void 0:g.meta,u=z.get(r,Ge)===!0;this.tileTransparencyCheckedCounter<Ve&&!u&&or(s==null?void 0:s.url,this).then(f=>{var y;(y=this.mapViewer.layersManager)==null||y.addMetaToLayer({[Ge]:f},C=>C._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class Ut extends S.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);R(this,"layerListInstance");R(this,"mapViewer");R(this,"maxTilesForTransparencyCheck",Ve);R(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}class jt extends S.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);R(this,"layerListInstance");R(this,"mapViewer");R(this,"maxTilesForTransparencyCheck",Ve);R(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}class Kt extends S.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);R(this,"layerListInstance");R(this,"mapViewer");R(this,"maxTilesForTransparencyCheck",Ve);R(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,r){return Qe.call(this,super.requestImage.bind(this),t,i,s,r)}}const sr=1,ar=-1,Yt="TRANSPARENT_BASE_LAYER";class lr{constructor(n,t,i,s){R(this,"mapViewer");R(this,"legendsList");R(this,"layerUpdated");R(this,"layers");R(this,"legendsExtractor");R(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,this.layerManagerFootprintMetaFieldPath=s,i&&this.layerUpdated.addEventListener(i,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(r=>{const u=Object.keys(r);u.length===1&&u[0]===Ge&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}addMetaToLayer(n,t){const i=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(i).then(s=>{const r=this.layers.find(t);r&&(r.meta={...r.meta??{},...n},this.setLegends(),this.layerUpdated.raiseEvent(n))})}setBaseMapLayers(n){n.baseRasteLayers.sort((i,s)=>i.zIndex-s.zIndex).forEach((i,s)=>{this.addRasterLayer(i,s,n.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(Yt),this.addTransparentImageryProvider())}addRasterLayer(n,t,i){let s;switch(n.type){case"XYZ_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Ut(r,this.mapViewer):new S.UrlTemplateImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new jt(r,this.mapViewer):new S.WebMapServiceImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const r=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new Kt(r,this.mapViewer):new S.WebMapTileServiceImageryProvider(r);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}s&&(s.alpha=n.opacity,s.meta={parentBasetMapId:i,...n},n.show!==void 0&&(s.show=n.show))}removeLayer(n){const t=this.findLayerById(n);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!z.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!z.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex;if(i)for(let r=0;r<t;r++)this.mapViewer.imageryLayers.raise(i);this.updateLayersOrder(n,s,s+t)}lower(n,t=1){const i=this.findLayerById(n),s=(i==null?void 0:i.meta).zIndex,r=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=r&&(t=u-r),i)for(let g=0;g<t;g++)this.mapViewer.imageryLayers.lower(i);this.updateLayersOrder(n,s,s-t)}raiseToTop(n){const t=this.findLayerById(n),i=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(n,i,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(n){const t=this.findLayerById(n),i=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(n,s-i)}length(){return this.mapViewer.imageryLayers.length}show(n,t){const i=this.get(n);i!==void 0&&(i.show=t)}showAllNotBase(n){this.layers.filter(i=>!z.get(i.meta,"parentBasetMapId")).forEach(i=>{var s;this.show((s=i.meta)==null?void 0:s.id,n)})}get(n){const t=this.findLayerById(n),i=this.mapViewer.imageryLayers.indexOf(t);return i?this.mapViewer.imageryLayers.get(i):void 0}pickImageryLayers(n){var s;const t=this.mapViewer.camera.getPickRay(n);let i;return t&&(i=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(r=>!z.get(r.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t,i=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Di(this.mapViewer,n,t);return this.layers.filter(g=>!z.get(g.meta,"parentBasetMapId")).filter(g=>{const f=z.get(g.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?Dn(s.geometry,{type:"Feature",properties:{},geometry:f})&&(i?g.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",g.meta),!1)}).sort((g,f)=>{var y,C;return((y=f.meta)==null?void 0:y.zIndex)-((C=g.meta)==null?void 0:C.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:Yt,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!z.get(t.meta,"parentBasetMapId")).length}findLayerById(n){return this.layers.find(t=>t.meta!==void 0?t.meta.id===n:!1)}updateLayersOrder(n,t,i){const s=t>i?sr:ar,r=t<i?t:i,u=t<i?i:t;this.layers.forEach(g=>{var y;if(!z.get(g.meta,"parentBasetMapId")){const C=(y=g.meta)==null?void 0:y.zIndex;g.meta.zIndex=C>=r&&C<=u&&C!==t?C+s:C===t?i:C}})}hideNonRelevantLayers(){var n,t;for(const i of this.layers)((n=i.meta)==null?void 0:n.relevantToExtent)!==i.show&&i.imageryProvider.ready&&(i.show=((t=i.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var n,t;try{const i=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const r=this.layers[s],u=!z.isEmpty(i)&&!z.isEmpty(r.rectangle)&&S.Rectangle.intersection(i,r.rectangle);for(let g=this.layers.length-1;g>=s;g--){if(((n=r.meta)==null?void 0:n.skipRelevancyCheck)===!0){r.meta={...r.meta,relevantToExtent:!0};continue}const f=this.layers[g],y=((t=f.meta)==null?void 0:t[Ge])===!0;if(r!==f)if(u instanceof S.Rectangle){if(Fe(i,r.rectangle))if(Fe(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}else r.meta={...r.meta??{},relevantToExtent:!0};if(Fe(i,f.rectangle)&&!y){r.meta={...r.meta??{},relevantToExtent:!1};break}if(Fe(r.rectangle,f.rectangle)){if(r.meta={...r.meta??{},relevantToExtent:y},!y)break}else r.meta={...r.meta??{},relevantToExtent:!0}}else r.meta={...r.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(r.meta={...r.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(i){console.error(i)}}}const po="",fo="",cr=e=>{const n=re(),{enableCompass:t=!0,enableZoomControls:i=!1,lockCompassNavigation:s=!1,locale:r={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof z.get(n,"cesiumNavigation")>"u"){n.extend(On,{enableCompass:t,enableZoomControls:i,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const u=document.querySelector(".compass");u&&r.DIRECTION&&u.classList.add(r.DIRECTION)}},[n,t,i,r.DIRECTION,s]),null},Xt=212,Zt=260,dr=0;class ur extends S.Viewer{constructor(t,i){super(t,i);R(this,"layersManager");R(this,"currentZoomLevel");R(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Jt=c.createContext(null),hr=Jt.Provider,re=()=>{const e=c.useContext(Jt);if(e===null)throw new Error("map context is null, please check the provider");return e},gr=e=>{var $,te,se,Ce,fe,de,he,Ie;const n=c.useRef(null),[t,i]=c.useState(),[s,r]=c.useState(),[u,g]=c.useState(),[f,y]=c.useState(),[C,_]=c.useState(),[b,D]=c.useState(),[x,W]=c.useState(),[Q,H]=c.useState(!1),[K,Y]=c.useState(),k=c.useRef(),[q,N]=c.useState(),[U,oe]=c.useState([]),[a,l]=c.useState(),[T,h]=c.useState(!1),E=c.useRef(),[p,w]=c.useState(void 0),[v,L]=c.useState(!1),[I,P]=c.useState(),[M,A]=c.useState(),O={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},j=(X,V,ne,we,Se)=>{const Me=t.container,gn=Me.clientWidth,pn=Me.clientHeight,fn=we+Se;return{left:`${gn-X<ne?X-(ne-(gn-X)):X}px`,top:`${pn-V<fn?V-(fn-(pn-V)):V}px`}},J=c.useCallback(X=>{if(n.current!==null){const V=n.current.cesiumElement,ne={x:X.offsetX,y:X.offsetY};h(!1),w(ne),P(Vt(V,ne.x,ne.y)),h(!0),E.current=X}},[n]);c.useEffect(()=>{var X;if(n.current!==null){const V=n.current.cesiumElement;e.imageryContextMenu&&(V.scene.canvas.removeEventListener("contextmenu",J),V.scene.canvas.addEventListener("contextmenu",J))}i((X=n.current)==null?void 0:X.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var X;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new lr(t,(X=e.legends)==null?void 0:X.mapLegendsExtractor,()=>{var V;oe((V=t.layersManager)==null?void 0:V.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{N(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var V,ne;l(e.baseMaps);const X=(V=e.baseMaps)==null?void 0:V.maps.find(we=>we.isCurrent);X&&t&&((ne=t.layersManager)==null||ne.setBaseMapLayers(X))},[e.baseMaps,t]),c.useEffect(()=>{r(e.projection??pe.WGS84)},[e.projection]),c.useEffect(()=>{Y(e.locale)},[e.locale]),c.useEffect(()=>{g(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{y(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{_(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{D(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{W(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{const X=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const V=()=>{const ne=t.camera.positionCartographic;return{longitude:Be(ne.longitude),latitude:Be(ne.latitude),height:ne.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const ne=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),we=t.scene.camera.getPickRay(ne),Se=t.scene.globe.pick(we,t.scene);if(!Se)return{longitude:0,latitude:0,height:0};const Me=t.scene.globe.ellipsoid.cartesianToCartographic(Se);return Me!==void 0?{longitude:Be(Me.longitude),latitude:Be(Me.latitude),height:t.scene.camera.positionCartographic.height}:V()}else return V()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==S.SceneMode.MORPHING){const V=t.camera,ne={position:X(),direction:V.direction.clone(),up:V.up.clone(),right:V.right.clone(),transform:V.transform.clone(),frustum:V.frustum.clone()};k.current=ne}}),x&&t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded===!0?H(!1):H(!0)}))},[t]),c.useEffect(()=>{const X=()=>{if(t&&k.current){const V=k.current;t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V.position.longitude,V.position.latitude,V.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(X),()=>{if(t)try{t.scene.morphComplete.removeEventListener(X)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const X=e.zoom,V=e.center;t&&z.isNumber(X)&&z.isArray(V)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(V[0],V[1],Ai(X)),duration:0})},[e.zoom,e.center,t]),c.useEffect(()=>{A(e.displayZoomButtons??!0)},[e.displayZoomButtons]);const B=c.useCallback(()=>t&&An.createPortal(o.jsxs(o.Fragment,{children:[x&&Q&&o.jsx(G.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),o.jsxs(ce,{className:"sideToolsContainer",children:[o.jsx(Qi,{sceneModes:q,baseMaps:a,locale:K}),o.jsx(tr,{onClick:()=>L(!v)})]}),o.jsxs(ce,{className:"toolsContainer",children:[u&&o.jsx(Ht,{projection:s}),f&&o.jsx($t,{locale:K,valueBy:"RENDERED_TILES"}),C&&o.jsx(zt,{locale:K}),b&&o.jsx(cr,{locale:K})]}),M&&o.jsx(Ri,{})]}),document.querySelector(".cesium-viewer")),[a,K,t,s,q,u,C,v,Q]);return o.jsx(me.Viewer,{className:"viewer",full:!0,ref:n,...O,children:o.jsxs(hr,{value:t,children:[o.jsx(rr,{title:($=e.legends)==null?void 0:$.title,isOpen:v,toggleSidebar:()=>L(!v),noLegendsText:(te=e.legends)==null?void 0:te.emptyText,legends:((se=e.legends)==null?void 0:se.legendsList)??U,actionsTexts:(Ce=e.legends)==null?void 0:Ce.actionsTexts}),e.children,B(),e.imageryContextMenu&&T&&p&&I&&c.cloneElement(e.imageryContextMenu,{data:(fe=t==null?void 0:t.layersManager)==null?void 0:fe.findLayerByPOI(p.x,p.y,!1),position:{x:p.x,y:p.y},coordinates:I,style:j(p.x,p.y,((de=e.imageryContextMenuSize)==null?void 0:de.width)??Zt,((he=e.imageryContextMenuSize)==null?void 0:he.height)??Xt,((Ie=e.imageryContextMenuSize)==null?void 0:Ie.dynamicHeightIncrement)??dr),size:e.imageryContextMenuSize??{height:Xt,width:Zt},handleClose:()=>{h(!T)},contextEvt:E.current})]})})},pr=0,fr=e=>{const n=re();return o.jsx(me.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const i=n.scene;i.globe.depthTestAgainstTerrain=!0;const s=S.Cartographic.fromCartesian(t.boundingSphere.center),r=e.heightFromGround??pr;if(r){const u=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),g=S.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+r),f=S.Cartesian3.subtract(g,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(f)}}})},He=180,Qt=.001,Rt=e=>Math.abs(e)/e,en=e=>{He-Math.abs(e[0])<Qt&&(e[0]=Rt(e[0])*(He-1)),He/2-Math.abs(e[1])<Qt&&(e[1]=Rt(e[1])*(He/2-1))},tn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{en(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{en(t)})});break}},mr=e=>{const{data:n,...t}=e,i=z.cloneDeep(n);return i&&(typeof i.features<"u"?i.features.forEach(s=>{tn(s.geometry)}):tn(i)),o.jsx(me.GeoJsonDataSource,{data:i,...t})},Pe=e=>{const{meta:n,...t}=e,i=re();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),o.jsx(me.ImageryLayer,{...t})},yr=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new jt(n,i):new S.WebMapServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},vr=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new Kt(n,i):new S.WebMapTileServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Er=e=>{const{options:n,...t}=e,i=re(),s=i.shouldOptimizedTileRequests?new Ut(n,i):new S.UrlTemplateImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Cr=e=>{const{options:n,...t}=e;return o.jsx(Pe,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(n)})},nn=e=>o.jsx(me.Entity,{...e}),Tr=e=>o.jsx(me.EntityDescription,{...e}),rn=e=>o.jsx(me.EntityDescription,{...e}),on=e=>o.jsx(me.PolygonGraphics,{...e}),sn=e=>o.jsx(me.RectangleGraphics,{...e}),an=e=>o.jsx(me.CustomDataSource,{...e}),wr=e=>o.jsx(me.PolylineGraphics,{...e}),mo="";var Ee=function(){var e=m.Ellipsoid.WGS84,n,t=m.Material.fromType(m.Material.ColorType);function i(a,l=new m.Color(1,1,0,.5),T=new m.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=T,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,T=new m.ScreenSpaceEventHandler(a.canvas);function h(p,w){if(l._handlersMuted!=!0){var v=a.pick(w);v&&v.primitive&&v.primitive[p]&&v.primitive[p](w)}}T.setInputAction(function(p){h("leftClick",p.position)},m.ScreenSpaceEventType.LEFT_CLICK),T.setInputAction(function(p){h("leftDoubleClick",p.position)},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var E;T.setInputAction(function(p){if(l._handlersMuted!=!0){var w=a.pick(p.endPosition);E&&(!w||E!=w.primitive)&&(!(E.isDestroyed&&E.isDestroyed())&&E.mouseOut(p.endPosition),E=null),w&&w.primitive&&(w=w.primitive,w.mouseOut&&(E=w),w.mouseMove&&w.mouseMove(p.endPosition))}},m.ScreenSpaceEventType.MOUSE_MOVE),T.setInputAction(function(p){h("leftUp",p.position)},m.ScreenSpaceEventType.LEFT_UP),T.setInputAction(function(p){h("leftDown",p.position)},m.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,T){a[l]=T},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;U(a,"mouseMove",function(T){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(T,"Click to edit this shape")}),U(a,"mouseOut",function(T){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),U(a,"leftClick",function(T){a.setEditMode(!0)})},i.prototype.startDrawing=function(a){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=a,this.muteHandlers(!0)},i.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},i.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},i.prototype.setHighlighted=function(a){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=a&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=a},i.prototype.disableAllEditMode=function(){this.setEdited(void 0)},i.prototype.setEdited=function(a){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=a};var s={ellipsoid:m.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},r=N(s,{appearance:new m.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=N(s,{}),g=N(s,{}),f=N(s,{}),y=N(r,{rotation:0}),C=N(s,{width:5,geodesic:!0,granularity:1e4,appearance:new m.PolylineMaterialAppearance({aboveGround:!1}),material:t}),_=function(){function a(){}return a.prototype.initialiseOptions=function(l){q(this,l),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},a.prototype.setAttribute=function(l,T){this[l]=T,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,T,h){if(!m.defined(this.ellipsoid))throw new m.DeveloperError("this.ellipsoid must be defined.");if(!m.defined(this.appearance))throw new m.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new m.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!m.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var E=this.getGeometry();if(!E)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:E,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new m.Primitive({geometryInstances:new m.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:m.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new m.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var p=this._primitive;p.appearance.material=this.material,p.debugShowBoundingVolume=this.debugShowBoundingVolume,p.update(l,T,h),this._outlinePolygon&&this._outlinePolygon.update(l,T,h)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),m.destroyObject(this)},a.prototype.setStrokeStyle=function(l,T){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=T)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=T)},a}();i.ExtentPrimitive=function(){function a(l){if(!m.defined(l.extent))throw new m.DeveloperError("Extent is required");l=N(l,r),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new _,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(m.defined(this.extent))return new m.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.RectangleOutlineGeometry({rectangle:this.extent})},a}(),i.PolygonPrimitive=function(){function a(l){l=N(l,r),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new _,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<3))return m.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return m.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),i.CirclePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.radius)))throw new m.DeveloperError("Center and radius are required");l=N(l,r),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new _,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setRadius=function(l){this.setAttribute("radius",Math.max(.1,l))},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getRadius=function(){return this.getAttribute("radius")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.radius))return new m.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),i.EllipsePrimitive=function(){function a(l){if(!(m.defined(l.center)&&m.defined(l.semiMajorAxis)&&m.defined(l.semiMinorAxis)))throw new m.DeveloperError("Center and semi major and semi minor axis are required");l=N(l,y),this.initialiseOptions(l)}return a.prototype=new _,a.prototype.setCenter=function(l){this.setAttribute("center",l)},a.prototype.setSemiMajorAxis=function(l){l<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",l)},a.prototype.setSemiMinorAxis=function(l){l>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",l)},a.prototype.setRotation=function(l){return this.setAttribute("rotation",l)},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},a.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},a.prototype.getRotation=function(){return this.getAttribute("rotation")},a.prototype.getGeometry=function(){if(m.defined(this.center)&&m.defined(this.semiMajorAxis)&&m.defined(this.semiMinorAxis))return new m.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new m.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),i.PolylinePrimitive=function(){function a(l){l=N(l,C),this.initialiseOptions(l)}return a.prototype=new _,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.setWidth=function(l){this.setAttribute("width",l)},a.prototype.setGeodesic=function(l){this.setAttribute("geodesic",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getWidth=function(){return this.getAttribute("width")},a.prototype.getGeodesic=function(l){return this.getAttribute("geodesic")},a.prototype.getGeometry=function(){if(!(!m.defined(this.positions)||this.positions.length<2))return new m.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:m.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var b={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},D={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},x={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,T){var h=new i.BillboardGroup(this,l);return h.addBillboards(a,T),h},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=N(l,b);var T=new m.BillboardCollection;this._scene.primitives.add(T),this._billboards=T,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var T=this._billboards.add({show:!0,position:a,pixelOffset:new m.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new m.Cartesian3(0,0,0),horizontalOrigin:m.HorizontalOrigin.CENTER,verticalOrigin:m.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(l){let p=function(v){E.enableRotate=v},w=function(){for(var v=0,L=h._orderedBillboards.length;v<L&&h._orderedBillboards[v]!=T;++v);return v};var h=this,E=this._scene.screenSpaceCameraController;if(l.dragHandlers){var h=this;U(T,"leftDown",function(L){function I(A){T.position=A;for(var O=0,j=h._orderedBillboards.length;O<j&&h._orderedBillboards[O]!=T;++O);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(w(),A)}function P(A){M.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(w(),A)}var M=new m.ScreenSpaceEventHandler(h._scene.canvas);M.setInputAction(function(A){var O=h._scene.camera.pickEllipsoid(A.endPosition,e);O?I(O):P(O)},m.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(A){P(h._scene.camera.pickEllipsoid(A.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(w(),h._scene.camera.pickEllipsoid(L,e))})}l.onDoubleClick&&U(T,"leftDoubleClick",function(v){l.onDoubleClick(w())}),l.onClick&&U(T,"leftClick",function(v){l.onClick(w())}),l.tooltip&&(U(T,"mouseMove",function(v){h._drawHelper._tooltip.showAt(v,l.tooltip())}),U(T,"mouseOut",function(v){h._drawHelper._tooltip.setVisible(!1)}))}return T},i.BillboardGroup.prototype.insertBillboard=function(a,l,T){this._orderedBillboards.splice(a,0,this.createBillboard(l,T))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var T=0;T<a.length;T++)this.addBillboard(a[T],l)},i.BillboardGroup.prototype.updateBillboardsPositions=function(a){for(var l=0;l<a.length;l++)this.getBillboard(l).position=a[l]},i.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},i.BillboardGroup.prototype.getBillboard=function(a){return this._orderedBillboards[a]},i.BillboardGroup.prototype.removeBillboard=function(a){this._billboards.remove(this.getBillboard(a)),this._orderedBillboards.splice(a,1)},i.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},i.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},i.prototype.startDrawingMarker=function(l){var l=N(l,b);this.startDrawing(function(){p.remove(),w.destroy(),E.setVisible(!1)});var T=this,h=this._scene;h.primitives;var E=this._tooltip,p=new i.BillboardGroup(this,l),w=new m.ScreenSpaceEventHandler(h.canvas);w.setInputAction(function(v){if(v.position!=null){var L=h.camera.pickEllipsoid(v.position,e);L&&(p.addBillboard(L),T.stopDrawing(),l.callback(L))}},m.ScreenSpaceEventType.LEFT_CLICK),w.setInputAction(function(v){var L=v.endPosition;if(L!=null){var I=h.camera.pickEllipsoid(L,e);I?E.showAt(L,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(I))):E.showAt(L,"<p>Click on the globe to add your marker.</p>")}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=N(l,r);this.startDrawingPolyshape(!0,l)},i.prototype.startDrawingPolyline=function(l){var l=N(l,C);this.startDrawingPolyshape(!1,l)},i.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){E.remove(v),I.remove(),P.destroy(),p.setVisible(!1),H(h)});var T=this,h=this._scene,E=h.primitives,p=this._tooltip,w=a?3:2,v;a?v=new Ee.PolygonPrimitive(l):v=new Ee.PolylinePrimitive(l),v.asynchronous=!1,E.add(v);var L=[],I=new i.BillboardGroup(this,b),P=new m.ScreenSpaceEventHandler(h.canvas);Q(h),P.setInputAction(function(M){if(M.position!=null){var A=h.camera.pickEllipsoid(M.position,e);A&&(L.length==0&&(L.push(A.clone()),I.addBillboard(L[0])),L.length>=w&&(v.positions=L,v._createPrimitive=!0),L.push(A),I.addBillboard(A))}},m.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(M){var A=M.endPosition;if(A!=null)if(L.length==0)p.showAt(A,"<p>Click to add first point</p>");else{var O=h.camera.pickEllipsoid(A,e);O&&(L.pop(),O.y+=1+Math.random(),L.push(O),L.length>=w&&(v.positions=L,v._createPrimitive=!0),I.getBillboard(L.length-1).position=O,p.showAt(A,"<p>Click to add new point ("+L.length+")</p>"+(L.length>w?"<p>Double click to finish drawing</p>":"")))}},m.ScreenSpaceEventType.MOUSE_MOVE),P.setInputAction(function(M){var A=M.position;if(A!=null){if(L.length<w+2)return;var O=h.camera.pickEllipsoid(A,e);O&&(H(h),T.stopDrawing(),typeof l.callback=="function"&&(L.length-1,l.callback(L)))}},m.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function W(a){return e.cartographicArrayToCartesianArray([m.Rectangle.northwest(a),m.Rectangle.northeast(a),m.Rectangle.southeast(a),m.Rectangle.southwest(a)])}function Q(a){a&&(a.canvas.style.cursor="crosshair")}function H(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=N(l,r);this.startDrawing(function(){v!=null&&E.remove(v),L!=null&&L.remove(),I.destroy(),p.setVisible(!1),H(h)});var T=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=null,I=new m.ScreenSpaceEventHandler(h.canvas);Q(h);function P(M){v==null&&(v=new Ee.ExtentPrimitive({extent:M,material:l.material}),v.asynchronous=!1,E.add(v)),v.setExtent(M);var A=W(M);L==null?(L=new i.BillboardGroup(T,b),L.addBillboards(A)):L.updateBillboardsPositions(A)}I.setInputAction(function(M){if(M.position!=null){var A=h.camera.pickEllipsoid(M.position,e);if(A)if(v==null){w=e.cartesianToCartographic(A);var O=K(w,w);P(O)}else T.stopDrawing(),typeof l.callback=="function"&&l.callback(K(w,e.cartesianToCartographic(A)))}},m.ScreenSpaceEventType.LEFT_DOWN),I.setInputAction(function(M){var A=M.endPosition;if(A!=null)if(v==null)p.showAt(A,"<p>Click to start drawing rectangle</p>");else{var O=h.camera.pickEllipsoid(A,e);if(O){var j=K(w,e.cartesianToCartographic(O));P(j),p.showAt(A,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingCircle=function(l){var l=N(l,r);this.startDrawing(function(){w!=null&&E.remove(w),v.remove(),L.destroy(),p.setVisible(!1)});var T=this,h=this._scene,E=this._scene.primitives,p=this._tooltip,w=null,v=null,L=new m.ScreenSpaceEventHandler(h.canvas);L.setInputAction(function(I){if(I.position!=null){var P=h.camera.pickEllipsoid(I.position,e);P&&(w==null?(w=new i.CirclePrimitive({center:P,radius:0,asynchronous:!1,material:l.material}),E.add(w),v=new i.BillboardGroup(T,b),v.addBillboards([P])):(typeof l.callback=="function"&&l.callback(w.getCenter(),w.getRadius()),T.stopDrawing()))}},m.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(I){var P=I.endPosition;if(P!=null)if(w==null)p.showAt(P,"<p>Click to start drawing the circle</p>");else{var M=h.camera.pickEllipsoid(P,e);M&&(w.setRadius(m.Cartesian3.distance(w.getCenter(),M)),v.updateBillboardsPositions(M),p.showAt(P,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},m.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.enhancePrimitives=function(){var a=this;m.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var h=this,E=this;function p(w){a._scene.screenSpaceCameraController.enableRotate=w}U(h,"leftDown",function(w){function v(P){h.position=P,E.executeListeners({name:"drag",positions:P})}function L(P){I.destroy(),p(!0),E.executeListeners({name:"dragEnd",positions:P})}var I=new m.ScreenSpaceEventHandler(a._scene.canvas);I.setInputAction(function(P){var M=a._scene.camera.pickEllipsoid(P.endPosition,e);M?v(M):L(M)},m.ScreenSpaceEventType.MOUSE_MOVE),I.setInputAction(function(P){L(a._scene.camera.pickEllipsoid(P.position,e))},m.ScreenSpaceEventType.LEFT_UP),p(!1)}),oe(h)};function l(h){a._scene,!(this._highlighted&&this._highlighted==h)&&this._editMode!==!0&&(this._highlighted=h,h?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(m.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function T(h){if(this._editMode!=h)if(a.disableAllHighlights(),h){a.setEdited(this);var E=a._scene,p=this;if(this._markers==null){let O=function(B,$){var te=B-1<0?$.length-1:B-1;te<v.countBillboards()&&(v.getBillboard(te).position=J(te)),te=B,te<v.countBillboards()&&(v.getBillboard(te).position=J(te))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},J=function(B){var $=p.positions;return e.cartographicToCartesian(new m.EllipsoidGeodesic(e.cartesianToCartographic($[B]),e.cartesianToCartographic($[B<$.length-1?B+1:0])).interpolateUsingFraction(.5))};var w=new i.BillboardGroup(a,D),v=new i.BillboardGroup(a,x),L={dragHandlers:{onDrag:function(B,$){p.positions[B]=$,O(B,p.positions),p._createPrimitive=!0},onDragEnd:function(B,$){p._createPrimitive=!0,j()}},onDoubleClick:function(B){p.positions.length<4||(p.positions.splice(B,1),p._createPrimitive=!0,w.removeBillboard(B),v.removeBillboard(B),O(B,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};w.addBillboards(p.positions,L),this._markers=w;for(var I=[],P=0,M=p.positions.length+(this.isPolygon?0:-1);P<M;P++)I.push(J(P));var A={dragHandlers:{onDragStart:function(B,$){this.index=B+1,p.positions.splice(this.index,0,$),p._createPrimitive=!0},onDrag:function(B,$){p.positions[this.index]=$,p._createPrimitive=!0},onDragEnd:function(B,$){w.insertBillboard(this.index,$,L),v.getBillboard(this.index-1).position=J(this.index-1),v.insertBillboard(this.index,J(this.index),A),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};v.addBillboards(I,A),this._editMarkers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(B){var $=E.pick(B.position);$&&$.primitive||p.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop(),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}Ee.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this;h.isPolygon=!1,h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=T;var E=this.width;h.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(E*2)):this.setWidth(E))},h.getExtent=function(){return m.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},oe(h),h.setEditMode(!1)}},Ee.PolygonPrimitive.prototype.setEditable=function(){var h=this;h.asynchronous=!1,a._scene,a.registerEditableShape(h),h.setEditMode=T,h.setHighlighted=l,oe(h),h.setEditMode(!1)},Ee.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;a.registerEditableShape(h),h.asynchronous=!1,h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let L=function(){h.executeListeners({name:"onEdited",extent:h.extent})};var w=new i.BillboardGroup(a,D),v={dragHandlers:{onDrag:function(I,P){var M=w.getBillboard((I+2)%4).position;h.setExtent(K(e.cartesianToCartographic(M),e.cartesianToCartographic(P))),w.updateBillboardsPositions(W(h.extent))},onDragEnd:function(I,P){L()}},tooltip:function(){return"Drag to change the corners of this extent"}};w.addBillboards(W(h.extent),v),this._markers=w,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(I){var P=E.pick(I.position);P&&!P.isDestroyed()&&P.primitive||h.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),w.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let I=function(){return m.EllipseOutlineGeometry(e,h.getCenter(),h.getSemiMajorAxis(),h.getSemiMinorAxis(),h.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),semiMajorAxis:h.getSemiMajorAxis(),semiMinorAxis:h.getSemiMinorAxis(),rotation:0})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,A){var O=m.Cartesian3.distance(h.getCenter(),A);M%2==0?h.setSemiMajorAxis(O):h.setSemiMinorAxis(O),v.updateBillboardsPositions(I())},onDragEnd:function(M,A){P()}},tooltip:function(){return"Drag to change the excentricity and radius"}};v.addBillboards(I(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var A=E.pick(M.position);A&&A.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(h){for(var E=m.CircleOutlineGeometry.createGeometry(new m.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:h})),p=0,w,v=[];p<E.attributes.position.values.length;p+=3)w=E.attributes.position.values,v.push(new m.Cartesian3(w[p],w[p+1],w[p+2]));return v},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var h=this,E=a._scene;h.asynchronous=!1,a.registerEditableShape(h),h.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var w=this;if(this._markers==null){let I=function(){return w.getCircleCartesianCoordinates(m.Math.PI_OVER_TWO)},P=function(){h.executeListeners({name:"onEdited",center:h.getCenter(),radius:h.getRadius()})};var v=new i.BillboardGroup(a,D),L={dragHandlers:{onDrag:function(M,A){h.setRadius(m.Cartesian3.distance(h.getCenter(),A)),v.updateBillboardsPositions(I())},onDragEnd:function(M,A){P()}},tooltip:function(){return"Drag to change the radius"}};v.addBillboards(I(),L),this._markers=v,this._globeClickhandler=new m.ScreenSpaceEventHandler(E.canvas),this._globeClickhandler.setInputAction(function(M){var A=E.pick(M.position);A&&A.primitive||w.setEditMode(!1)},m.ScreenSpaceEventType.LEFT_CLICK),v.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},h.setHighlighted=l,oe(h),h.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,T){if(!m.defined(T.container))throw new m.DeveloperError("Container is required");var h={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:C,polygonDrawingOptions:u,extentDrawingOptions:g,circleDrawingOptions:f};q(T,h);var E=this,p=document.createElement("DIV");p.className="toolbar",T.container.appendChild(p);function w(I,P,M,A){var O=document.createElement("DIV");O.className="button",O.title=M,p.appendChild(O),O.onclick=A;var j=document.createElement("SPAN");O.appendChild(j);var J=document.createElement("IMG");return J.src=P,j.appendChild(J),O}var v=l._scene;w("marker",T.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(I){E.executeListeners({name:"markerCreated",position:I})}})}),w("polyline",T.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(I){E.executeListeners({name:"polylineCreated",positions:I})}})}),w("polygon",T.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(I){E.executeListeners({name:"polygonCreated",positions:I})}})}),w("extent",T.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(I){E.executeListeners({name:"extentCreated",extent:I})}})}),w("circle",T.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(I,P){E.executeListeners({name:"circleCreated",center:I,radius:P})}})});var L=document.createElement("DIV");L.className="divider",p.appendChild(L),w("clear",T.clearIcon,"Remove all primitives",function(){v.primitives.removeAll()}),oe(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=N(l,{container:a}),new i.DrawHelperWidget(this,l)};function K(a,l){var T=new m.Rectangle;T.west=Math.min(a.longitude,l.longitude),T.east=Math.max(a.longitude,l.longitude),T.south=Math.min(a.latitude,l.latitude),T.north=Math.max(a.latitude,l.latitude);var h=m.Math.EPSILON7;return T.east-T.west<h&&(T.east+=h*2),T.north-T.south<h&&(T.north+=h*2),T}function Y(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function k(a,l){if(a==null||typeof a!="object"||a.constructor!=Object&&a.constructor!=Array)return a;if(a.constructor==Date||a.constructor==RegExp||a.constructor==Function||a.constructor==String||a.constructor==Number||a.constructor==Boolean)return new a.constructor(a);l=l||new a.constructor;for(var T in a)l[T]=typeof l[T]>"u"?k(a[T],null):l[T];return l}function q(a,l){a=a||{};var T;for(T in l)a[T]===void 0&&(a[T]=k(l[T]))}function N(a,l){var T=k(a),h;for(h in l)T[h]===void 0&&(T[h]=k(l[h]));return T}function U(a,l,T){a[l]=T}function oe(a){a._listeners={},a.addListener=function(l,T){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(T),this._listeners[l].length},a.executeListeners=function(l,T){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var h=0;h<this._listeners[l.name].length;h++)this._listeners[l.name][h](l);else T&&T(l)}}return i}();const Sr=2,br=(e,n)=>{switch(e){case ae.BOX:{if(n.features.length!==Sr)throw new Error(`${e} must have 2 points`);const t=z.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===Oe.BOTTOM_LEFT}),i=z.find(n.features,s=>{var r;return((r=s.properties)==null?void 0:r.type)===Oe.TOP_RIGHT});if(i&&t){if(t.geometry.coordinates[0]===i.geometry.coordinates[0]&&t.geometry.coordinates[1]===i.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],i.geometry.coordinates[0],i.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},ln=e=>{const n=e.map(t=>{const i=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(i.longitude),S.Math.toDegrees(i.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},cn=e=>{const n=ht.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return ct(lt(n))},dn=e=>{const n=ht.lineString([[e.west,e.south],[e.east,e.north]]);return ct(lt(n)).geometry.coordinates[0].map(i=>S.Cartesian3.fromRadiansArray(i)[0])};class Lr extends S.Color{}const Mr=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:r,outlineWidth:u}=e,g=re(),[f,y]=c.useState();c.useEffect(()=>{y(new Ee(g,t,i))},[]),c.useEffect(()=>{if(f){const _=f;if(n.drawing)switch(n.type){case ae.POLYGON:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingPolygon({callback:b=>{n.handler({primitive:b,type:ae.POLYGON,geojson:ln(b)})}});break;case ae.BOX:g.scene.globe.depthTestAgainstTerrain=!1,_.startDrawingExtent({callback:b=>{n.handler({primitive:b,type:ae.BOX,geojson:cn(b)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else _.stopDrawing(),g.scene.globe.depthTestAgainstTerrain=!0}},[n,f]);const C=_=>{try{let b=_.coordinates!==void 0?_.coordinates:br(_.type,_.geojson);if(r!==!0)switch(_.type){case ae.BOX:return o.jsx(sn,{coordinates:b,material:s??t});case ae.POLYGON:return o.jsx(on,{hierarchy:new S.PolygonHierarchy(b),material:s??t});default:return o.jsx(o.Fragment,{})}else{switch(_.type){case ae.BOX:b=dn(b);break;case ae.POLYGON:b=[...b,b[0]];break;default:return o.jsx(o.Fragment,{})}return o.jsx(wr,{clampToGround:!0,positions:b,width:u??1,material:s??t})}}catch(b){return console.error(b),o.jsx(o.Fragment,{})}};return o.jsx(an,{...e,children:e.drawings.map((_,b)=>o.jsxs(nn,{name:_.name,children:[o.jsxs(rn,{children:[o.jsxs("h1",{children:["Drawed Entity ",_.name]}),o.jsx("p",{children:"This is description of drawed entity"})]}),C(_)]},_.id))})},_r=e=>{const n=re();return c.useEffect(()=>{n.extend(S.viewerCesiumInspectorMixin)},[n]),o.jsx(o.Fragment,{})},Pr=-25,un=2,Ir=e=>{const n=re(),t=(r,u=",")=>r.slice(r.indexOf(`
2
2
  `)+1).split(`
3
- `).map(y=>{const T=y.split(u);return{cartographic:S.Cartographic.fromDegrees(parseFloat(T[0]),parseFloat(T[1])),cartesian:new S.Cartesian2(parseFloat(T[0]),parseFloat(T[1]))}}),i=r=>{var g;r.preventDefault(),r.persist();const u=new FileReader;u.onload=f=>{var b;const y=(b=f.target)==null?void 0:b.result,T=t(y),_=S.Ellipsoid.WGS84;console.log(`Loaded CSV content:
4
- `,y),S.sampleTerrainMostDetailed(n.terrainProvider,T.map(D=>D.cartographic)).then(D=>{console.log(D),D=D.slice(0,D.length-1),n.scene.globe.depthTestAgainstTerrain=!0,n.entities.suspendEvents(),n.entities.removeAll(),D.forEach((x,W)=>{n.entities.add({name:(W+un).toString(),position:_.cartographicToCartesian(x),billboard:{verticalOrigin:S.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(W+un).toString(),font:"14pt monospace",fillColor:S.Color.BLACK,style:S.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:S.Color.BLACK,verticalOrigin:S.VerticalOrigin.BOTTOM,pixelOffset:new S.Cartesian2(0,Pr)},description:`
5
- Long: ${T[W].cartesian.x} </br>
6
- Lat: ${T[W].cartesian.y} </br>
3
+ `).map(y=>{const C=y.split(u);return{cartographic:S.Cartographic.fromDegrees(parseFloat(C[0]),parseFloat(C[1])),cartesian:new S.Cartesian2(parseFloat(C[0]),parseFloat(C[1]))}}),i=r=>{var g;r.preventDefault(),r.persist();const u=new FileReader;u.onload=f=>{var b;const y=(b=f.target)==null?void 0:b.result,C=t(y),_=S.Ellipsoid.WGS84;console.log(`Loaded CSV content:
4
+ `,y),S.sampleTerrainMostDetailed(n.terrainProvider,C.map(D=>D.cartographic)).then(D=>{console.log(D),D=D.slice(0,D.length-1),n.scene.globe.depthTestAgainstTerrain=!0,n.entities.suspendEvents(),n.entities.removeAll(),D.forEach((x,W)=>{n.entities.add({name:(W+un).toString(),position:_.cartographicToCartesian(x),billboard:{verticalOrigin:S.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(W+un).toString(),font:"14pt monospace",fillColor:S.Color.BLACK,style:S.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:S.Color.BLACK,verticalOrigin:S.VerticalOrigin.BOTTOM,pixelOffset:new S.Cartesian2(0,Pr)},description:`
5
+ Long: ${C[W].cartesian.x} </br>
6
+ Lat: ${C[W].cartesian.y} </br>
7
7
  Height(m): <span style="font-weight: 500">${x.height}</span>
8
- `})}),n.entities.resumeEvents(),r.target.files!==null&&(s(`terranian_heights_${r.target.files[0].name}`,T),r.target.value=""),console.log("Pinned point count is ",n.entities.values.length)},D=>{console.error("ERROR while sampleTerrainMostDetailed:",D)})},(g=r.target.files)!=null&&g[0]&&u.readAsText(r.target.files[0])},s=(r,u)=>{const g=b=>{let D="";return D+=b.cartesian.x.toString()+",",D+=b.cartesian.y.toString()+",",D+=b.cartographic.height.toString(),D+`
8
+ `})}),n.entities.resumeEvents(),r.target.files!==null&&(s(`terranian_heights_${r.target.files[0].name}`,C),r.target.value=""),console.log("Pinned point count is ",n.entities.values.length)},D=>{console.error("ERROR while sampleTerrainMostDetailed:",D)})},(g=r.target.files)!=null&&g[0]&&u.readAsText(r.target.files[0])},s=(r,u)=>{const g=b=>{let D="";return D+=b.cartesian.x.toString()+",",D+=b.cartesian.y.toString()+",",D+=b.cartographic.height.toString(),D+`
9
9
  `};let f=`long,lat,height
10
- `;u.forEach(b=>{f+=g(b)});const y=new Blob([f],{type:"text/csv;charset=utf-8;"}),T=document.createElement("a"),_=URL.createObjectURL(y);T.setAttribute("href",_),T.setAttribute("download",r),T.style.visibility="hidden",document.body.appendChild(T),T.click(),document.body.removeChild(T)};return o.jsx(o.Fragment,{children:o.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:r=>{i(r)}})})},yo="",Ar=38,Dr=40,Or=13,kr=14,xr=27,Nr=9,Br=10,Fr=100,Vr=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[r,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),g=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",x),()=>{try{window.removeEventListener("resize",x)}catch(E){console.log('WINDOW "resize" remove listener failed',E)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:E}=e,{caret:p}=r;K(n,p,E)},[e]);const f=(E,p,w)=>{const{trigger:v,matchAny:L,regex:I}=e,P=new RegExp(I);let M=v;Array.isArray(M)||(M=new Array(v)),M.sort();const A={};Array.isArray(w)&&M.forEach(J=>{A[J]=w});const O=y(M,P);let j={};for(let J=0;J<O.length;J++){const{triggerStr:B,triggerMatch:$,triggerLength:te}=O[J];for(let se=p-1;se>=0;--se){const fe=E.substring(se,p).match(P);let de=-1;if(te>0){const he=$?se:se-te+1;if(he<0||(T(B,E,he)&&(de=he+te),!fe&&de<0))break}else{if(fe&&se>0)continue;if(de=se===0&&fe?0:se+1,p-de===0)break}if(de>=0){const he=A[B];if(!Array.isArray(he))continue;const Ie=E.substring(de,p),X=he.filter(we=>{const Se=we.toLowerCase().indexOf(Ie.toLowerCase());return Se!==-1&&(L||Se===0)}),V=B,ne=Ie.length;j={...j,trigger:V,matchStart:de,matchLength:ne,options:X}}}}return j},y=(E,p)=>E.map(v=>({triggerStr:v,triggerMatch:v.match(p),triggerLength:v.length})),T=(E,p,w)=>!E||!E.length||p.substr(w,E.length)===E,_=E=>{const{onChange:p,options:w,spaceRemovers:v,spacer:L,value:I}=e,P=n,M=E.target.value,A=dt(b(E.target)).end;if(M.length||H({...r,helperVisible:!1}),t(M),H({...r,caret:A,value:E.target.value}),!M.length||!A)return p(E.target.value);if(i&&v.length&&M.length>2&&L.length){for(let O=0;O<Math.max(P.length,M.length);++O)if(P[O]!==M[O]){if(O>=2&&M[O-1]===L&&v.indexOf(M[O-2])===-1&&v.indexOf(M[O])!==-1&&!z.isEmpty(f(M.substring(0,O-2),A-3,w))){const j=`${M.slice(0,O-1)}${M.slice(O,O+1)}${M.slice(O-1,O)}${M.slice(O+1)}`;return Q(O+1),g.current!==null&&(g.current.value=j),I||H({...r,value:j}),p(j)}break}s(!1)}return K(M,A,w),p(E.target.value)},b=E=>{if(E!==void 0)if(E.children.length>0){const p=E.getElementsByTagName("textarea");if(p.length>0)return p[0];const w=E.getElementsByTagName("input");if(w.length>0)return w[0]}else return E},D=E=>{const{helperVisible:p,options:w,selection:v}=r,{onKeyDown:L,passThroughEnter:I}=e;if(p)switch(E.keyCode){case xr:E.preventDefault(),Y();break;case Ar:E.preventDefault(),H({...r,selection:(w.length+v-1)%w.length});break;case Dr:E.preventDefault(),H({...r,selection:(v+1)%w.length});break;case kr:case Or:I||E.preventDefault(),W(v);break;case Nr:W(v);break;default:L(E);break}else L(E)},x=()=>{H({...r,helperVisible:!1})},W=E=>{const{spacer:p,onSelect:w,changeOnSelect:v}=e,{matchStart:L,matchLength:I,options:P,trigger:M}=r,A=P[E],O=n,j=O.substring(0,L-M.length),J=O.substring(L+I),B={target:g.current},$=v(M,A);B.target!==null&&(B.target.value=`${j}${$}${p}${J}`),_(B),B.target!==null&&w(B.target.value),Y(),Q(j.length+$.length+1),s(!0)},Q=E=>{H({...r,caret:E});const p=b(g.current);dt.setCaretPosition(p,E)},H=E=>{setTimeout(()=>{u({...E})},0)},K=(E,p,w)=>{const v=g.current;if(g.current===null)return;const L=b(v);if(L===void 0)return;const I=v.getBoundingClientRect(),P=f(E,p,w);if(Object.keys(P).length>0&&L!==null){const M=xn(L,p),A=L.getBoundingClientRect(),{minChars:O,onRequestOptions:j,requestOnlyIfNoOptions:J,mode:B}=e;let $,te,se,Ce="unset";B==="assist"?($=v===L?M.top+L.offsetTop:M.top+I.top,te=Math.min(M.left+L.offsetLeft-Br,L.offsetLeft+A.width-Fr)):($=I.top+v.offsetHeight,te=v.offsetLeft,se=v.offsetLeft-v.offsetWidth,Ce=`${I.width}px`),P.matchLength>=O&&(P.options.length>1||P.options.length===1&&P.options[0].length!==P.matchLength)?H({...r,value:E,helperVisible:!0,top:$,left:te,right:se,width:Ce,...P}):((!J||!P.options.length)&&j(E.substr(P.matchStart,P.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{H({...r,helperVisible:!1,selection:0})},100)},k=()=>{const{helperVisible:E,left:p,right:w,matchStart:v,matchLength:L,options:I,selection:P,top:M,value:A,width:O}=r;if(!E)return null;const{maxOptions:j,offsetX:J,offsetY:B,direction:$}=e;if(I.length===0)return null;if(P>=I.length)return H({...r,selection:0}),null;const te=j===0?I.length:j,se=I.slice(0,te).map((fe,de)=>{const he=fe.toLowerCase().indexOf(A.substr(v,L).toLowerCase());return o.jsxs("li",{className:de===P?"active":void 0,onClick:()=>{W(de)},onMouseEnter:()=>{H({...r,selection:de})},children:[fe.slice(0,he),o.jsx("strong",{children:fe.substr(he,L)}),fe.slice(he+L)]},fe)}),Ce=$==="ltr"?{left:p+J}:{right:w+J};return o.jsx("ul",{className:"react-autocomplete-input",style:{...Ce,top:M+B,width:O},children:se})},{Component:q,ComponentProps:N,defaultValue:U,disabled:oe,onBlur:a,value:l,...C}=e,h=Object.assign({},C);return Object.keys(e).forEach(E=>{delete h[E]}),o.jsxs(o.Fragment,{children:[c.cloneElement(q,{disabled:oe,onBlur:a,onChange:_,onKeyDown:D,ref:g,value:n,...h,...N}),k()]})},Gr={Component:o.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,n)=>`${e}${n}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},Hr=e=>{let n={...Gr,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),o.jsx(Vr,{...n})},ze={formatFileModDate:(e,n)=>{const t=F.FileHelper.getModDate(n);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,n)=>{if(!n||typeof n.size!="number")return null;const t=n.size,i=Bn(t,{bits:!1,output:"object"});return i.symbol==="B"?`${Math.round(i.value/10)/100} KB`:i.symbol==="KB"?`${Math.round(i.value)} ${i.symbol}`:`${i.value} ${i.symbol.toUpperCase()}`}},zr={locale:ue.EN,formatters:{...ze}},Wr={locale:ue.RU,formatters:{...ze},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
10
+ `;u.forEach(b=>{f+=g(b)});const y=new Blob([f],{type:"text/csv;charset=utf-8;"}),C=document.createElement("a"),_=URL.createObjectURL(y);C.setAttribute("href",_),C.setAttribute("download",r),C.style.visibility="hidden",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return o.jsx(o.Fragment,{children:o.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:r=>{i(r)}})})},yo="",Ar=38,Dr=40,Or=13,kr=14,xr=27,Nr=9,Br=10,Fr=100,Vr=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[r,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),g=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",x),()=>{try{window.removeEventListener("resize",x)}catch(E){console.log('WINDOW "resize" remove listener failed',E)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:E}=e,{caret:p}=r;K(n,p,E)},[e]);const f=(E,p,w)=>{const{trigger:v,matchAny:L,regex:I}=e,P=new RegExp(I);let M=v;Array.isArray(M)||(M=new Array(v)),M.sort();const A={};Array.isArray(w)&&M.forEach(J=>{A[J]=w});const O=y(M,P);let j={};for(let J=0;J<O.length;J++){const{triggerStr:B,triggerMatch:$,triggerLength:te}=O[J];for(let se=p-1;se>=0;--se){const fe=E.substring(se,p).match(P);let de=-1;if(te>0){const he=$?se:se-te+1;if(he<0||(C(B,E,he)&&(de=he+te),!fe&&de<0))break}else{if(fe&&se>0)continue;if(de=se===0&&fe?0:se+1,p-de===0)break}if(de>=0){const he=A[B];if(!Array.isArray(he))continue;const Ie=E.substring(de,p),X=he.filter(we=>{const Se=we.toLowerCase().indexOf(Ie.toLowerCase());return Se!==-1&&(L||Se===0)}),V=B,ne=Ie.length;j={...j,trigger:V,matchStart:de,matchLength:ne,options:X}}}}return j},y=(E,p)=>E.map(v=>({triggerStr:v,triggerMatch:v.match(p),triggerLength:v.length})),C=(E,p,w)=>!E||!E.length||p.substr(w,E.length)===E,_=E=>{const{onChange:p,options:w,spaceRemovers:v,spacer:L,value:I}=e,P=n,M=E.target.value,A=dt(b(E.target)).end;if(M.length||H({...r,helperVisible:!1}),t(M),H({...r,caret:A,value:E.target.value}),!M.length||!A)return p(E.target.value);if(i&&v.length&&M.length>2&&L.length){for(let O=0;O<Math.max(P.length,M.length);++O)if(P[O]!==M[O]){if(O>=2&&M[O-1]===L&&v.indexOf(M[O-2])===-1&&v.indexOf(M[O])!==-1&&!z.isEmpty(f(M.substring(0,O-2),A-3,w))){const j=`${M.slice(0,O-1)}${M.slice(O,O+1)}${M.slice(O-1,O)}${M.slice(O+1)}`;return Q(O+1),g.current!==null&&(g.current.value=j),I||H({...r,value:j}),p(j)}break}s(!1)}return K(M,A,w),p(E.target.value)},b=E=>{if(E!==void 0)if(E.children.length>0){const p=E.getElementsByTagName("textarea");if(p.length>0)return p[0];const w=E.getElementsByTagName("input");if(w.length>0)return w[0]}else return E},D=E=>{const{helperVisible:p,options:w,selection:v}=r,{onKeyDown:L,passThroughEnter:I}=e;if(p)switch(E.keyCode){case xr:E.preventDefault(),Y();break;case Ar:E.preventDefault(),H({...r,selection:(w.length+v-1)%w.length});break;case Dr:E.preventDefault(),H({...r,selection:(v+1)%w.length});break;case kr:case Or:I||E.preventDefault(),W(v);break;case Nr:W(v);break;default:L(E);break}else L(E)},x=()=>{H({...r,helperVisible:!1})},W=E=>{const{spacer:p,onSelect:w,changeOnSelect:v}=e,{matchStart:L,matchLength:I,options:P,trigger:M}=r,A=P[E],O=n,j=O.substring(0,L-M.length),J=O.substring(L+I),B={target:g.current},$=v(M,A);B.target!==null&&(B.target.value=`${j}${$}${p}${J}`),_(B),B.target!==null&&w(B.target.value),Y(),Q(j.length+$.length+1),s(!0)},Q=E=>{H({...r,caret:E});const p=b(g.current);dt.setCaretPosition(p,E)},H=E=>{setTimeout(()=>{u({...E})},0)},K=(E,p,w)=>{const v=g.current;if(g.current===null)return;const L=b(v);if(L===void 0)return;const I=v.getBoundingClientRect(),P=f(E,p,w);if(Object.keys(P).length>0&&L!==null){const M=xn(L,p),A=L.getBoundingClientRect(),{minChars:O,onRequestOptions:j,requestOnlyIfNoOptions:J,mode:B}=e;let $,te,se,Ce="unset";B==="assist"?($=v===L?M.top+L.offsetTop:M.top+I.top,te=Math.min(M.left+L.offsetLeft-Br,L.offsetLeft+A.width-Fr)):($=I.top+v.offsetHeight,te=v.offsetLeft,se=v.offsetLeft-v.offsetWidth,Ce=`${I.width}px`),P.matchLength>=O&&(P.options.length>1||P.options.length===1&&P.options[0].length!==P.matchLength)?H({...r,value:E,helperVisible:!0,top:$,left:te,right:se,width:Ce,...P}):((!J||!P.options.length)&&j(E.substr(P.matchStart,P.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{H({...r,helperVisible:!1,selection:0})},100)},k=()=>{const{helperVisible:E,left:p,right:w,matchStart:v,matchLength:L,options:I,selection:P,top:M,value:A,width:O}=r;if(!E)return null;const{maxOptions:j,offsetX:J,offsetY:B,direction:$}=e;if(I.length===0)return null;if(P>=I.length)return H({...r,selection:0}),null;const te=j===0?I.length:j,se=I.slice(0,te).map((fe,de)=>{const he=fe.toLowerCase().indexOf(A.substr(v,L).toLowerCase());return o.jsxs("li",{className:de===P?"active":void 0,onClick:()=>{W(de)},onMouseEnter:()=>{H({...r,selection:de})},children:[fe.slice(0,he),o.jsx("strong",{children:fe.substr(he,L)}),fe.slice(he+L)]},fe)}),Ce=$==="ltr"?{left:p+J}:{right:w+J};return o.jsx("ul",{className:"react-autocomplete-input",style:{...Ce,top:M+B,width:O},children:se})},{Component:q,ComponentProps:N,defaultValue:U,disabled:oe,onBlur:a,value:l,...T}=e,h=Object.assign({},T);return Object.keys(e).forEach(E=>{delete h[E]}),o.jsxs(o.Fragment,{children:[c.cloneElement(q,{disabled:oe,onBlur:a,onChange:_,onKeyDown:D,ref:g,value:n,...h,...N}),k()]})},Gr={Component:o.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,n)=>`${e}${n}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},Hr=e=>{let n={...Gr,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),o.jsx(Vr,{...n})},ze={formatFileModDate:(e,n)=>{const t=F.FileHelper.getModDate(n);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,n)=>{if(!n||typeof n.size!="number")return null;const t=n.size,i=Bn(t,{bits:!1,output:"object"});return i.symbol==="B"?`${Math.round(i.value/10)/100} KB`:i.symbol==="KB"?`${Math.round(i.value)} ${i.symbol}`:`${i.value} ${i.symbol.toUpperCase()}`}},zr={locale:ue.EN,formatters:{...ze}},Wr={locale:ue.RU,formatters:{...ze},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
11
11
  one {# файл}
12
12
  few {# файла}
13
13
  other {# файлов}
@@ -30,4 +30,4 @@
30
30
  =0 {}
31
31
  one {# נסתר}
32
32
  other {# נסתרים}
33
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},qr={[ue.EN]:zr,[ue.RU]:Wr,[ue.HE]:$r},vo="";class Ur extends F.FileHelper{}const jr=F.ChonkyActions,hn={listView:F.ChonkyActions.EnableListView.id,gridView:F.ChonkyActions.EnableGridView.id};F.setChonkyDefaults({iconComponent:Nn.ChonkyIconFA});const Kr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=hn.listView,readOnlyMode:i=!1,locale:s,files:r,folderChain:u,onFileAction:g,...f},y)=>{const T=c.useCallback(U=>null,[]);ve.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const _=U=>U.replace(/([A-Z])/g,oe=>"-"+oe.toLowerCase()),b=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((oe,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${_(a)}`,oe[a]=l,oe},{}):{},[e]),[D,x]=c.useState(!1),[W,Q]=c.useState(),[H,K]=c.useState(!1),[Y,k]=c.useState(),[q,N]=c.useState();return c.useEffect(()=>{e&&x(!0),Q(t),i?K(!0):k([F.ChonkyActions.CreateFolder,F.ChonkyActions.DeleteFiles]),s!==void 0&&N(qr[s])},[e,t,i,s]),o.jsx(ce,{style:{...n,...b},children:o.jsx(F.FullFileBrowser,{ref:y,files:r??[],folderChain:u,onFileAction:U=>{typeof g=="function"&&g(U)},thumbnailGenerator:T,defaultFileViewActionId:W,disableDragAndDrop:H,fileActions:Y,darkMode:D,i18n:q,...f})})}));d.useMediaQuery=mn,Object.defineProperty(d,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(d,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),d.Autocomplete=Hr,d.BboxCorner=Oe,d.Box=ce,d.COORDINATES_MERCATOR_FRACTION_DIGITS=Ne,d.COORDINATES_WGS_FRACTION_DIGITS=xe,d.Cesium3DTileset=fr,d.CesiumBoundingSphere=Fi,d.CesiumCartesian2=Ni,d.CesiumCartesian3=Bi,d.CesiumCartographic=Gt,d.CesiumCesiumTerrainProvider=$i,d.CesiumColor=Lr,d.CesiumConstantPositionProperty=xi,d.CesiumConstantProperty=ki,d.CesiumCustomDataSource=an,d.CesiumDrawingsDataSource=Mr,d.CesiumEllipsoid=Vi,d.CesiumEllipsoidTerrainProvider=Wi,d.CesiumEntity=nn,d.CesiumEntityDescription=Tr,d.CesiumEntityStaticDescription=rn,d.CesiumGeographicTilingScheme=Gi,d.CesiumGeojsonLayer=mr,d.CesiumImageryLayer=Pe,d.CesiumLabelStyle=Ui,d.CesiumMap=gr,d.CesiumOSMLayer=Cr,d.CesiumPolygonGraphics=on,d.CesiumPolylineDashMaterialProperty=Oi,d.CesiumRectangle=Hi,d.CesiumRectangleGraphics=sn,d.CesiumResource=zi,d.CesiumSceneMode=ie,d.CesiumVerticalOrigin=qi,d.CesiumViewer=ur,d.CesiumWMSLayer=yr,d.CesiumWMTSLayer=vr,d.CesiumXYZLayer=Er,d.CoordinatesTrackerTool=Ht,d.CssBaseline=Pi,d.DateRangePicker=qn,d.DateTimePicker=Un,d.DateTimeRangePicker=pt,d.DateTimeRangePickerFormControl=Hn,d.DrawHelper=Ee,d.DrawInteraction=At,d.DrawType=ae,d.FileHelper=Ur,d.FilePicker=Kr,d.FilePickerActions=jr,d.FilePickerViewObj=hn,d.GeoJSONFeature=Pt,d.InspectorTool=_r,d.Legend=wi,d.MVTSource=Ti,d.Map=Et,d.MapFilterContainer=oi,d.Popover=ft,d.Proj=pe,d.ScaleTrackerTool=zt,d.ScopedCssBaseline=Ii,d.SmartTable=_i,d.SupportedLocales=ue,d.TerrainianHeightTool=Ir,d.TileLayer=Tt,d.TileOsm=It,d.TileWMS=fi,d.TileWMTS=gi,d.TileXYZ=yi,d.TimeRangeInput=zn,d.VectorLayer=bt,d.VectorSource=_t,d.VectorTileLayer=ai,d.ZoomLevelTrackerTool=$t,d.defaultFormatters=ze,d.getMVTOptions=Ci,d.getWMSOptions=pi,d.getWMTSOptions=hi,d.getXYZOptions=mi,d.isDateRange=ke,d.mapMcToMuiTheme=gt,d.polygonToGeoJSON=ln,d.rectangleToGeoJSON=cn,d.rectangleToPositions=dn,d.useCesiumMap=re,d.useMap=Te,d.useMappedMuiTheme=Ke,d.useTileLayer=_e,d.useVectorLayer=St,d.useVectorSource=Mt,d.useVectorTileLayer=Nt,d.useVectorTileSource=Ei,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
33
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${F.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${F.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${F.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${F.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${F.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${F.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${F.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${F.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${F.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${F.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${F.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${F.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},qr={[ue.EN]:zr,[ue.RU]:Wr,[ue.HE]:$r},vo="";class Ur extends F.FileHelper{}const jr=F.ChonkyActions,hn={listView:F.ChonkyActions.EnableListView.id,gridView:F.ChonkyActions.EnableGridView.id};F.setChonkyDefaults({iconComponent:Nn.ChonkyIconFA});const Kr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=hn.listView,readOnlyMode:i=!1,locale:s,files:r,folderChain:u,onFileAction:g,...f},y)=>{const C=c.useCallback(U=>null,[]);ve.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const _=U=>U.replace(/([A-Z])/g,oe=>"-"+oe.toLowerCase()),b=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((oe,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${_(a)}`,oe[a]=l,oe},{}):{},[e]),[D,x]=c.useState(!1),[W,Q]=c.useState(),[H,K]=c.useState(!1),[Y,k]=c.useState(),[q,N]=c.useState();return c.useEffect(()=>{e&&x(!0),Q(t),i?K(!0):k([F.ChonkyActions.CreateFolder,F.ChonkyActions.DeleteFiles]),s!==void 0&&N(qr[s])},[e,t,i,s]),o.jsx(ce,{style:{...n,...b},children:o.jsx(F.FullFileBrowser,{ref:y,files:r??[],folderChain:u,onFileAction:U=>{typeof g=="function"&&g(U)},thumbnailGenerator:C,defaultFileViewActionId:W,disableDragAndDrop:H,fileActions:Y,darkMode:D,i18n:q,...f})})}));d.useMediaQuery=mn,Object.defineProperty(d,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(d,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),d.Autocomplete=Hr,d.BboxCorner=Oe,d.Box=ce,d.COORDINATES_MERCATOR_FRACTION_DIGITS=Ne,d.COORDINATES_WGS_FRACTION_DIGITS=xe,d.Cesium3DTileset=fr,d.CesiumBoundingSphere=Fi,d.CesiumCartesian2=Ni,d.CesiumCartesian3=Bi,d.CesiumCartographic=Gt,d.CesiumCesiumTerrainProvider=$i,d.CesiumColor=Lr,d.CesiumConstantPositionProperty=xi,d.CesiumConstantProperty=ki,d.CesiumCustomDataSource=an,d.CesiumDrawingsDataSource=Mr,d.CesiumEllipsoid=Vi,d.CesiumEllipsoidTerrainProvider=Wi,d.CesiumEntity=nn,d.CesiumEntityDescription=Tr,d.CesiumEntityStaticDescription=rn,d.CesiumGeographicTilingScheme=Gi,d.CesiumGeojsonLayer=mr,d.CesiumImageryLayer=Pe,d.CesiumLabelStyle=Ui,d.CesiumMap=gr,d.CesiumOSMLayer=Cr,d.CesiumPolygonGraphics=on,d.CesiumPolylineDashMaterialProperty=Oi,d.CesiumRectangle=Hi,d.CesiumRectangleGraphics=sn,d.CesiumResource=zi,d.CesiumSceneMode=ie,d.CesiumVerticalOrigin=qi,d.CesiumViewer=ur,d.CesiumWMSLayer=yr,d.CesiumWMTSLayer=vr,d.CesiumXYZLayer=Er,d.CoordinatesTrackerTool=Ht,d.CssBaseline=Pi,d.DateRangePicker=qn,d.DateTimePicker=Un,d.DateTimeRangePicker=pt,d.DateTimeRangePickerFormControl=Hn,d.DrawHelper=Ee,d.DrawInteraction=At,d.DrawType=ae,d.FileHelper=Ur,d.FilePicker=Kr,d.FilePickerActions=jr,d.FilePickerViewObj=hn,d.GeoJSONFeature=Pt,d.InspectorTool=_r,d.Legend=wi,d.MVTSource=Ti,d.Map=Et,d.MapFilterContainer=oi,d.Popover=ft,d.Proj=pe,d.ScaleTrackerTool=zt,d.ScopedCssBaseline=Ii,d.SmartTable=_i,d.SupportedLocales=ue,d.TerrainianHeightTool=Ir,d.TileLayer=Tt,d.TileOsm=It,d.TileWMS=fi,d.TileWMTS=gi,d.TileXYZ=yi,d.TimeRangeInput=zn,d.VectorLayer=bt,d.VectorSource=_t,d.VectorTileLayer=ai,d.ZoomLevelTrackerTool=$t,d.defaultFormatters=ze,d.getMVTOptions=Ci,d.getWMSOptions=pi,d.getWMTSOptions=hi,d.getXYZOptions=mi,d.isDateRange=ke,d.mapMcToMuiTheme=gt,d.polygonToGeoJSON=ln,d.rectangleToGeoJSON=cn,d.rectangleToPositions=dn,d.useCesiumMap=re,d.useMap=Te,d.useMappedMuiTheme=Ke,d.useTileLayer=_e,d.useVectorLayer=St,d.useVectorSource=Mt,d.useVectorTileLayer=Nt,d.useVectorTileSource=Ei,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
@@ -10,6 +10,7 @@ interface ViewerProps extends ComponentProps<typeof Viewer> {
10
10
  }
11
11
  export declare class CesiumViewer extends CesiumViewerCls {
12
12
  layersManager?: LayerManager;
13
+ currentZoomLevel?: number;
13
14
  private useOptimizedTileRequests?;
14
15
  constructor(container: string | Element, options?: CesiumViewerCls.ConstructorOptions);
15
16
  get shouldOptimizedTileRequests(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@map-colonies/react-components",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "main": "./dist/@map-colonies/react-components.umd.js",
5
5
  "module": "./dist/@map-colonies/react-components.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -72,5 +72,5 @@
72
72
  "files": [
73
73
  "dist"
74
74
  ],
75
- "gitHead": "c7308692966492aaa3911a3c288ba2d0ca9d9fd8"
75
+ "gitHead": "c9b4eb0022d3a3cba6871e3018374cda54666b3c"
76
76
  }