@map-colonies/react-components 4.1.2 → 4.2.0

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,4 +1,4 @@
1
- (function(g,r){typeof exports=="object"&&typeof module<"u"?r(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("@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("@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","@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","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.reactComponents={},g.jsxRuntime,g.React,g.dateFns,g.locale,g.pickers,g.DateFnsUtils,g.styles,g.core,g.reactCore,g.useMediaQuery,g.DatePicker,g.datePickerHebrewLocale,g.moment,g.rewind,g.ol,null,g.coordinate,g.control,g.MousePosition,g.proj,g.layer,g.source,g.format,g.interaction,g.Draw,g.TableHead,g.utils,g.CssBaseline,g.ScopedCssBaseline,g.ReactDOM,g.resium,g.Cesium,g.lodash,g.booleanPointInPolygon,g.turf,g.bbox,g.bboxPolygon,g.getCaretCoordinates,g.getInputSelection,g.chonky,g.chonkyIconFontawesome,g.filesize))})(this,function(g,r,c,de,Se,ve,$e,me,Y,z,xt,We,Nt,Ee,Bt,Ue,lr,qe,Oe,xe,Ft,je,Ke,Ye,Ht,Gt,Vt,Xe,zt,$t,Wt,ge,T,U,Ut,qt,Ze,Je,jt,Qe,H,Kt,Yt){"use strict";var sr=Object.defineProperty;var ar=(g,r,c)=>r in g?sr(g,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):g[r]=c;var te=(g,r,c)=>(ar(g,typeof r!="symbol"?r+"":r,c),c);function Ne(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 Re=Ne(c),f=Ne(T),et=Ne(qt);var re=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(re||{}),ae=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(ae||{}),Te=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Te||{});const ee={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:ae.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:ae.EN},renderAsButton:!0,offset:0,disableFuture:!0}},se=e=>{const{children:n,...t}=e;return r.jsx(Y.Box,{...t,children:n})},Be=e=>{const n=e.type==="dark";return c.useMemo(()=>tt(e,n),[n,e])},tt=(e,n=!1)=>me.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}}}),cr="",Xt=2,Zt=.5,Jt=me.makeStyles(e=>me.createStyles({container:{padding:e.spacing(Xt),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Zt)}})),nt=e=>{var K,N,q,B;const n=Jt(),t=z.useTheme(),i=Be(t),[s,o]=c.useState(null),[u,h]=c.useState(null),[m,w]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),_=e.controlsLayout??ee.DATE_RANGE_PICKER.controlsLayout,D=e.disableFuture??ee.DATE_RANGE_PICKER.disableFuture,P=((K=e.local)==null?void 0:K.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,x=((N=e.local)==null?void 0:N.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,V=((q=e.local)==null?void 0:q.setText)??ee.DATE_RANGE_PICKER.local.setText,Z=(((B=e.local)==null?void 0:B.calendarLocale)??ee.DATE_RANGE_PICKER.local.calendarLocale)===ae.HE?Se.he:Se.enUS;c.useEffect(()=>{o(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{w(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(de.isValid(s)&&!u||de.isValid(u)&&!s||s&&u&&de.isValid(s)&&de.isValid(u)&&de.isBefore(s,u)),Q=()=>{e.onChange({from:s&&de.isValid(s)?s:void 0,to:u&&de.isValid(u)?u:void 0})};return r.jsx(Y.ThemeProvider,{theme:i,children:r.jsx(se,{className:`${n.container} drpContainer`,display:"flex",flexDirection:_,width:_==="column"?e.contentWidth:"unset",children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:$e,locale:Z,children:[r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:P,onChange:$=>o($),value:s,disableFuture:D,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:x,className:n.margin,onChange:$=>h($),value:u,disableFuture:D,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(z.ThemeProvider,{options:t,children:r.jsx(z.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:Q,disabled:!G,children:V})})]})})})},it=e=>{const{children:n,...t}=e;return r.jsx(Y.Popover,{...t,children:n})},dr="",Qt=e=>{var N,q;const[n,t]=c.useState(null),[i,s]=c.useState(null),[o,u]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),[h,m]=c.useState(null),w=B=>{m(B.currentTarget)},_=B=>{B.currentTarget.tagName==="I"?m(B.currentTarget.previousElementSibling):m(B.currentTarget)},D=()=>{m(null)},P=Boolean(h),x=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 V=((N=e.local)==null?void 0:N.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,X=((q=e.local)==null?void 0:q.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,Z=e.renderAsButton===void 0?ee.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?ee.DATE_RANGE_PICKER.offset:e.offset,Q=e.disableFuture===void 0?ee.DATE_RANGE_PICKER.disableFuture:e.disableFuture,K=c.useMemo(()=>`${n?de.format(n,o):V} - ${i?de.format(i,o):X}`,[n,i,o,V,X]);return r.jsxs(r.Fragment,{children:[Z?r.jsx(z.Button,{style:{width:e.width},raised:!0,onClick:w,className:"drpOpener",children:K}):r.jsx(z.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:K,onClick:_,trailingIcon:{icon:"date_range",tabIndex:0,onClick:_}}),r.jsx(it,{open:P,anchorEl:h,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(nt,{controlsLayout:x,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:o,disableFuture:Q,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:B,to:$})=>{t(B??null),s($??null),e.onChange({from:B,to:$}),D()}})})]})},be=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Rt=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:m="",startTimeLabel:w="",startTimeWrapperClassName:_=""})=>r.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[r.jsx("div",{className:`startTimeWrapper ${_}`,children:r.jsx(z.TextField,{label:w,disabled:n===null,className:`timeRangeInput ${m}`,name:"start-time",type:"time",value:Ee(n).format("HH:mm"),onChange:D=>{const P=Ee(n),x=Ee(D.currentTarget.value,"HH:mm"),V=P.set({hours:x.get("hours"),minutes:x.get("minutes")});i(V.toDate())}})}),r.jsx("div",{className:`endTimeWrapper ${u}`,children:r.jsx(z.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Ee(e).format("HH:mm"),onChange:D=>{const P=Ee(e),x=Ee(D.currentTarget.value,"HH:mm"),V=P.set({hours:x.get("hours"),minutes:x.get("minutes")});t(V.toDate())}})})]}),en=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>r.jsx(z.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{n==null||n(o),t==null||t()},ref:s,value:e})),tn=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[o,u]=c.useState(),h=c.useMemo(()=>t.map(m=>m instanceof Function?m():m),[t]);return c.useEffect(()=>{for(const m of h){const w=i.startDate&&i.endDate&&de.isSameDay(m.startDate,i.startDate)&&de.isSameDay(m.endDate,i.endDate);o?m.id===o&&(w||u(void 0)):w&&u(m.id)}},[i,o,h]),r.jsx("div",{className:"shortcutsContainer",children:h.map((m,w)=>{const _=()=>{e(m.startDate),n(m.endDate)};return r.jsx(z.Button,{type:"button",className:`shortcut ${o===m.id?"selected":""}`,onClick:D=>{_(),s==null||s({startDate:m.startDate,endDate:m.endDate})},outlined:!0,children:m.label},m.id+w)})})},nn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:o,onChange:u,inputName:h,showMonthYearDropdown:m,withShortcuts:w,locale:_="en"}=e,[D,P]=c.useState(null),[x,V]=c.useState(null),[X,Z]=c.useState(!1),G=o?{startDate:D,endDate:x}:D;c.useEffect(()=>{_==="he"&&We.registerLocale("he",Nt)},[_]),c.useEffect(()=>{var N,q;((N=e.startDate)==null?void 0:N.toString())!==(D==null?void 0:D.toString())&&P(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(x==null?void 0:x.toString())&&V(e.endDate)},[e.startDate,e.endDate,D,x]);const Q=c.useMemo(()=>{let N="pickerContainer"+(_==="he"?" pickerContainer-rtl":"");return w&&o&&(N+=" pickerContainer-withShortcuts"),N},[_,w,o]),K=m?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return r.jsx("div",{className:Q,style:{direction:_==="he"?"rtl":"ltr"},children:r.jsx(We,{...e,ref:n,onClickOutside:()=>Z(!1),open:X,startDate:be(G)?D:void 0,selected:D,endDate:be(G)?x:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:N=>`pickerWeek ${(i==null?void 0:i(N))??""}`,dayClassName:N=>`pickerDay ${(i==null?void 0:i(N))??""}`,monthClassName:N=>`pickerMonth ${(s==null?void 0:s(N))??""}`,onChange:(N,q)=>{if(Array.isArray(N)){const[B,$]=N;P(B),V($),u==null||u({startDate:B,endDate:$&&de.endOfDay($)},q)}else P(N),u==null||u(N,q)},customInput:r.jsx(en,{name:h,onInputClick:()=>{Z(!0)}}),showTimeInput:!!(w&&o),timeInputLabel:"",customTimeInput:w&&be(G)&&r.jsx(tn,{onShortcut:N=>{u==null||u(N),Z(!1)},shortcuts:w,setEndDate:V,setStartDate:P,dateRange:G}),showMonthYearDropdown:void 0,...K})})}),ur="",rn=e=>{const n=z.useTheme(),t=Be(n),[i,s]=c.useState(e.value),{format:o=ee.DATE_PICKER.dateFormat,variant:u=ee.DATE_PICKER.variant,disableFuture:h=ee.DATE_PICKER.disableFuture,local:m,onChange:w,showTime:_=ee.DATE_PICKER.showTime,value:D,...P}=e,{placeHolderText:x=ee.DATE_PICKER.local.placeHolderText,calendarLocale:V}=m??{placeHolderText:ee.DATE_PICKER.local.placeHolderText,calendarLocale:ae.EN},X=V===ae.HE?Se.he:Se.enUS,Z=G=>{s(G),w(G)};return r.jsx(Y.ThemeProvider,{theme:t,children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:$e,locale:X,children:[_&&r.jsx(ve.KeyboardDateTimePicker,{variant:u,placeholder:x,onChange:Z,value:i,disableFuture:h,format:o,...P}),!_&&r.jsx(ve.KeyboardDatePicker,{variant:u,placeholder:x,onChange:Z,value:i,disableFuture:h,format:o,...P})]})})},on=18,sn=me.makeStyles(e=>me.createStyles({drawingButton:{width:e.spacing(on)},fullWidth:{width:"100%",marginTop:"36px"}})),an=e=>{const n=sn(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:u,onReset:h}=e,m=_=>{i(_.currentTarget)},w=()=>{i(null)};return s?r.jsx(z.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):r.jsxs(se,{position:"relative",children:[r.jsx(z.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:m,children:"Draw AOI"})}),r.jsxs(z.Menu,{className:n.fullWidth,open:Boolean(t),onClose:w,children:[r.jsx(z.MenuItem,{onClick:()=>{u(re.POLYGON),w()},children:"Polygon"}),r.jsx(z.MenuItem,{onClick:()=>{u(re.BOX),w()},children:"Box"}),r.jsx(z.MenuItem,{onClick:()=>{h(),w()},children:"Clear"})]})]})},hr="";var ue=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ue||{});const _e=5,Me=2,rt=c.createContext(null),ln=rt.Provider,ot=35,st=32,cn=10,dn=e=>e!==void 0&&e!==ue.WGS84?Ft.transform([ot,st],ue.WGS84,e):[ot,st],un=e=>{switch(e){case ue.WEB_MERCATOR:return n=>qe.format(n,"Mercator: {y}m, {x}m",Me);case ue.WGS84:return n=>qe.format(n,"WGS84: {y}°N {x}°E",_e);default:return n=>""}},Fe=()=>{const e=c.useContext(rt);if(e===null)throw new Error("map context is null, please check the provider");return e},hn=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[o]=c.useState(new Ue.Map({view:new Ue.View({projection:s??ue.WGS84}),controls:Oe.defaults()}));c.useEffect(()=>{o.getView().setCenter(e.center??dn(e.projection))},[o,e.center,e.projection]),c.useEffect(()=>{o.getView().setZoom(e.zoom??cn)},[o,e.zoom,e.projection]);const u=(h,m)=>{m.getControls().forEach(_=>{_ instanceof h&&m.removeControl(_)})};return c.useEffect(()=>{o.setTarget(n.current),t!==void 0&&t?o.addControl(new Oe.FullScreen):u(Oe.FullScreen,o)},[o,t]),c.useEffect(()=>{i!==void 0&&i?(u(xe,o),o.addControl(new xe({coordinateFormat:un(s??ue.WGS84),projection:s??ue.WGS84,undefinedHTML:"&nbsp;"}))):u(xe,o)},[o,i,s]),r.jsxs(ln,{value:o,children:[r.jsx("div",{className:"map",ref:n}),e.children]})},at=c.createContext(null),gn=at.Provider,pn=()=>{const e=c.useContext(at);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},fn=({options:e,children:n})=>{const t=Fe(),[i]=c.useState(new je.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),r.jsx(gn,{value:i,children:n})},lt=c.createContext(null),mn=lt.Provider,yn=()=>{const e=c.useContext(lt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},vn=({children:e})=>{const n=Fe(),[t]=c.useState(new je.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),r.jsx(mn,{value:t,children:e})},ct=c.createContext(null),En=ct.Provider,Cn=()=>{const e=c.useContext(ct);if(e===null)throw new Error("vector source context is null, please check the provider");return e},wn=({children:e})=>{const n=yn(),[t]=c.useState(new Ke.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),r.jsx(En,{value:t,children:e})},Sn=({geometry:e})=>{const n=Cn();return c.useEffect(()=>{const i=new Ye.GeoJSON().readFeature(e);return n.addFeature(i),()=>{n.removeFeature(i)}},[e,n]),null},Tn=e=>{const n=pn();return c.useEffect(()=>{n.setSource(new Ke.OSM)},[n]),null},bn=({drawType:e,onPolygonSelected:n})=>{const t=Fe();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case re.BOX:i.geometryFunction=Gt.createBox();break;case re.POLYGON:i.type="Polygon";break;default:return}const s=new Ht.Draw(i);t.addInteraction(s);const o=u=>{const m=new Ye.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(m)};return s.on("drawend",o),()=>{s.un("drawend",o),t.removeInteraction(s)}},[n,e,t]),null},gr="",_n=e=>{const n=t=>{const i=Bt(t);e.onPolygonSelection(i)};return r.jsxs(hn,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(fn,{children:r.jsx(Tn,{})}),e.selectionPolygon&&r.jsx(vn,{children:r.jsx(wn,{children:r.jsx(Sn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(bn,{drawType:e.drawType,onPolygonSelected:n})]})},He=1.5,Mn=80,Pn=me.makeStyles(e=>me.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(He),top:e.spacing(He)},contentContainer:{marginTop:e.spacing(He),width:e.spacing(Mn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Ln=e=>{var m;const[n,t]=c.useState(),[i,s]=c.useState(),o=Pn(),u=w=>{s(w),t(void 0),e.handlePolygonSelected(w)},h=()=>{s(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:o.map,children:[r.jsxs("div",{className:`${o.absolute}`,children:[r.jsxs(Y.Paper,{className:o.filtersContainer,children:[r.jsx(an,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:n!==void 0}),(m=e.filters)==null?void 0:m.map((w,_)=>r.jsx("div",{className:o.filtersMargin,children:w},_))]}),r.jsx(Y.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),r.jsx(_n,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})};function An(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:o}=e,u=h=>m=>{s(m,h)};return r.jsx(Vt,{children:r.jsxs(Y.TableRow,{children:[o&&r.jsx(Y.TableCell,{}),n.map(h=>r.jsx(Y.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:i===h.id?t:!1,children:r.jsx(Y.TableSortLabel,{active:i===h.id,direction:i===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const Dn=Xe.createSvgIcon(Re.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),In=Xe.createSvgIcon(Re.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function kn(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:o,isCollapseable:u,collapsedElement:h}=e,[m,w]=c.useState(!1),_=n.length,D=()=>{s==null||s(o)};return r.jsxs(r.Fragment,{children:[r.jsxs(Y.TableRow,{hover:!0,selected:t,onClick:D,children:[u&&r.jsx(Y.TableCell,{padding:"checkbox",children:r.jsx(Y.IconButton,{"aria-label":"expand row",size:"small",onClick:P=>{P.stopPropagation(),w(!m)},children:m?r.jsx(In,{}):r.jsx(Dn,{})})}),n.map(P=>r.jsx(Y.TableCell,{align:P.numeric?"right":"left",padding:P.disablePadding?"none":"default",children:P.transform?P.transform(i[P.id]):i[P.id]},P.id+o.toString()))]}),u&&r.jsx(Y.TableRow,{children:r.jsx(Y.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:_+1,children:r.jsx(Y.Collapse,{in:m,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(i)})})})]})}function On(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:o,items:u,onRequestSort:h,onRowSelected:m,isCollapseable:w,collapsedElement:_,isDense:D,page:P,rowsPerPage:x,count:V,handleChangePage:X,handleChangeRowsPerPage:Z}=e,G=(Q,K)=>{const N=n===K&&i==="asc";s(N?"desc":"asc"),t(K),h(K,N?"desc":"asc")};return r.jsxs(Y.TableContainer,{component:Y.Paper,children:[r.jsxs(Y.Table,{size:D?"small":"medium",children:[r.jsx(An,{headCells:o,onRequestSort:G,order:i,orderBy:n,isCollapseable:w}),r.jsxs(Y.TableBody,{children:[u.map((Q,K)=>r.jsx(kn,{item:Q,rowIndex:K,isCollapseable:w,cellsMetadata:o,collapsedElement:_,isRowSelected:!1,onRowSelected:m},K)),(u.length===0||x>u.length)&&r.jsx(Y.TableRow,{style:{height:(D?33:53)*(x-u.length)},children:r.jsx(Y.TableCell,{colSpan:w?o.length+1:o.length,children:u.length===0&&r.jsx(Y.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(Y.TablePagination,{rowsPerPage:x,rowsPerPageOptions:[5,10],component:"div",count:V,page:P,onPageChange:X,onRowsPerPageChange:Z})]})}const xn=e=>{const{children:n,...t}=e;return r.jsx(zt,{...t,children:n})},Nn=e=>{const{children:n,...t}=e;return r.jsx($t,{...t,children:n})},dt=e=>e*Math.PI/180,Pe=e=>e*(180/Math.PI),Bn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(dt(85.362/2))/Math.sin(dt(85.362/2))),pr="",Fn=e=>{const n=he(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(o=>{o!=null&&o.endPosition&&s({...o.endPosition})},T.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const o=n.scene.globe.ellipsoid,u=n.camera.pickEllipsoid(new T.Cartesian3(i.x,i.y),o);if(u){const h=o.cartesianToCartographic(u);if(t.current){let m="";switch(e.projection){case ue.WEB_MERCATOR:{const _=new T.WebMercatorProjection(o).project(h);m=`Mercator: ${_.y.toFixed(Me)}m, ${_.x.toFixed(Me)}m`,t.current.style.width="220px";break}case ue.WGS84:{const w=T.Math.toDegrees(h.longitude).toFixed(_e);m=`WGS84: ${T.Math.toDegrees(h.latitude).toFixed(_e)}°N ${w}°E`,t.current.style.width="200px";break}}t.current.innerHTML=m}}},[i,t,n,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},fr="",Ge=[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],Hn=(e,n,t,i)=>{const s=U.get(i,"METERS_UNIT")??"m",o=U.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},h=new T.EllipsoidGeodesic,m=new Date().getTime();if(m<u.lastLegendUpdate+250)return;u.lastLegendUpdate=m;const w=e.scene.canvas.clientWidth,_=e.scene.canvas.clientHeight,D=e.scene.camera.getPickRay(new T.Cartesian2(w/2|0,_-1)),P=e.scene.camera.getPickRay(new T.Cartesian2(1+w/2|0,_-1)),x=e.scene.globe,V=x.pick(D,e.scene),X=x.pick(P,e.scene);if(!V||!X)return;const Z=x.ellipsoid.cartesianToCartographic(V),G=x.ellipsoid.cartesianToCartographic(X);h.setEndPoints(Z,G);const Q=h.surfaceDistance,K=100;let N;for(let q=Ge.length-1;!U.isNumber(N)&&q>=0;--q)Ge[q]/Q<K&&(N=Ge[q]);if(U.isNumber(N)){let q="";N>=1e3?q=`${(N/1e3).toString()} ${o}`:q=`${N.toString()} ${s}`,u.barWidth=N/Q|0,u.distanceLabel=q}t(u)},Gn=e=>{const n=he(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const o=m=>{Hn(n,t,i,e.locale)},u=new T.EventHelper,h=m=>{n.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,h),n.camera.moveEnd.addEventListener(o),()=>{try{U.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(m){console.log('CESIUM camera "moveEnd" remove listener failed',m)}}},[n,e.locale,t]);const s=o=>5+(125-o)/2;return r.jsx("div",{className:"scalePosition",children:U.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"distance-legend-label",children:t.distanceLabel}),r.jsx("div",{className:"distance-legend-scale-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:T.SceneMode.MORPHING,COLUMBUS_VIEW:T.SceneMode.COLUMBUS_VIEW,SCENE2D:T.SceneMode.SCENE2D,SCENE3D:T.SceneMode.SCENE3D},mr="",ut=(e,n)=>{const i=U.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,o=n.canvas.height,u=U.get(n.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(i.getLevelMaximumGeometricError(h)*o/(e*u)<s.maximumScreenSpaceError)return h;return null},Vn=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let o=1e8;o>i;o=o-i){const u=ut(o,n);if(u===null)break;if(u!==s){let h=o,m=o+i;for(;m-h>e;)o=h+(m-h)/2,ut(o,n)===u?h=o:m=o;t.push({level:u,height:Math.round(o)}),s=u,t.length>=2&&(i=(t[t.length-2].height-o)/1e3)}}return t},zn=e=>{const n=he(),[t,i]=c.useState(1),s=Vn(1,n);return c.useEffect(()=>{const o=()=>{const u=n.camera,h=.5;let m=0;switch(n.scene.mode){case ie.SCENE3D:m=n.scene.mapProjection.ellipsoid.cartesianToCartographic(u.positionWC).height;break;case ie.SCENE2D:m=(u.frustum.right-u.frustum.left)*h;break;case ie.COLUMBUS_VIEW:m=u.position.z;break;default:m=0;break}if(s.length>0){const w=s.reduce((_,D)=>Math.abs(D.height-m)<Math.abs(_.height-m)?D:_);i(w.level)}};return n.camera.moveEnd.addEventListener(o),()=>{try{U.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(u){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',u)}}},[n,s.length]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:t}),r.jsx("div",{className:"zoomLevelLabel",children:U.get(e.locale,"ZOOM_LABEL")??"zoom"})]})},yr="",$n=-1,Wn=e=>{const n=he(),[t,i]=c.useState(),{sceneModes:s}=e,o=u=>s.findIndex(h=>h===u)>$n;return c.useEffect(()=>{i(n.scene.mode)},[]),r.jsxs(r.Fragment,{children:[o(ie.SCENE3D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}}),o(ie.SCENE2D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}}),o(ie.COLUMBUS_VIEW)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}})]})},vr="",Un=me.makeStyles(e=>me.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),qn=e=>{const n=he(),{baseMaps:t}=e,[i,s]=c.useState(" "),[o,u]=c.useState(),h=Un();c.useEffect(()=>{const w=t==null?void 0:t.maps.find(_=>_.isCurrent);w&&(u(w),s(w.title!==void 0?w.title:" "))},[t]);const m=w=>{var _,D;if(t){(_=n.layersManager)==null||_.removeBaseMapLayers();const P=t.maps.find(x=>x.id===w);P&&((D=n.layersManager)==null||D.setBaseMapLayers(P),u(P),t.maps.forEach(x=>{x.isCurrent=P===x}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:i}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(w=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${w===o?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:w.thumbnail,onMouseOver:()=>{s(w.title)},onMouseOut:()=>{s((o==null?void 0:o.title)!==void 0?o.title:" ")},onClick:()=>{m(w.id)}})},w.id))})]})},Er="",Ve="ic_settings_24px",jn=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:o}=e,u=c.useRef(null),h=U.get(o,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",m=U.get(o,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",w=U.get(o,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const _=D=>{var V;const P=D.target,x=U.get(u,"current");x&&!x.contains(P)&&P.id!==Ve&&((V=P.parentElement)==null?void 0:V.id)!==Ve&&(document.removeEventListener("click",_,!1),t(!1))};return document.addEventListener("click",_,!1),()=>{document.removeEventListener("click",_,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(z.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Ve,x:"288",y:"24",children:r.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&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:r.jsxs(z.Dialog,{open:n,onClosed:()=>{t(!1)},children:[r.jsx(z.DialogTitle,{children:h}),r.jsxs(z.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:m}),r.jsx(se,{className:"mapScenesContainer",children:r.jsx(Wn,{sceneModes:i})}),r.jsx(se,{className:"baseMapsContainer",children:s&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:w}),r.jsx(qn,{baseMaps:s})]})})]})]})})]})},Cr="",Kn=r.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:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),Yn=({onClick:e})=>r.jsx(se,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(z.Icon,{icon:Kn,className:"mapLegendIcon"})}),Xn=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const o=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const w=r.jsx(se,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(z.Tooltip,{content:t,children:w}):w},[t]),h=c.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&r.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return r.jsxs(se,{className:"mapLegend",children:[u(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),r.jsx(se,{className:"legendActionsContainer",children:h()})]})},Zn=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>r.jsx(se,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),o=c.useCallback(()=>e.length?e.map((u,h)=>r.jsx(Xn,{legend:u,docText:n,imgText:t},`${u.layer}_${h}`)):s(),[e]);return r.jsx(se,{className:"mapLegendsList",children:o()})},Jn=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?r.jsxs(z.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(z.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(z.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(z.DrawerContent,{className:"sidebarContent",children:[r.jsx(z.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(Zn,{noLegendsText:i,legends:o,actionsTexts:s})]})]}):null,ht=(e,n,t)=>{let i;if(e.scene.mode!==T.SceneMode.SCENE2D)i=e.scene.pickPosition(new T.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;i=e.camera.pickEllipsoid(new T.Cartesian2(n,t),s)}return T.Cartographic.fromCartesian(i)},Qn=(e,n,t)=>{const i=ht(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[T.Math.toDegrees(i.longitude),T.Math.toDegrees(i.latitude)]}}},Rn=(e,n,t)=>{try{const i=ht(e,n,t);return{longitude:T.Math.toDegrees(i.longitude),latitude:T.Math.toDegrees(i.latitude)}}catch{return}},pe=document.createElement("canvas"),oe=pe.getContext("2d"),gt=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},ei=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{try{oe==null||oe.clearRect(0,0,pe.width,pe.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){pe.width=e.width,pe.height=e.height,oe==null||oe.drawImage(e,0,0);const o=oe==null?void 0:oe.getImageData(0,0,pe.width,pe.height),u=gt(o);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{pe.width=s.width,pe.height=s.height,oe==null||oe.drawImage(s,0,0);const o=oe==null?void 0:oe.getImageData(0,0,pe.width,pe.height);gt(o)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Le=(e,n)=>{const{west:t,east:i,north:s,south:o}=e,{west:u,east:h,north:m,south:w}=n;return t>=u&&i<=h&&s<=m&&o>=w},Ae=3,De="hasTransparency";function ze(e,n,t,i,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(m=>{var w,_;return((w=m._imageryProvider._resource)==null?void 0:w._url)===((_=this._resource)==null?void 0:_._url)}))==null?void 0:h.meta,u=U.get(o,De)===!0;this.tileTransparencyCheckedCounter<Ae&&!u&&ei(s==null?void 0:s.url,this).then(m=>{var w;(w=this.mapViewer.layersManager)==null||w.addMetaToLayer({[De]:m},_=>_._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class pt extends T.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}class ft extends T.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}class mt extends T.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}const ti=1,ni=-1,yt="TRANSPARENT_BASE_LAYER";class ii{constructor(n,t,i,s){te(this,"mapViewer");te(this,"legendsList");te(this,"layerUpdated");te(this,"layers");te(this,"legendsExtractor");te(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new T.Event,this.layerManagerFootprintMetaFieldPath=s,i&&this.layerUpdated.addEventListener(i,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(o=>{const u=Object.keys(o);u.length===1&&u[0]===De&&(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 o=this.layers.find(t);o&&(o.meta={...o.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 o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new pt(o,this.mapViewer):new T.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new ft(o,this.mapViewer):new T.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new mt(o,this.mapViewer):new T.WebMapTileServiceImageryProvider(o);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=>!!U.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!U.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 o=0;o<t;o++)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,o=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=o&&(t=u-o),i)for(let h=0;h<t;h++)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=>!U.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(o=>!U.get(o.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t){if(this.layerManagerFootprintMetaFieldPath){const i=Qn(this.mapViewer,n,t);return this.layers.filter(u=>!U.get(u.meta,"parentBasetMapId")).filter(u=>{const h=U.get(u.meta,this.layerManagerFootprintMetaFieldPath);return h!==void 0?Ut(i.geometry,{type:"Feature",properties:{},geometry:h})&&u.show:(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",u.meta),!1)}).sort((u,h)=>{var m,w;return((m=h.meta)==null?void 0:m.zIndex)-((w=u.meta)==null?void 0:w.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new T.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new T.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=>!!U.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?ti:ni,o=t<i?t:i,u=t<i?i:t;this.layers.forEach(h=>{var w;if(!U.get(h.meta,"parentBasetMapId")){const _=(w=h.meta)==null?void 0:w.zIndex;h.meta.zIndex=_>=o&&_<=u&&_!==t?_+s:_===t?i:_}})}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 o=this.layers[s],u=!U.isEmpty(i)&&!U.isEmpty(o.rectangle)&&T.Rectangle.intersection(i,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((n=o.meta)==null?void 0:n.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const m=this.layers[h],w=((t=m.meta)==null?void 0:t[De])===!0;if(o!==m)if(u instanceof T.Rectangle){if(Le(i,o.rectangle))if(Le(i,m.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(Le(i,m.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}if(Le(o.rectangle,m.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:w},!w)break}else o.meta={...o.meta??{},relevantToExtent:!0}}else o.meta={...o.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(o.meta={...o.meta??{},relevantToExtent:u instanceof T.Rectangle})}}}catch(i){console.error(i)}}}const wr="",vt=212,Et=260,ri=0;class oi extends T.Viewer{constructor(t,i){super(t,i);te(this,"layersManager");te(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Ct=c.createContext(null),si=Ct.Provider,he=()=>{const e=c.useContext(Ct);if(e===null)throw new Error("map context is null, please check the provider");return e},ai=e=>{var L,M,b,A,I,j,J,F;const n=c.useRef(null),[t,i]=c.useState(),[s,o]=c.useState(),[u,h]=c.useState(),[m,w]=c.useState(),[_,D]=c.useState(),[P,x]=c.useState(),V=c.useRef(),[X,Z]=c.useState(),[G,Q]=c.useState([]),[K,N]=c.useState(),[q,B]=c.useState(!1),$=c.useRef(),[R,a]=c.useState(void 0),[l,E]=c.useState(!1),[d,v]=c.useState(),p={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,...e},C=(k,O,W,fe,le)=>{const ne=t.container,ce=ne.clientWidth,we=ne.clientHeight,ke=fe+le;return{left:`${ce-k<W?k-(W-(ce-k)):k}px`,top:`${we-O<ke?O-(ke-(we-O)):O}px`}},y=c.useCallback(k=>{if(n.current!==null){const O=n.current.cesiumElement,W={x:k.offsetX,y:k.offsetY};B(!1),a(W),v(Rn(O,W.x,W.y)),B(!0),$.current=k}},[n]);c.useEffect(()=>{var k;if(n.current!==null){const O=n.current.cesiumElement;e.imageryContextMenu&&(O.scene.canvas.removeEventListener("contextmenu",y),O.scene.canvas.addEventListener("contextmenu",y))}i((k=n.current)==null?void 0:k.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var k;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new ii(t,(k=e.legends)==null?void 0:k.mapLegendsExtractor,()=>{var O;Q((O=t.layersManager)==null?void 0:O.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{Z(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var O,W;N(e.baseMaps);const k=(O=e.baseMaps)==null?void 0:O.maps.find(fe=>fe.isCurrent);k&&t&&((W=t.layersManager)==null||W.setBaseMapLayers(k))},[e.baseMaps,t]),c.useEffect(()=>{o(e.projection??ue.WGS84)},[e.projection]),c.useEffect(()=>{x(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{w(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{D(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{const k=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const O=()=>{const W=t.camera.positionCartographic;return{longitude:Pe(W.longitude),latitude:Pe(W.latitude),height:W.height}};if(t.scene.mode===T.SceneMode.SCENE3D){const W=new T.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),fe=t.scene.camera.getPickRay(W),le=t.scene.globe.pick(fe,t.scene),ne=t.scene.globe.ellipsoid.cartesianToCartographic(le);return ne!==void 0?{longitude:Pe(ne.longitude),latitude:Pe(ne.latitude),height:t.scene.camera.positionCartographic.height}:O()}else return O()};t&&t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==T.SceneMode.MORPHING){const O=t.camera,W={position:k(),direction:O.direction.clone(),up:O.up.clone(),right:O.right.clone(),transform:O.transform.clone(),frustum:O.frustum.clone()};V.current=W}})},[t]),c.useEffect(()=>{const k=()=>{if(t&&V.current){const O=V.current;t.camera.flyTo({destination:T.Cartesian3.fromDegrees(O.position.longitude,O.position.latitude,O.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(k),()=>{if(t)try{t.scene.morphComplete.removeEventListener(k)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const k=e.zoom,O=e.center;t&&U.isNumber(k)&&U.isArray(O)&&t.camera.flyTo({destination:T.Cartesian3.fromDegrees(O[0],O[1],Bn(k)),duration:0})},[e.zoom,e.center,t]);const S=c.useCallback(()=>t&&Wt.createPortal(r.jsxs(r.Fragment,{children:[r.jsxs(se,{className:"sideToolsContainer",children:[r.jsx(jn,{sceneModes:X,baseMaps:K,locale:P}),r.jsx(Yn,{onClick:()=>E(!l)})]}),r.jsxs(se,{className:"toolsContainer",children:[u===!0?r.jsx(Fn,{projection:s}):r.jsx(r.Fragment,{}),m===!0?r.jsx(zn,{locale:P}):r.jsx(r.Fragment,{}),_===!0?r.jsx(Gn,{locale:P}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[K,P,t,s,X,u,_,l]);return r.jsx(ge.Viewer,{className:"viewer",full:!0,ref:n,...p,children:r.jsxs(si,{value:t,children:[r.jsx(Jn,{title:(L=e.legends)==null?void 0:L.title,isOpen:l,toggleSidebar:()=>E(!l),noLegendsText:(M=e.legends)==null?void 0:M.emptyText,legends:((b=e.legends)==null?void 0:b.legendsList)??G,actionsTexts:(A=e.legends)==null?void 0:A.actionsTexts}),e.children,S(),e.imageryContextMenu&&q&&R&&d&&c.cloneElement(e.imageryContextMenu,{data:(I=t==null?void 0:t.layersManager)==null?void 0:I.findLayerByPOI(R.x,R.y),position:{x:R.x,y:R.y},coordinates:d,style:C(R.x,R.y,((j=e.imageryContextMenuSize)==null?void 0:j.width)??Et,((J=e.imageryContextMenuSize)==null?void 0:J.height)??vt,((F=e.imageryContextMenuSize)==null?void 0:F.dynamicHeightIncrement)??ri),size:e.imageryContextMenuSize??{height:vt,width:Et},handleClose:()=>{B(!q)},contextEvt:$.current})]})})},li=0,ci=e=>{const n=he();return r.jsx(ge.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const i=n.scene;i.globe.depthTestAgainstTerrain=!0;const s=T.Cartographic.fromCartesian(t.boundingSphere.center),o=e.heightFromGround??li;if(o){const u=T.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=T.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),m=T.Cartesian3.subtract(h,u,new T.Cartesian3);t.modelMatrix=T.Matrix4.fromTranslation(m)}}})},wt=180,St=.001,Tt=-1,bt=e=>Math.abs(e)/e,_t=e=>{Math.abs(e[0])===wt&&Math.abs(e[1])===wt/2&&(e[0]+=Tt*bt(e[0])*St,e[1]+=Tt*bt(e[1])*St)},Mt=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{_t(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{_t(t)})});break}},di=e=>{const{data:n,...t}=e;return n&&(typeof n.features<"u"?n.features.forEach(i=>{Mt(i.geometry)}):Mt(n)),r.jsx(ge.GeoJsonDataSource,{data:n,...t})},Ce=e=>{const{meta:n,...t}=e,i=he();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),r.jsx(ge.ImageryLayer,{...t})},ui=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new ft(n,i):new T.WebMapServiceImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},hi=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new mt(n,i):new T.WebMapTileServiceImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},gi=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new pt(n,i):new T.UrlTemplateImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},pi=e=>{const{options:n,...t}=e;return r.jsx(Ce,{...t,imageryProvider:new T.OpenStreetMapImageryProvider(n)})},Pt=e=>r.jsx(ge.Entity,{...e}),fi=e=>r.jsx(ge.EntityDescription,{...e}),Lt=e=>r.jsx(ge.EntityDescription,{...e}),At=e=>r.jsx(ge.PolygonGraphics,{...e}),Dt=e=>r.jsx(ge.RectangleGraphics,{...e}),It=e=>r.jsx(ge.CustomDataSource,{...e}),mi=e=>r.jsx(ge.PolylineGraphics,{...e}),Sr="";var ye=function(){var e=f.Ellipsoid.WGS84,n,t=f.Material.fromType(f.Material.ColorType);function i(a,l=new f.Color(1,1,0,.5),E=new f.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=E,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,E=new f.ScreenSpaceEventHandler(a.canvas);function d(p,C){if(l._handlersMuted!=!0){var y=a.pick(C);y&&y.primitive&&y.primitive[p]&&y.primitive[p](C)}}E.setInputAction(function(p){d("leftClick",p.position)},f.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(p){d("leftDoubleClick",p.position)},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var v;E.setInputAction(function(p){if(l._handlersMuted!=!0){var C=a.pick(p.endPosition);v&&(!C||v!=C.primitive)&&(!(v.isDestroyed&&v.isDestroyed())&&v.mouseOut(p.endPosition),v=null),C&&C.primitive&&(C=C.primitive,C.mouseOut&&(v=C),C.mouseMove&&C.mouseMove(p.endPosition))}},f.ScreenSpaceEventType.MOUSE_MOVE),E.setInputAction(function(p){d("leftUp",p.position)},f.ScreenSpaceEventType.LEFT_UP),E.setInputAction(function(p){d("leftDown",p.position)},f.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,E){a[l]=E},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;$(a,"mouseMove",function(E){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(E,"Click to edit this shape")}),$(a,"mouseOut",function(E){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),$(a,"leftClick",function(E){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:f.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=B(s,{appearance:new f.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=B(s,{}),h=B(s,{}),m=B(s,{}),w=B(o,{rotation:0}),_=B(s,{width:5,geodesic:!0,granularity:1e4,appearance:new f.PolylineMaterialAppearance({aboveGround:!1}),material:t}),D=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,E){this[l]=E,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,E,d){if(!f.defined(this.ellipsoid))throw new f.DeveloperError("this.ellipsoid must be defined.");if(!f.defined(this.appearance))throw new f.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new f.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!f.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 v=this.getGeometry();if(!v)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 f.Primitive({geometryInstances:new f.GeometryInstance({geometry:v,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 f.Primitive({geometryInstances:new f.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:f.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new f.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,E,d),this._outlinePolygon&&this._outlinePolygon.update(l,E,d)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),f.destroyObject(this)},a.prototype.setStrokeStyle=function(l,E){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=E)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=E)},a}();i.ExtentPrimitive=function(){function a(l){if(!f.defined(l.extent))throw new f.DeveloperError("Extent is required");l=B(l,o),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new D,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(f.defined(this.extent))return new f.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.RectangleOutlineGeometry({rectangle:this.extent})},a}(),i.PolygonPrimitive=function(){function a(l){l=B(l,o),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new D,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!f.defined(this.positions)||this.positions.length<3))return f.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return f.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),i.CirclePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.radius)))throw new f.DeveloperError("Center and radius are required");l=B(l,o),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new D,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(f.defined(this.center)&&f.defined(this.radius))return new f.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),i.EllipsePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.semiMajorAxis)&&f.defined(l.semiMinorAxis)))throw new f.DeveloperError("Center and semi major and semi minor axis are required");l=B(l,w),this.initialiseOptions(l)}return a.prototype=new D,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(f.defined(this.center)&&f.defined(this.semiMajorAxis)&&f.defined(this.semiMinorAxis))return new f.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),i.PolylinePrimitive=function(){function a(l){l=B(l,_),this.initialiseOptions(l)}return a.prototype=new D,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(!(!f.defined(this.positions)||this.positions.length<2))return new f.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var P={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},x={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},V={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,E){var d=new i.BillboardGroup(this,l);return d.addBillboards(a,E),d},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=B(l,P);var E=new f.BillboardCollection;this._scene.primitives.add(E),this._billboards=E,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var E=this._billboards.add({show:!0,position:a,pixelOffset:new f.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new f.Cartesian3(0,0,0),horizontalOrigin:f.HorizontalOrigin.CENTER,verticalOrigin:f.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(l){let p=function(y){v.enableRotate=y},C=function(){for(var y=0,S=d._orderedBillboards.length;y<S&&d._orderedBillboards[y]!=E;++y);return y};var d=this,v=this._scene.screenSpaceCameraController;if(l.dragHandlers){var d=this;$(E,"leftDown",function(S){function L(A){E.position=A;for(var I=0,j=d._orderedBillboards.length;I<j&&d._orderedBillboards[I]!=E;++I);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(C(),A)}function M(A){b.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(C(),A)}var b=new f.ScreenSpaceEventHandler(d._scene.canvas);b.setInputAction(function(A){var I=d._scene.camera.pickEllipsoid(A.endPosition,e);I?L(I):M(I)},f.ScreenSpaceEventType.MOUSE_MOVE),b.setInputAction(function(A){M(d._scene.camera.pickEllipsoid(A.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(C(),d._scene.camera.pickEllipsoid(S,e))})}l.onDoubleClick&&$(E,"leftDoubleClick",function(y){l.onDoubleClick(C())}),l.onClick&&$(E,"leftClick",function(y){l.onClick(C())}),l.tooltip&&($(E,"mouseMove",function(y){d._drawHelper._tooltip.showAt(y,l.tooltip())}),$(E,"mouseOut",function(y){d._drawHelper._tooltip.setVisible(!1)}))}return E},i.BillboardGroup.prototype.insertBillboard=function(a,l,E){this._orderedBillboards.splice(a,0,this.createBillboard(l,E))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var E=0;E<a.length;E++)this.addBillboard(a[E],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=B(l,P);this.startDrawing(function(){p.remove(),C.destroy(),v.setVisible(!1)});var E=this,d=this._scene;d.primitives;var v=this._tooltip,p=new i.BillboardGroup(this,l),C=new f.ScreenSpaceEventHandler(d.canvas);C.setInputAction(function(y){if(y.position!=null){var S=d.camera.pickEllipsoid(y.position,e);S&&(p.addBillboard(S),E.stopDrawing(),l.callback(S))}},f.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(y){var S=y.endPosition;if(S!=null){var L=d.camera.pickEllipsoid(S,e);L?v.showAt(S,"<p>Click to add your marker. Position is: </p>"+K(e.cartesianToCartographic(L))):v.showAt(S,"<p>Click on the globe to add your marker.</p>")}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=B(l,o);this.startDrawingPolyshape(!0,l)},i.prototype.startDrawingPolyline=function(l){var l=B(l,_);this.startDrawingPolyshape(!1,l)},i.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){v.remove(y),L.remove(),M.destroy(),p.setVisible(!1),G(d)});var E=this,d=this._scene,v=d.primitives,p=this._tooltip,C=a?3:2,y;a?y=new ye.PolygonPrimitive(l):y=new ye.PolylinePrimitive(l),y.asynchronous=!1,v.add(y);var S=[],L=new i.BillboardGroup(this,P),M=new f.ScreenSpaceEventHandler(d.canvas);Z(d),M.setInputAction(function(b){if(b.position!=null){var A=d.camera.pickEllipsoid(b.position,e);A&&(S.length==0&&(S.push(A.clone()),L.addBillboard(S[0])),S.length>=C&&(y.positions=S,y._createPrimitive=!0),S.push(A),L.addBillboard(A))}},f.ScreenSpaceEventType.LEFT_CLICK),M.setInputAction(function(b){var A=b.endPosition;if(A!=null)if(S.length==0)p.showAt(A,"<p>Click to add first point</p>");else{var I=d.camera.pickEllipsoid(A,e);I&&(S.pop(),I.y+=1+Math.random(),S.push(I),S.length>=C&&(y.positions=S,y._createPrimitive=!0),L.getBillboard(S.length-1).position=I,p.showAt(A,"<p>Click to add new point ("+S.length+")</p>"+(S.length>C?"<p>Double click to finish drawing</p>":"")))}},f.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(b){var A=b.position;if(A!=null){if(S.length<C+2)return;var I=d.camera.pickEllipsoid(A,e);I&&(G(d),E.stopDrawing(),typeof l.callback=="function"&&(S.length-1,l.callback(S)))}},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function X(a){return e.cartographicArrayToCartesianArray([f.Rectangle.northwest(a),f.Rectangle.northeast(a),f.Rectangle.southeast(a),f.Rectangle.southwest(a)])}function Z(a){a&&(a.canvas.style.cursor="crosshair")}function G(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=B(l,o);this.startDrawing(function(){y!=null&&v.remove(y),S!=null&&S.remove(),L.destroy(),p.setVisible(!1),G(d)});var E=this,d=this._scene,v=this._scene.primitives,p=this._tooltip,C=null,y=null,S=null,L=new f.ScreenSpaceEventHandler(d.canvas);Z(d);function M(b){y==null&&(y=new ye.ExtentPrimitive({extent:b,material:l.material}),y.asynchronous=!1,v.add(y)),y.setExtent(b);var A=X(b);S==null?(S=new i.BillboardGroup(E,P),S.addBillboards(A)):S.updateBillboardsPositions(A)}L.setInputAction(function(b){if(b.position!=null){var A=d.camera.pickEllipsoid(b.position,e);if(A)if(y==null){C=e.cartesianToCartographic(A);var I=Q(C,C);M(I)}else E.stopDrawing(),typeof l.callback=="function"&&l.callback(Q(C,e.cartesianToCartographic(A)))}},f.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(b){var A=b.endPosition;if(A!=null)if(y==null)p.showAt(A,"<p>Click to start drawing rectangle</p>");else{var I=d.camera.pickEllipsoid(A,e);if(I){var j=Q(C,e.cartesianToCartographic(I));M(j),p.showAt(A,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingCircle=function(l){var l=B(l,o);this.startDrawing(function(){C!=null&&v.remove(C),y.remove(),S.destroy(),p.setVisible(!1)});var E=this,d=this._scene,v=this._scene.primitives,p=this._tooltip,C=null,y=null,S=new f.ScreenSpaceEventHandler(d.canvas);S.setInputAction(function(L){if(L.position!=null){var M=d.camera.pickEllipsoid(L.position,e);M&&(C==null?(C=new i.CirclePrimitive({center:M,radius:0,asynchronous:!1,material:l.material}),v.add(C),y=new i.BillboardGroup(E,P),y.addBillboards([M])):(typeof l.callback=="function"&&l.callback(C.getCenter(),C.getRadius()),E.stopDrawing()))}},f.ScreenSpaceEventType.LEFT_DOWN),S.setInputAction(function(L){var M=L.endPosition;if(M!=null)if(C==null)p.showAt(M,"<p>Click to start drawing the circle</p>");else{var b=d.camera.pickEllipsoid(M,e);b&&(C.setRadius(f.Cartesian3.distance(C.getCenter(),b)),y.updateBillboardsPositions(b),p.showAt(M,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.enhancePrimitives=function(){var a=this;f.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var d=this,v=this;function p(C){a._scene.screenSpaceCameraController.enableRotate=C}$(d,"leftDown",function(C){function y(M){d.position=M,v.executeListeners({name:"drag",positions:M})}function S(M){L.destroy(),p(!0),v.executeListeners({name:"dragEnd",positions:M})}var L=new f.ScreenSpaceEventHandler(a._scene.canvas);L.setInputAction(function(M){var b=a._scene.camera.pickEllipsoid(M.endPosition,e);b?y(b):S(b)},f.ScreenSpaceEventType.MOUSE_MOVE),L.setInputAction(function(M){S(a._scene.camera.pickEllipsoid(M.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1)}),R(d)};function l(d){a._scene,!(this._highlighted&&this._highlighted==d)&&this._editMode!==!0&&(this._highlighted=d,d?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(f.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function E(d){if(this._editMode!=d)if(a.disableAllHighlights(),d){a.setEdited(this);var v=a._scene,p=this;if(this._markers==null){let I=function(F,k){var O=F-1<0?k.length-1:F-1;O<y.countBillboards()&&(y.getBillboard(O).position=J(O)),O=F,O<y.countBillboards()&&(y.getBillboard(O).position=J(O))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},J=function(F){var k=p.positions;return e.cartographicToCartesian(new f.EllipsoidGeodesic(e.cartesianToCartographic(k[F]),e.cartesianToCartographic(k[F<k.length-1?F+1:0])).interpolateUsingFraction(.5))};var C=new i.BillboardGroup(a,x),y=new i.BillboardGroup(a,V),S={dragHandlers:{onDrag:function(F,k){p.positions[F]=k,I(F,p.positions),p._createPrimitive=!0},onDragEnd:function(F,k){p._createPrimitive=!0,j()}},onDoubleClick:function(F){p.positions.length<4||(p.positions.splice(F,1),p._createPrimitive=!0,C.removeBillboard(F),y.removeBillboard(F),I(F,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};C.addBillboards(p.positions,S),this._markers=C;for(var L=[],M=0,b=p.positions.length+(this.isPolygon?0:-1);M<b;M++)L.push(J(M));var A={dragHandlers:{onDragStart:function(F,k){this.index=F+1,p.positions.splice(this.index,0,k),p._createPrimitive=!0},onDrag:function(F,k){p.positions[this.index]=k,p._createPrimitive=!0},onDragEnd:function(F,k){C.insertBillboard(this.index,k,S),y.getBillboard(this.index-1).position=J(this.index-1),y.insertBillboard(this.index,J(this.index),A),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};y.addBillboards(L,A),this._editMarkers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(F){var k=v.pick(F.position);k&&k.primitive||p.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop(),y.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}ye.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this;d.isPolygon=!1,d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=E;var v=this.width;d.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(v*2)):this.setWidth(v))},d.getExtent=function(){return f.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},R(d),d.setEditMode(!1)}},ye.PolygonPrimitive.prototype.setEditable=function(){var d=this;d.asynchronous=!1,a._scene,a.registerEditableShape(d),d.setEditMode=E,d.setHighlighted=l,R(d),d.setEditMode(!1)},ye.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;a.registerEditableShape(d),d.asynchronous=!1,d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let S=function(){d.executeListeners({name:"onEdited",extent:d.extent})};var C=new i.BillboardGroup(a,x),y={dragHandlers:{onDrag:function(L,M){var b=C.getBillboard((L+2)%4).position;d.setExtent(Q(e.cartesianToCartographic(b),e.cartesianToCartographic(M))),C.updateBillboardsPositions(X(d.extent))},onDragEnd:function(L,M){S()}},tooltip:function(){return"Drag to change the corners of this extent"}};C.addBillboards(X(d.extent),y),this._markers=C,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(L){var M=v.pick(L.position);M&&!M.isDestroyed()&&M.primitive||d.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var C=this;if(this._markers==null){let L=function(){return f.EllipseOutlineGeometry(e,d.getCenter(),d.getSemiMajorAxis(),d.getSemiMinorAxis(),d.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},M=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),semiMajorAxis:d.getSemiMajorAxis(),semiMinorAxis:d.getSemiMinorAxis(),rotation:0})};var y=new i.BillboardGroup(a,x),S={dragHandlers:{onDrag:function(b,A){var I=f.Cartesian3.distance(d.getCenter(),A);b%2==0?d.setSemiMajorAxis(I):d.setSemiMinorAxis(I),y.updateBillboardsPositions(L())},onDragEnd:function(b,A){M()}},tooltip:function(){return"Drag to change the excentricity and radius"}};y.addBillboards(L(),S),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(b){var A=v.pick(b.position);A&&A.primitive||C.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(d){for(var v=f.CircleOutlineGeometry.createGeometry(new f.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:d})),p=0,C,y=[];p<v.attributes.position.values.length;p+=3)C=v.attributes.position.values,y.push(new f.Cartesian3(C[p],C[p+1],C[p+2]));return y},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var C=this;if(this._markers==null){let L=function(){return C.getCircleCartesianCoordinates(f.Math.PI_OVER_TWO)},M=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),radius:d.getRadius()})};var y=new i.BillboardGroup(a,x),S={dragHandlers:{onDrag:function(b,A){d.setRadius(f.Cartesian3.distance(d.getCenter(),A)),y.updateBillboardsPositions(L())},onDragEnd:function(b,A){M()}},tooltip:function(){return"Drag to change the radius"}};y.addBillboards(L(),S),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(b){var A=v.pick(b.position);A&&A.primitive||C.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,E){if(!f.defined(E.container))throw new f.DeveloperError("Container is required");var d={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:_,polygonDrawingOptions:u,extentDrawingOptions:h,circleDrawingOptions:m};q(E,d);var v=this,p=document.createElement("DIV");p.className="toolbar",E.container.appendChild(p);function C(L,M,b,A){var I=document.createElement("DIV");I.className="button",I.title=b,p.appendChild(I),I.onclick=A;var j=document.createElement("SPAN");I.appendChild(j);var J=document.createElement("IMG");return J.src=M,j.appendChild(J),I}var y=l._scene;C("marker",E.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(L){v.executeListeners({name:"markerCreated",position:L})}})}),C("polyline",E.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(L){v.executeListeners({name:"polylineCreated",positions:L})}})}),C("polygon",E.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(L){v.executeListeners({name:"polygonCreated",positions:L})}})}),C("extent",E.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(L){v.executeListeners({name:"extentCreated",extent:L})}})}),C("circle",E.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(L,M){v.executeListeners({name:"circleCreated",center:L,radius:M})}})});var S=document.createElement("DIV");S.className="divider",p.appendChild(S),C("clear",E.clearIcon,"Remove all primitives",function(){y.primitives.removeAll()}),R(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=B(l,{container:a}),new i.DrawHelperWidget(this,l)};function Q(a,l){var E=new f.Rectangle;E.west=Math.min(a.longitude,l.longitude),E.east=Math.max(a.longitude,l.longitude),E.south=Math.min(a.latitude,l.latitude),E.north=Math.max(a.latitude,l.latitude);var d=f.Math.EPSILON7;return E.east-E.west<d&&(E.east+=d*2),E.north-E.south<d&&(E.north+=d*2),E}function K(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function N(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 E in a)l[E]=typeof l[E]>"u"?N(a[E],null):l[E];return l}function q(a,l){a=a||{};var E;for(E in l)a[E]===void 0&&(a[E]=N(l[E]))}function B(a,l){var E=N(a),d;for(d in l)E[d]===void 0&&(E[d]=N(l[d]));return E}function $(a,l,E){a[l]=E}function R(a){a._listeners={},a.addListener=function(l,E){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(E),this._listeners[l].length},a.executeListeners=function(l,E){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var d=0;d<this._listeners[l.name].length;d++)this._listeners[l.name][d](l);else E&&E(l)}}return i}();const yi=2,vi=(e,n)=>{switch(e){case re.BOX:{if(n.features.length!==yi)throw new Error(`${e} must have 2 points`);const t=U.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Te.BOTTOM_LEFT}),i=U.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Te.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 T.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`)}},Ei=e=>{const n=e.map(t=>{const i=T.Cartographic.fromCartesian(t);return[T.Math.toDegrees(i.longitude),T.Math.toDegrees(i.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},Ci=e=>{const n=et.lineString([[T.Math.toDegrees(e.west),T.Math.toDegrees(e.south)],[T.Math.toDegrees(e.east),T.Math.toDegrees(e.north)]]);return Je(Ze(n))},wi=e=>{const n=et.lineString([[e.west,e.south],[e.east,e.north]]);return Je(Ze(n)).geometry.coordinates[0].map(i=>T.Cartesian3.fromRadiansArray(i)[0])};class Si extends T.Color{}const Ti=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:o,outlineWidth:u}=e,h=he(),[m,w]=c.useState();c.useEffect(()=>{w(new ye(h,t,i))},[]),c.useEffect(()=>{if(m){const D=m;if(n.drawing)switch(n.type){case re.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingPolygon({callback:P=>{n.handler({primitive:P,type:re.POLYGON,geojson:Ei(P)})}});break;case re.BOX:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingExtent({callback:P=>{n.handler({primitive:P,type:re.BOX,geojson:Ci(P)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else D.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[n,m]);const _=D=>{let P=D.coordinates!==void 0?D.coordinates:vi(D.type,D.geojson);if(o!==!0)switch(D.type){case re.BOX:return r.jsx(Dt,{coordinates:P,material:s??t});case re.POLYGON:return r.jsx(At,{hierarchy:new T.PolygonHierarchy(P),material:s??t});default:return r.jsx(r.Fragment,{})}else{switch(D.type){case re.BOX:P=wi(P);break;case re.POLYGON:P=[...P,P[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(mi,{positions:P,width:u??1,material:s??t})}};return r.jsx(It,{...e,children:e.drawings.map((D,P)=>r.jsxs(Pt,{name:D.name,children:[r.jsxs(Lt,{children:[r.jsxs("h1",{children:["Drawed Entity ",D.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),_(D)]},D.id))})};class bi extends T.PolylineDashMaterialProperty{}class _i extends T.ConstantProperty{}class Mi extends T.ConstantPositionProperty{}class Pi extends T.Cartesian2{}class Li extends T.Cartesian3{}class Ai extends T.Cartographic{}class Di extends T.BoundingSphere{}class Ii extends T.Ellipsoid{}class ki extends T.GeographicTilingScheme{}class Oi extends T.Rectangle{}class xi extends T.Resource{}class Ni extends T.EllipsoidTerrainProvider{}class Bi extends T.CesiumTerrainProvider{}const Fi=T.VerticalOrigin,Hi=T.LabelStyle,Tr="",Gi=38,Vi=40,zi=13,$i=14,Wi=27,Ui=9,qi=10,ji=100,Ki=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[o,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",V),()=>{try{window.removeEventListener("resize",V)}catch(v){console.log('WINDOW "resize" remove listener failed',v)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:v}=e,{caret:p}=o;Q(n,p,v)},[e]);const m=(v,p,C)=>{const{trigger:y,matchAny:S,regex:L}=e,M=new RegExp(L);let b=y;Array.isArray(b)||(b=new Array(y)),b.sort();const A={};Array.isArray(C)&&b.forEach(J=>{A[J]=C});const I=w(b,M);let j={};for(let J=0;J<I.length;J++){const{triggerStr:F,triggerMatch:k,triggerLength:O}=I[J];for(let W=p-1;W>=0;--W){const le=v.substring(W,p).match(M);let ne=-1;if(O>0){const ce=k?W:W-O+1;if(ce<0||(_(F,v,ce)&&(ne=ce+O),!le&&ne<0))break}else{if(le&&W>0)continue;if(ne=W===0&&le?0:W+1,p-ne===0)break}if(ne>=0){const ce=A[F];if(!Array.isArray(ce))continue;const we=v.substring(ne,p),ke=ce.filter(or=>{const Ot=or.toLowerCase().indexOf(we.toLowerCase());return Ot!==-1&&(S||Ot===0)}),ir=F,rr=we.length;j={...j,trigger:ir,matchStart:ne,matchLength:rr,options:ke}}}}return j},w=(v,p)=>v.map(y=>({triggerStr:y,triggerMatch:y.match(p),triggerLength:y.length})),_=(v,p,C)=>!v||!v.length||p.substr(C,v.length)===v,D=v=>{const{onChange:p,options:C,spaceRemovers:y,spacer:S,value:L}=e,M=n,b=v.target.value,A=Qe(P(v.target)).end;if(b.length||G({...o,helperVisible:!1}),t(b),G({...o,caret:A,value:v.target.value}),!b.length||!A)return p(v.target.value);if(i&&y.length&&b.length>2&&S.length){for(let I=0;I<Math.max(M.length,b.length);++I)if(M[I]!==b[I]){if(I>=2&&b[I-1]===S&&y.indexOf(b[I-2])===-1&&y.indexOf(b[I])!==-1&&!U.isEmpty(m(b.substring(0,I-2),A-3,C))){const j=`${b.slice(0,I-1)}${b.slice(I,I+1)}${b.slice(I-1,I)}${b.slice(I+1)}`;return Z(I+1),h.current!==null&&(h.current.value=j),L||G({...o,value:j}),p(j)}break}s(!1)}return Q(b,A,C),p(v.target.value)},P=v=>{if(v!==void 0)if(v.children.length>0){const p=v.getElementsByTagName("textarea");if(p.length>0)return p[0];const C=v.getElementsByTagName("input");if(C.length>0)return C[0]}else return v},x=v=>{const{helperVisible:p,options:C,selection:y}=o,{onKeyDown:S,passThroughEnter:L}=e;if(p)switch(v.keyCode){case Wi:v.preventDefault(),K();break;case Gi:v.preventDefault(),G({...o,selection:(C.length+y-1)%C.length});break;case Vi:v.preventDefault(),G({...o,selection:(y+1)%C.length});break;case $i:case zi:L||v.preventDefault(),X(y);break;case Ui:X(y);break;default:S(v);break}else S(v)},V=()=>{G({...o,helperVisible:!1})},X=v=>{const{spacer:p,onSelect:C,changeOnSelect:y}=e,{matchStart:S,matchLength:L,options:M,trigger:b}=o,A=M[v],I=n,j=I.substring(0,S-b.length),J=I.substring(S+L),F={target:h.current},k=y(b,A);F.target!==null&&(F.target.value=`${j}${k}${p}${J}`),D(F),F.target!==null&&C(F.target.value),K(),Z(j.length+k.length+1),s(!0)},Z=v=>{G({...o,caret:v});const p=P(h.current);Qe.setCaretPosition(p,v)},G=v=>{setTimeout(()=>{u({...v})},0)},Q=(v,p,C)=>{const y=h.current;if(h.current===null)return;const S=P(y);if(S===void 0)return;const L=y.getBoundingClientRect(),M=m(v,p,C);if(Object.keys(M).length>0&&S!==null){const b=jt(S,p),A=S.getBoundingClientRect(),{minChars:I,onRequestOptions:j,requestOnlyIfNoOptions:J,mode:F}=e;let k,O,W,fe="unset";F==="assist"?(k=y===S?b.top+S.offsetTop:b.top+L.top,O=Math.min(b.left+S.offsetLeft-qi,S.offsetLeft+A.width-ji)):(k=L.top+y.offsetHeight,O=y.offsetLeft,W=y.offsetLeft-y.offsetWidth,fe=`${L.width}px`),M.matchLength>=I&&(M.options.length>1||M.options.length===1&&M.options[0].length!==M.matchLength)?G({...o,value:v,helperVisible:!0,top:k,left:O,right:W,width:fe,...M}):((!J||!M.options.length)&&j(v.substr(M.matchStart,M.matchLength)),K())}else K()},K=()=>{setTimeout(()=>{G({...o,helperVisible:!1,selection:0})},100)},N=()=>{const{helperVisible:v,left:p,right:C,matchStart:y,matchLength:S,options:L,selection:M,top:b,value:A,width:I}=o;if(!v)return null;const{maxOptions:j,offsetX:J,offsetY:F,direction:k}=e;if(L.length===0)return null;if(M>=L.length)return G({...o,selection:0}),null;const O=j===0?L.length:j,W=L.slice(0,O).map((le,ne)=>{const ce=le.toLowerCase().indexOf(A.substr(y,S).toLowerCase());return r.jsxs("li",{className:ne===M?"active":void 0,onClick:()=>{X(ne)},onMouseEnter:()=>{G({...o,selection:ne})},children:[le.slice(0,ce),r.jsx("strong",{children:le.substr(ce,S)}),le.slice(ce+S)]},le)}),fe=k==="ltr"?{left:p+J}:{right:C+J};return r.jsx("ul",{className:"react-autocomplete-input",style:{...fe,top:b+F,width:I},children:W})},{Component:q,ComponentProps:B,defaultValue:$,disabled:R,onBlur:a,value:l,...E}=e,d=Object.assign({},E);return Object.keys(e).forEach(v=>{delete d[v]}),r.jsxs(r.Fragment,{children:[c.cloneElement(q,{disabled:R,onBlur:a,onChange:D,onKeyDown:x,ref:h,value:n,...d,...B}),N()]})},Yi={Component:r.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"},Xi=e=>{let n={...Yi,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),r.jsx(Ki,{...n})},Ie={formatFileModDate:(e,n)=>{const t=H.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=Yt(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()}`}},Zi={locale:ae.EN,formatters:{...Ie}},Ji={locale:ae.RU,formatters:{...Ie},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
1
+ (function(g,r){typeof exports=="object"&&typeof module<"u"?r(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("@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("@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","@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","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g.reactComponents={},g.jsxRuntime,g.React,g.dateFns,g.locale,g.pickers,g.DateFnsUtils,g.styles,g.core,g.reactCore,g.useMediaQuery,g.DatePicker,g.datePickerHebrewLocale,g.moment,g.rewind,g.ol,null,g.coordinate,g.control,g.MousePosition,g.proj,g.layer,g.source,g.format,g.interaction,g.Draw,g.TableHead,g.utils,g.CssBaseline,g.ScopedCssBaseline,g.ReactDOM,g.resium,g.Cesium,g.lodash,g.booleanPointInPolygon,g.turf,g.bbox,g.bboxPolygon,g.getCaretCoordinates,g.getInputSelection,g.chonky,g.chonkyIconFontawesome,g.filesize))})(this,function(g,r,c,de,Se,ve,$e,me,Y,z,xt,We,Nt,Ee,Bt,Ue,lr,qe,Oe,xe,Ft,je,Ke,Ye,Ht,Gt,Vt,Xe,zt,$t,Wt,ge,T,U,Ut,qt,Ze,Je,jt,Qe,H,Kt,Yt){"use strict";var sr=Object.defineProperty;var ar=(g,r,c)=>r in g?sr(g,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):g[r]=c;var te=(g,r,c)=>(ar(g,typeof r!="symbol"?r+"":r,c),c);function Ne(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 Re=Ne(c),f=Ne(T),et=Ne(qt);var re=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(re||{}),le=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(le||{}),Te=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Te||{});const ee={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:le.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:le.EN},renderAsButton:!0,offset:0,disableFuture:!0}},se=e=>{const{children:n,...t}=e;return r.jsx(Y.Box,{...t,children:n})},Be=e=>{const n=e.type==="dark";return c.useMemo(()=>tt(e,n),[n,e])},tt=(e,n=!1)=>me.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}}}),cr="",Xt=2,Zt=.5,Jt=me.makeStyles(e=>me.createStyles({container:{padding:e.spacing(Xt),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Zt)}})),nt=e=>{var K,N,q,B;const n=Jt(),t=z.useTheme(),i=Be(t),[s,o]=c.useState(null),[u,h]=c.useState(null),[m,w]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),b=e.controlsLayout??ee.DATE_RANGE_PICKER.controlsLayout,D=e.disableFuture??ee.DATE_RANGE_PICKER.disableFuture,P=((K=e.local)==null?void 0:K.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,x=((N=e.local)==null?void 0:N.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,V=((q=e.local)==null?void 0:q.setText)??ee.DATE_RANGE_PICKER.local.setText,Z=(((B=e.local)==null?void 0:B.calendarLocale)??ee.DATE_RANGE_PICKER.local.calendarLocale)===le.HE?Se.he:Se.enUS;c.useEffect(()=>{o(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{w(e.dateFormat??ee.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(de.isValid(s)&&!u||de.isValid(u)&&!s||s&&u&&de.isValid(s)&&de.isValid(u)&&de.isBefore(s,u)),Q=()=>{e.onChange({from:s&&de.isValid(s)?s:void 0,to:u&&de.isValid(u)?u:void 0})};return r.jsx(Y.ThemeProvider,{theme:i,children:r.jsx(se,{className:`${n.container} drpContainer`,display:"flex",flexDirection:b,width:b==="column"?e.contentWidth:"unset",children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:$e,locale:Z,children:[r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:P,onChange:$=>o($),value:s,disableFuture:D,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:x,className:n.margin,onChange:$=>h($),value:u,disableFuture:D,format:m,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(z.ThemeProvider,{options:t,children:r.jsx(z.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:Q,disabled:!G,children:V})})]})})})},it=e=>{const{children:n,...t}=e;return r.jsx(Y.Popover,{...t,children:n})},dr="",Qt=e=>{var N,q;const[n,t]=c.useState(null),[i,s]=c.useState(null),[o,u]=c.useState(ee.DATE_RANGE_PICKER.dateFormat),[h,m]=c.useState(null),w=B=>{m(B.currentTarget)},b=B=>{B.currentTarget.tagName==="I"?m(B.currentTarget.previousElementSibling):m(B.currentTarget)},D=()=>{m(null)},P=Boolean(h),x=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 V=((N=e.local)==null?void 0:N.startPlaceHolderText)??ee.DATE_RANGE_PICKER.local.startPlaceHolderText,X=((q=e.local)==null?void 0:q.endPlaceHolderText)??ee.DATE_RANGE_PICKER.local.endPlaceHolderText,Z=e.renderAsButton===void 0?ee.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?ee.DATE_RANGE_PICKER.offset:e.offset,Q=e.disableFuture===void 0?ee.DATE_RANGE_PICKER.disableFuture:e.disableFuture,K=c.useMemo(()=>`${n?de.format(n,o):V} - ${i?de.format(i,o):X}`,[n,i,o,V,X]);return r.jsxs(r.Fragment,{children:[Z?r.jsx(z.Button,{style:{width:e.width},raised:!0,onClick:w,className:"drpOpener",children:K}):r.jsx(z.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:K,onClick:b,trailingIcon:{icon:"date_range",tabIndex:0,onClick:b}}),r.jsx(it,{open:P,anchorEl:h,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(nt,{controlsLayout:x,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:o,disableFuture:Q,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:i??void 0,onChange:({from:B,to:$})=>{t(B??null),s($??null),e.onChange({from:B,to:$}),D()}})})]})},be=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Rt=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:i=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:m="",startTimeLabel:w="",startTimeWrapperClassName:b=""})=>r.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[r.jsx("div",{className:`startTimeWrapper ${b}`,children:r.jsx(z.TextField,{label:w,disabled:n===null,className:`timeRangeInput ${m}`,name:"start-time",type:"time",value:Ee(n).format("HH:mm"),onChange:D=>{const P=Ee(n),x=Ee(D.currentTarget.value,"HH:mm"),V=P.set({hours:x.get("hours"),minutes:x.get("minutes")});i(V.toDate())}})}),r.jsx("div",{className:`endTimeWrapper ${u}`,children:r.jsx(z.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Ee(e).format("HH:mm"),onChange:D=>{const P=Ee(e),x=Ee(D.currentTarget.value,"HH:mm"),V=P.set({hours:x.get("hours"),minutes:x.get("minutes")});t(V.toDate())}})})]}),en=c.forwardRef(({value:e,onClick:n,onInputClick:t,...i},s)=>r.jsx(z.TextField,{...i,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{n==null||n(o),t==null||t()},ref:s,value:e})),tn=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:i,onShortcut:s})=>{const[o,u]=c.useState(),h=c.useMemo(()=>t.map(m=>m instanceof Function?m():m),[t]);return c.useEffect(()=>{for(const m of h){const w=i.startDate&&i.endDate&&de.isSameDay(m.startDate,i.startDate)&&de.isSameDay(m.endDate,i.endDate);o?m.id===o&&(w||u(void 0)):w&&u(m.id)}},[i,o,h]),r.jsx("div",{className:"shortcutsContainer",children:h.map((m,w)=>{const b=()=>{e(m.startDate),n(m.endDate)};return r.jsx(z.Button,{type:"button",className:`shortcut ${o===m.id?"selected":""}`,onClick:D=>{b(),s==null||s({startDate:m.startDate,endDate:m.endDate})},outlined:!0,children:m.label},m.id+w)})})},nn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:i,monthClassName:s,selectsRange:o,onChange:u,inputName:h,showMonthYearDropdown:m,withShortcuts:w,locale:b="en"}=e,[D,P]=c.useState(null),[x,V]=c.useState(null),[X,Z]=c.useState(!1),G=o?{startDate:D,endDate:x}:D;c.useEffect(()=>{b==="he"&&We.registerLocale("he",Nt)},[b]),c.useEffect(()=>{var N,q;((N=e.startDate)==null?void 0:N.toString())!==(D==null?void 0:D.toString())&&P(e.startDate),((q=e.endDate)==null?void 0:q.toString())!==(x==null?void 0:x.toString())&&V(e.endDate)},[e.startDate,e.endDate,D,x]);const Q=c.useMemo(()=>{let N="pickerContainer"+(b==="he"?" pickerContainer-rtl":"");return w&&o&&(N+=" pickerContainer-withShortcuts"),N},[b,w,o]),K=m?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return r.jsx("div",{className:Q,style:{direction:b==="he"?"rtl":"ltr"},children:r.jsx(We,{...e,ref:n,onClickOutside:()=>Z(!1),open:X,startDate:be(G)?D:void 0,selected:D,endDate:be(G)?x:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:N=>`pickerWeek ${(i==null?void 0:i(N))??""}`,dayClassName:N=>`pickerDay ${(i==null?void 0:i(N))??""}`,monthClassName:N=>`pickerMonth ${(s==null?void 0:s(N))??""}`,onChange:(N,q)=>{if(Array.isArray(N)){const[B,$]=N;P(B),V($),u==null||u({startDate:B,endDate:$&&de.endOfDay($)},q)}else P(N),u==null||u(N,q)},customInput:r.jsx(en,{name:h,onInputClick:()=>{Z(!0)}}),showTimeInput:!!(w&&o),timeInputLabel:"",customTimeInput:w&&be(G)&&r.jsx(tn,{onShortcut:N=>{u==null||u(N),Z(!1)},shortcuts:w,setEndDate:V,setStartDate:P,dateRange:G}),showMonthYearDropdown:void 0,...K})})}),ur="",rn=e=>{const n=z.useTheme(),t=Be(n),[i,s]=c.useState(e.value),{format:o=ee.DATE_PICKER.dateFormat,variant:u=ee.DATE_PICKER.variant,disableFuture:h=ee.DATE_PICKER.disableFuture,local:m,onChange:w,showTime:b=ee.DATE_PICKER.showTime,value:D,...P}=e,{placeHolderText:x=ee.DATE_PICKER.local.placeHolderText,calendarLocale:V}=m??{placeHolderText:ee.DATE_PICKER.local.placeHolderText,calendarLocale:le.EN},X=V===le.HE?Se.he:Se.enUS,Z=G=>{s(G),w(G)};return r.jsx(Y.ThemeProvider,{theme:t,children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:$e,locale:X,children:[b&&r.jsx(ve.KeyboardDateTimePicker,{variant:u,placeholder:x,onChange:Z,value:i,disableFuture:h,format:o,...P}),!b&&r.jsx(ve.KeyboardDatePicker,{variant:u,placeholder:x,onChange:Z,value:i,disableFuture:h,format:o,...P})]})})},on=18,sn=me.makeStyles(e=>me.createStyles({drawingButton:{width:e.spacing(on)},fullWidth:{width:"100%",marginTop:"36px"}})),an=e=>{const n=sn(),[t,i]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:u,onReset:h}=e,m=b=>{i(b.currentTarget)},w=()=>{i(null)};return s?r.jsx(z.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):r.jsxs(se,{position:"relative",children:[r.jsx(z.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(z.Button,{className:n.drawingButton,raised:!0,onClick:m,children:"Draw AOI"})}),r.jsxs(z.Menu,{className:n.fullWidth,open:Boolean(t),onClose:w,children:[r.jsx(z.MenuItem,{onClick:()=>{u(re.POLYGON),w()},children:"Polygon"}),r.jsx(z.MenuItem,{onClick:()=>{u(re.BOX),w()},children:"Box"}),r.jsx(z.MenuItem,{onClick:()=>{h(),w()},children:"Clear"})]})]})},hr="";var ue=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ue||{});const _e=5,Me=2,rt=c.createContext(null),ln=rt.Provider,ot=35,st=32,cn=10,dn=e=>e!==void 0&&e!==ue.WGS84?Ft.transform([ot,st],ue.WGS84,e):[ot,st],un=e=>{switch(e){case ue.WEB_MERCATOR:return n=>qe.format(n,"Mercator: {y}m, {x}m",Me);case ue.WGS84:return n=>qe.format(n,"WGS84: {y}°N {x}°E",_e);default:return n=>""}},Fe=()=>{const e=c.useContext(rt);if(e===null)throw new Error("map context is null, please check the provider");return e},hn=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:i,projection:s}=e,[o]=c.useState(new Ue.Map({view:new Ue.View({projection:s??ue.WGS84}),controls:Oe.defaults()}));c.useEffect(()=>{o.getView().setCenter(e.center??dn(e.projection))},[o,e.center,e.projection]),c.useEffect(()=>{o.getView().setZoom(e.zoom??cn)},[o,e.zoom,e.projection]);const u=(h,m)=>{m.getControls().forEach(b=>{b instanceof h&&m.removeControl(b)})};return c.useEffect(()=>{o.setTarget(n.current),t!==void 0&&t?o.addControl(new Oe.FullScreen):u(Oe.FullScreen,o)},[o,t]),c.useEffect(()=>{i!==void 0&&i?(u(xe,o),o.addControl(new xe({coordinateFormat:un(s??ue.WGS84),projection:s??ue.WGS84,undefinedHTML:"&nbsp;"}))):u(xe,o)},[o,i,s]),r.jsxs(ln,{value:o,children:[r.jsx("div",{className:"map",ref:n}),e.children]})},at=c.createContext(null),gn=at.Provider,pn=()=>{const e=c.useContext(at);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},fn=({options:e,children:n})=>{const t=Fe(),[i]=c.useState(new je.Tile(e));return c.useEffect(()=>(t.addLayer(i),()=>{t.removeLayer(i)}),[t,i]),r.jsx(gn,{value:i,children:n})},lt=c.createContext(null),mn=lt.Provider,yn=()=>{const e=c.useContext(lt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},vn=({children:e})=>{const n=Fe(),[t]=c.useState(new je.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),r.jsx(mn,{value:t,children:e})},ct=c.createContext(null),En=ct.Provider,Cn=()=>{const e=c.useContext(ct);if(e===null)throw new Error("vector source context is null, please check the provider");return e},wn=({children:e})=>{const n=yn(),[t]=c.useState(new Ke.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),r.jsx(En,{value:t,children:e})},Sn=({geometry:e})=>{const n=Cn();return c.useEffect(()=>{const i=new Ye.GeoJSON().readFeature(e);return n.addFeature(i),()=>{n.removeFeature(i)}},[e,n]),null},Tn=e=>{const n=pn();return c.useEffect(()=>{n.setSource(new Ke.OSM)},[n]),null},bn=({drawType:e,onPolygonSelected:n})=>{const t=Fe();return c.useEffect(()=>{const i={type:"Circle"};switch(e){case re.BOX:i.geometryFunction=Gt.createBox();break;case re.POLYGON:i.type="Polygon";break;default:return}const s=new Ht.Draw(i);t.addInteraction(s);const o=u=>{const m=new Ye.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(m)};return s.on("drawend",o),()=>{s.un("drawend",o),t.removeInteraction(s)}},[n,e,t]),null},gr="",_n=e=>{const n=t=>{const i=Bt(t);e.onPolygonSelection(i)};return r.jsxs(hn,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(fn,{children:r.jsx(Tn,{})}),e.selectionPolygon&&r.jsx(vn,{children:r.jsx(wn,{children:r.jsx(Sn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(bn,{drawType:e.drawType,onPolygonSelected:n})]})},He=1.5,Mn=80,Pn=me.makeStyles(e=>me.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(He),top:e.spacing(He)},contentContainer:{marginTop:e.spacing(He),width:e.spacing(Mn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Ln=e=>{var m;const[n,t]=c.useState(),[i,s]=c.useState(),o=Pn(),u=w=>{s(w),t(void 0),e.handlePolygonSelected(w)},h=()=>{s(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:o.map,children:[r.jsxs("div",{className:`${o.absolute}`,children:[r.jsxs(Y.Paper,{className:o.filtersContainer,children:[r.jsx(an,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:n!==void 0}),(m=e.filters)==null?void 0:m.map((w,b)=>r.jsx("div",{className:o.filtersMargin,children:w},b))]}),r.jsx(Y.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),r.jsx(_n,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:i})]})};function An(e){const{headCells:n,order:t,orderBy:i,onRequestSort:s,isCollapseable:o}=e,u=h=>m=>{s(m,h)};return r.jsx(Vt,{children:r.jsxs(Y.TableRow,{children:[o&&r.jsx(Y.TableCell,{}),n.map(h=>r.jsx(Y.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:i===h.id?t:!1,children:r.jsx(Y.TableSortLabel,{active:i===h.id,direction:i===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const Dn=Xe.createSvgIcon(Re.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),In=Xe.createSvgIcon(Re.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function kn(e){const{cellsMetadata:n,isRowSelected:t,item:i,onRowSelected:s,rowIndex:o,isCollapseable:u,collapsedElement:h}=e,[m,w]=c.useState(!1),b=n.length,D=()=>{s==null||s(o)};return r.jsxs(r.Fragment,{children:[r.jsxs(Y.TableRow,{hover:!0,selected:t,onClick:D,children:[u&&r.jsx(Y.TableCell,{padding:"checkbox",children:r.jsx(Y.IconButton,{"aria-label":"expand row",size:"small",onClick:P=>{P.stopPropagation(),w(!m)},children:m?r.jsx(In,{}):r.jsx(Dn,{})})}),n.map(P=>r.jsx(Y.TableCell,{align:P.numeric?"right":"left",padding:P.disablePadding?"none":"default",children:P.transform?P.transform(i[P.id]):i[P.id]},P.id+o.toString()))]}),u&&r.jsx(Y.TableRow,{children:r.jsx(Y.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:b+1,children:r.jsx(Y.Collapse,{in:m,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(i)})})})]})}function On(e){const[n,t]=c.useState(""),[i,s]=c.useState("asc"),{cellsMetadata:o,items:u,onRequestSort:h,onRowSelected:m,isCollapseable:w,collapsedElement:b,isDense:D,page:P,rowsPerPage:x,count:V,handleChangePage:X,handleChangeRowsPerPage:Z}=e,G=(Q,K)=>{const N=n===K&&i==="asc";s(N?"desc":"asc"),t(K),h(K,N?"desc":"asc")};return r.jsxs(Y.TableContainer,{component:Y.Paper,children:[r.jsxs(Y.Table,{size:D?"small":"medium",children:[r.jsx(An,{headCells:o,onRequestSort:G,order:i,orderBy:n,isCollapseable:w}),r.jsxs(Y.TableBody,{children:[u.map((Q,K)=>r.jsx(kn,{item:Q,rowIndex:K,isCollapseable:w,cellsMetadata:o,collapsedElement:b,isRowSelected:!1,onRowSelected:m},K)),(u.length===0||x>u.length)&&r.jsx(Y.TableRow,{style:{height:(D?33:53)*(x-u.length)},children:r.jsx(Y.TableCell,{colSpan:w?o.length+1:o.length,children:u.length===0&&r.jsx(Y.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(Y.TablePagination,{rowsPerPage:x,rowsPerPageOptions:[5,10],component:"div",count:V,page:P,onPageChange:X,onRowsPerPageChange:Z})]})}const xn=e=>{const{children:n,...t}=e;return r.jsx(zt,{...t,children:n})},Nn=e=>{const{children:n,...t}=e;return r.jsx($t,{...t,children:n})},dt=e=>e*Math.PI/180,Pe=e=>e*(180/Math.PI),Bn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(dt(85.362/2))/Math.sin(dt(85.362/2))),pr="",Fn=e=>{const n=he(),t=c.useRef(null),[i,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(o=>{o!=null&&o.endPosition&&s({...o.endPosition})},T.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const o=n.scene.globe.ellipsoid,u=n.camera.pickEllipsoid(new T.Cartesian3(i.x,i.y),o);if(u){const h=o.cartesianToCartographic(u);if(t.current){let m="";switch(e.projection){case ue.WEB_MERCATOR:{const b=new T.WebMercatorProjection(o).project(h);m=`Mercator: ${b.y.toFixed(Me)}m, ${b.x.toFixed(Me)}m`,t.current.style.width="220px";break}case ue.WGS84:{const w=T.Math.toDegrees(h.longitude).toFixed(_e);m=`WGS84: ${T.Math.toDegrees(h.latitude).toFixed(_e)}°N ${w}°E`,t.current.style.width="200px";break}}t.current.innerHTML=m}}},[i,t,n,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},fr="",Ge=[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],Hn=(e,n,t,i)=>{const s=U.get(i,"METERS_UNIT")??"m",o=U.get(i,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},h=new T.EllipsoidGeodesic,m=new Date().getTime();if(m<u.lastLegendUpdate+250)return;u.lastLegendUpdate=m;const w=e.scene.canvas.clientWidth,b=e.scene.canvas.clientHeight,D=e.scene.camera.getPickRay(new T.Cartesian2(w/2|0,b-1)),P=e.scene.camera.getPickRay(new T.Cartesian2(1+w/2|0,b-1)),x=e.scene.globe,V=x.pick(D,e.scene),X=x.pick(P,e.scene);if(!V||!X)return;const Z=x.ellipsoid.cartesianToCartographic(V),G=x.ellipsoid.cartesianToCartographic(X);h.setEndPoints(Z,G);const Q=h.surfaceDistance,K=100;let N;for(let q=Ge.length-1;!U.isNumber(N)&&q>=0;--q)Ge[q]/Q<K&&(N=Ge[q]);if(U.isNumber(N)){let q="";N>=1e3?q=`${(N/1e3).toString()} ${o}`:q=`${N.toString()} ${s}`,u.barWidth=N/Q|0,u.distanceLabel=q}t(u)},Gn=e=>{const n=he(),[t,i]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const o=m=>{Hn(n,t,i,e.locale)},u=new T.EventHelper,h=m=>{n.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,h),n.camera.moveEnd.addEventListener(o),()=>{try{U.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(m){console.log('CESIUM camera "moveEnd" remove listener failed',m)}}},[n,e.locale,t]);const s=o=>5+(125-o)/2;return r.jsx("div",{className:"scalePosition",children:U.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"distance-legend-label",children:t.distanceLabel}),r.jsx("div",{className:"distance-legend-scale-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ie={MORPHING:T.SceneMode.MORPHING,COLUMBUS_VIEW:T.SceneMode.COLUMBUS_VIEW,SCENE2D:T.SceneMode.SCENE2D,SCENE3D:T.SceneMode.SCENE3D},mr="",ut=(e,n)=>{const i=U.get(n.scene.globe,"_surface.tileProvider"),s=i._quadtree,o=n.canvas.height,u=U.get(n.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(i.getLevelMaximumGeometricError(h)*o/(e*u)<s.maximumScreenSpaceError)return h;return null},Vn=(e,n)=>{e=e||10;const t=[];let i=1e5,s=0;for(let o=1e8;o>i;o=o-i){const u=ut(o,n);if(u===null)break;if(u!==s){let h=o,m=o+i;for(;m-h>e;)o=h+(m-h)/2,ut(o,n)===u?h=o:m=o;t.push({level:u,height:Math.round(o)}),s=u,t.length>=2&&(i=(t[t.length-2].height-o)/1e3)}}return t},zn=e=>{const n=he(),[t,i]=c.useState(1),s=Vn(1,n);return c.useEffect(()=>{const o=()=>{const u=n.camera,h=.5;let m=0;switch(n.scene.mode){case ie.SCENE3D:m=n.scene.mapProjection.ellipsoid.cartesianToCartographic(u.positionWC).height;break;case ie.SCENE2D:m=(u.frustum.right-u.frustum.left)*h;break;case ie.COLUMBUS_VIEW:m=u.position.z;break;default:m=0;break}if(s.length>0){const w=s.reduce((b,D)=>Math.abs(D.height-m)<Math.abs(b.height-m)?D:b);i(w.level)}};return n.camera.moveEnd.addEventListener(o),()=>{try{U.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(o)}catch(u){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',u)}}},[n,s.length]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:t}),r.jsx("div",{className:"zoomLevelLabel",children:U.get(e.locale,"ZOOM_LABEL")??"zoom"})]})},yr="",$n=-1,Wn=e=>{const n=he(),[t,i]=c.useState(),{sceneModes:s}=e,o=u=>s.findIndex(h=>h===u)>$n;return c.useEffect(()=>{i(n.scene.mode)},[]),r.jsxs(r.Fragment,{children:[o(ie.SCENE3D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}}),o(ie.SCENE2D)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}}),o(ie.COLUMBUS_VIEW)&&r.jsx(z.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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)}})]})},vr="",Un=me.makeStyles(e=>me.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),qn=e=>{const n=he(),{baseMaps:t}=e,[i,s]=c.useState(" "),[o,u]=c.useState(),h=Un();c.useEffect(()=>{const w=t==null?void 0:t.maps.find(b=>b.isCurrent);w&&(u(w),s(w.title!==void 0?w.title:" "))},[t]);const m=w=>{var b,D;if(t){(b=n.layersManager)==null||b.removeBaseMapLayers();const P=t.maps.find(x=>x.id===w);P&&((D=n.layersManager)==null||D.setBaseMapLayers(P),u(P),t.maps.forEach(x=>{x.isCurrent=P===x}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:i}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(w=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${w===o?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:w.thumbnail,onMouseOver:()=>{s(w.title)},onMouseOut:()=>{s((o==null?void 0:o.title)!==void 0?o.title:" ")},onClick:()=>{m(w.id)}})},w.id))})]})},Er="",Ve="ic_settings_24px",jn=e=>{const[n,t]=c.useState(!1),{sceneModes:i,baseMaps:s,locale:o}=e,u=c.useRef(null),h=U.get(o,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",m=U.get(o,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",w=U.get(o,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const b=D=>{var V;const P=D.target,x=U.get(u,"current");x&&!x.contains(P)&&P.id!==Ve&&((V=P.parentElement)==null?void 0:V.id)!==Ve&&(document.removeEventListener("click",b,!1),t(!1))};return document.addEventListener("click",b,!1),()=>{document.removeEventListener("click",b,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(z.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Ve,x:"288",y:"24",children:r.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&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:r.jsxs(z.Dialog,{open:n,onClosed:()=>{t(!1)},children:[r.jsx(z.DialogTitle,{children:h}),r.jsxs(z.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:m}),r.jsx(se,{className:"mapScenesContainer",children:r.jsx(Wn,{sceneModes:i})}),r.jsx(se,{className:"baseMapsContainer",children:s&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:w}),r.jsx(qn,{baseMaps:s})]})})]})]})})]})},Cr="",Kn=r.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:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),Yn=({onClick:e})=>r.jsx(se,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(z.Icon,{icon:Kn,className:"mapLegendIcon"})}),Xn=({legend:{legendImg:e,legendDoc:n,layer:t},docText:i,imgText:s})=>{const o=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const w=r.jsx(se,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(z.Tooltip,{content:t,children:w}):w},[t]),h=c.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&r.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:i})],[e,s,n,i]);return r.jsxs(se,{className:"mapLegend",children:[u(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),r.jsx(se,{className:"legendActionsContainer",children:h()})]})},Zn=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:i})=>{const s=c.useCallback(()=>r.jsx(se,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:i})}),[i]),o=c.useCallback(()=>e.length?e.map((u,h)=>r.jsx(Xn,{legend:u,docText:n,imgText:t},`${u.layer}_${h}`)):s(),[e]);return r.jsx(se,{className:"mapLegendsList",children:o()})},Jn=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:i="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?r.jsxs(z.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(z.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(z.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(z.DrawerContent,{className:"sidebarContent",children:[r.jsx(z.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(Zn,{noLegendsText:i,legends:o,actionsTexts:s})]})]}):null,ht=(e,n,t)=>{let i;if(e.scene.mode!==T.SceneMode.SCENE2D)i=e.scene.pickPosition(new T.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;i=e.camera.pickEllipsoid(new T.Cartesian2(n,t),s)}return T.Cartographic.fromCartesian(i)},Qn=(e,n,t)=>{const i=ht(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[T.Math.toDegrees(i.longitude),T.Math.toDegrees(i.latitude)]}}},Rn=(e,n,t)=>{try{const i=ht(e,n,t);return{longitude:T.Math.toDegrees(i.longitude),latitude:T.Math.toDegrees(i.latitude)}}catch{return}},pe=document.createElement("canvas"),oe=pe.getContext("2d"),gt=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},ei=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,i)=>{try{oe==null||oe.clearRect(0,0,pe.width,pe.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){pe.width=e.width,pe.height=e.height,oe==null||oe.drawImage(e,0,0);const o=oe==null?void 0:oe.getImageData(0,0,pe.width,pe.height),u=gt(o);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{pe.width=s.width,pe.height=s.height,oe==null||oe.drawImage(s,0,0);const o=oe==null?void 0:oe.getImageData(0,0,pe.width,pe.height);gt(o)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),i(s)}})),Le=(e,n)=>{const{west:t,east:i,north:s,south:o}=e,{west:u,east:h,north:m,south:w}=n;return t>=u&&i<=h&&s<=m&&o>=w},Ae=3,De="hasTransparency";function ze(e,n,t,i,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(m=>{var w,b;return((w=m._imageryProvider._resource)==null?void 0:w._url)===((b=this._resource)==null?void 0:b._url)}))==null?void 0:h.meta,u=U.get(o,De)===!0;this.tileTransparencyCheckedCounter<Ae&&!u&&ei(s==null?void 0:s.url,this).then(m=>{var w;(w=this.mapViewer.layersManager)==null||w.addMetaToLayer({[De]:m},b=>b._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,i,s)}class pt extends T.UrlTemplateImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}class ft extends T.WebMapServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}class mt extends T.WebMapTileServiceImageryProvider{constructor(t,i){var s;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Ae);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=i.layersManager)==null?void 0:s.layerList,this.mapViewer=i}requestImage(t,i,s,o){return ze.call(this,super.requestImage.bind(this),t,i,s,o)}}const ti=1,ni=-1,yt="TRANSPARENT_BASE_LAYER";class ii{constructor(n,t,i,s){te(this,"mapViewer");te(this,"legendsList");te(this,"layerUpdated");te(this,"layers");te(this,"legendsExtractor");te(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new T.Event,this.layerManagerFootprintMetaFieldPath=s,i&&this.layerUpdated.addEventListener(i,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(o=>{const u=Object.keys(o);u.length===1&&u[0]===De&&(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 o=this.layers.find(t);o&&(o.meta={...o.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 o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new pt(o,this.mapViewer):new T.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new ft(o,this.mapViewer):new T.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const o=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new mt(o,this.mapViewer):new T.WebMapTileServiceImageryProvider(o);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=>!!U.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!U.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 o=0;o<t;o++)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,o=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(i);if(u-t<=o&&(t=u-o),i)for(let h=0;h<t;h++)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=>!U.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(o=>!U.get(o.meta,"parentBasetMapId"))),i}findLayerByPOI(n,t,i=!0){if(this.layerManagerFootprintMetaFieldPath){const s=Qn(this.mapViewer,n,t);return this.layers.filter(h=>!U.get(h.meta,"parentBasetMapId")).filter(h=>{const m=U.get(h.meta,this.layerManagerFootprintMetaFieldPath);return m!==void 0?Ut(s.geometry,{type:"Feature",properties:{},geometry:m})&&(i?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,m)=>{var w,b;return((w=m.meta)==null?void 0:w.zIndex)-((b=h.meta)==null?void 0:b.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new T.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new T.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=>!!U.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?ti:ni,o=t<i?t:i,u=t<i?i:t;this.layers.forEach(h=>{var w;if(!U.get(h.meta,"parentBasetMapId")){const b=(w=h.meta)==null?void 0:w.zIndex;h.meta.zIndex=b>=o&&b<=u&&b!==t?b+s:b===t?i:b}})}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 o=this.layers[s],u=!U.isEmpty(i)&&!U.isEmpty(o.rectangle)&&T.Rectangle.intersection(i,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((n=o.meta)==null?void 0:n.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const m=this.layers[h],w=((t=m.meta)==null?void 0:t[De])===!0;if(o!==m)if(u instanceof T.Rectangle){if(Le(i,o.rectangle))if(Le(i,m.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(Le(i,m.rectangle)&&!w){o.meta={...o.meta??{},relevantToExtent:!1};break}if(Le(o.rectangle,m.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:w},!w)break}else o.meta={...o.meta??{},relevantToExtent:!0}}else o.meta={...o.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(o.meta={...o.meta??{},relevantToExtent:u instanceof T.Rectangle})}}}catch(i){console.error(i)}}}const wr="",vt=212,Et=260,ri=0;class oi extends T.Viewer{constructor(t,i){super(t,i);te(this,"layersManager");te(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const Ct=c.createContext(null),si=Ct.Provider,he=()=>{const e=c.useContext(Ct);if(e===null)throw new Error("map context is null, please check the provider");return e},ai=e=>{var L,M,_,A,I,j,J,F;const n=c.useRef(null),[t,i]=c.useState(),[s,o]=c.useState(),[u,h]=c.useState(),[m,w]=c.useState(),[b,D]=c.useState(),[P,x]=c.useState(),V=c.useRef(),[X,Z]=c.useState(),[G,Q]=c.useState([]),[K,N]=c.useState(),[q,B]=c.useState(!1),$=c.useRef(),[R,a]=c.useState(void 0),[l,E]=c.useState(!1),[d,v]=c.useState(),p={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,...e},C=(k,O,W,fe,ae)=>{const ne=t.container,ce=ne.clientWidth,we=ne.clientHeight,ke=fe+ae;return{left:`${ce-k<W?k-(W-(ce-k)):k}px`,top:`${we-O<ke?O-(ke-(we-O)):O}px`}},y=c.useCallback(k=>{if(n.current!==null){const O=n.current.cesiumElement,W={x:k.offsetX,y:k.offsetY};B(!1),a(W),v(Rn(O,W.x,W.y)),B(!0),$.current=k}},[n]);c.useEffect(()=>{var k;if(n.current!==null){const O=n.current.cesiumElement;e.imageryContextMenu&&(O.scene.canvas.removeEventListener("contextmenu",y),O.scene.canvas.addEventListener("contextmenu",y))}i((k=n.current)==null?void 0:k.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var k;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new ii(t,(k=e.legends)==null?void 0:k.mapLegendsExtractor,()=>{var O;Q((O=t.layersManager)==null?void 0:O.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{Z(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var O,W;N(e.baseMaps);const k=(O=e.baseMaps)==null?void 0:O.maps.find(fe=>fe.isCurrent);k&&t&&((W=t.layersManager)==null||W.setBaseMapLayers(k))},[e.baseMaps,t]),c.useEffect(()=>{o(e.projection??ue.WGS84)},[e.projection]),c.useEffect(()=>{x(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{w(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{D(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{const k=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const O=()=>{const W=t.camera.positionCartographic;return{longitude:Pe(W.longitude),latitude:Pe(W.latitude),height:W.height}};if(t.scene.mode===T.SceneMode.SCENE3D){const W=new T.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),fe=t.scene.camera.getPickRay(W),ae=t.scene.globe.pick(fe,t.scene);if(!ae)return{longitude:0,latitude:0,height:0};const ne=t.scene.globe.ellipsoid.cartesianToCartographic(ae);return ne!==void 0?{longitude:Pe(ne.longitude),latitude:Pe(ne.latitude),height:t.scene.camera.positionCartographic.height}:O()}else return O()};t&&t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==T.SceneMode.MORPHING){const O=t.camera,W={position:k(),direction:O.direction.clone(),up:O.up.clone(),right:O.right.clone(),transform:O.transform.clone(),frustum:O.frustum.clone()};V.current=W}})},[t]),c.useEffect(()=>{const k=()=>{if(t&&V.current){const O=V.current;t.camera.flyTo({destination:T.Cartesian3.fromDegrees(O.position.longitude,O.position.latitude,O.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(k),()=>{if(t)try{t.scene.morphComplete.removeEventListener(k)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const k=e.zoom,O=e.center;t&&U.isNumber(k)&&U.isArray(O)&&t.camera.flyTo({destination:T.Cartesian3.fromDegrees(O[0],O[1],Bn(k)),duration:0})},[e.zoom,e.center,t]);const S=c.useCallback(()=>t&&Wt.createPortal(r.jsxs(r.Fragment,{children:[r.jsxs(se,{className:"sideToolsContainer",children:[r.jsx(jn,{sceneModes:X,baseMaps:K,locale:P}),r.jsx(Yn,{onClick:()=>E(!l)})]}),r.jsxs(se,{className:"toolsContainer",children:[u===!0?r.jsx(Fn,{projection:s}):r.jsx(r.Fragment,{}),m===!0?r.jsx(zn,{locale:P}):r.jsx(r.Fragment,{}),b===!0?r.jsx(Gn,{locale:P}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[K,P,t,s,X,u,b,l]);return r.jsx(ge.Viewer,{className:"viewer",full:!0,ref:n,...p,children:r.jsxs(si,{value:t,children:[r.jsx(Jn,{title:(L=e.legends)==null?void 0:L.title,isOpen:l,toggleSidebar:()=>E(!l),noLegendsText:(M=e.legends)==null?void 0:M.emptyText,legends:((_=e.legends)==null?void 0:_.legendsList)??G,actionsTexts:(A=e.legends)==null?void 0:A.actionsTexts}),e.children,S(),e.imageryContextMenu&&q&&R&&d&&c.cloneElement(e.imageryContextMenu,{data:(I=t==null?void 0:t.layersManager)==null?void 0:I.findLayerByPOI(R.x,R.y,!1),position:{x:R.x,y:R.y},coordinates:d,style:C(R.x,R.y,((j=e.imageryContextMenuSize)==null?void 0:j.width)??Et,((J=e.imageryContextMenuSize)==null?void 0:J.height)??vt,((F=e.imageryContextMenuSize)==null?void 0:F.dynamicHeightIncrement)??ri),size:e.imageryContextMenuSize??{height:vt,width:Et},handleClose:()=>{B(!q)},contextEvt:$.current})]})})},li=0,ci=e=>{const n=he();return r.jsx(ge.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const i=n.scene;i.globe.depthTestAgainstTerrain=!0;const s=T.Cartographic.fromCartesian(t.boundingSphere.center),o=e.heightFromGround??li;if(o){const u=T.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=T.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),m=T.Cartesian3.subtract(h,u,new T.Cartesian3);t.modelMatrix=T.Matrix4.fromTranslation(m)}}})},wt=180,St=.001,Tt=-1,bt=e=>Math.abs(e)/e,_t=e=>{Math.abs(e[0])===wt&&Math.abs(e[1])===wt/2&&(e[0]+=Tt*bt(e[0])*St,e[1]+=Tt*bt(e[1])*St)},Mt=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{_t(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{_t(t)})});break}},di=e=>{const{data:n,...t}=e;return n&&(typeof n.features<"u"?n.features.forEach(i=>{Mt(i.geometry)}):Mt(n)),r.jsx(ge.GeoJsonDataSource,{data:n,...t})},Ce=e=>{const{meta:n,...t}=e,i=he();return c.useLayoutEffect(()=>{var s;(s=i.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,i]),r.jsx(ge.ImageryLayer,{...t})},ui=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new ft(n,i):new T.WebMapServiceImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},hi=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new mt(n,i):new T.WebMapTileServiceImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},gi=e=>{const{options:n,...t}=e,i=he(),s=i.shouldOptimizedTileRequests?new pt(n,i):new T.UrlTemplateImageryProvider(n);return r.jsx(Ce,{...t,imageryProvider:s})},pi=e=>{const{options:n,...t}=e;return r.jsx(Ce,{...t,imageryProvider:new T.OpenStreetMapImageryProvider(n)})},Pt=e=>r.jsx(ge.Entity,{...e}),fi=e=>r.jsx(ge.EntityDescription,{...e}),Lt=e=>r.jsx(ge.EntityDescription,{...e}),At=e=>r.jsx(ge.PolygonGraphics,{...e}),Dt=e=>r.jsx(ge.RectangleGraphics,{...e}),It=e=>r.jsx(ge.CustomDataSource,{...e}),mi=e=>r.jsx(ge.PolylineGraphics,{...e}),Sr="";var ye=function(){var e=f.Ellipsoid.WGS84,n,t=f.Material.fromType(f.Material.ColorType);function i(a,l=new f.Color(1,1,0,.5),E=new f.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=l,n=E,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}i.prototype.initialiseHandlers=function(){var a=this._scene,l=this,E=new f.ScreenSpaceEventHandler(a.canvas);function d(p,C){if(l._handlersMuted!=!0){var y=a.pick(C);y&&y.primitive&&y.primitive[p]&&y.primitive[p](C)}}E.setInputAction(function(p){d("leftClick",p.position)},f.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(p){d("leftDoubleClick",p.position)},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var v;E.setInputAction(function(p){if(l._handlersMuted!=!0){var C=a.pick(p.endPosition);v&&(!C||v!=C.primitive)&&(!(v.isDestroyed&&v.isDestroyed())&&v.mouseOut(p.endPosition),v=null),C&&C.primitive&&(C=C.primitive,C.mouseOut&&(v=C),C.mouseMove&&C.mouseMove(p.endPosition))}},f.ScreenSpaceEventType.MOUSE_MOVE),E.setInputAction(function(p){d("leftUp",p.position)},f.ScreenSpaceEventType.LEFT_UP),E.setInputAction(function(p){d("leftDown",p.position)},f.ScreenSpaceEventType.LEFT_DOWN)},i.prototype.setListener=function(a,l,E){a[l]=E},i.prototype.muteHandlers=function(a){this._handlersMuted=a},i.prototype.registerEditableShape=function(a){var l=this;$(a,"mouseMove",function(E){a.setHighlighted(!0),a._editMode||l._tooltip.showAt(E,"Click to edit this shape")}),$(a,"mouseOut",function(E){a.setHighlighted(!1),l._tooltip.setVisible(!1)}),$(a,"leftClick",function(E){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:f.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=B(s,{appearance:new f.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=B(s,{}),h=B(s,{}),m=B(s,{}),w=B(o,{rotation:0}),b=B(s,{width:5,geodesic:!0,granularity:1e4,appearance:new f.PolylineMaterialAppearance({aboveGround:!1}),material:t}),D=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,E){this[l]=E,this._createPrimitive=!0},a.prototype.getAttribute=function(l){return this[l]},a.prototype.update=function(l,E,d){if(!f.defined(this.ellipsoid))throw new f.DeveloperError("this.ellipsoid must be defined.");if(!f.defined(this.appearance))throw new f.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new f.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!f.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 v=this.getGeometry();if(!v)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 f.Primitive({geometryInstances:new f.GeometryInstance({geometry:v,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 f.Primitive({geometryInstances:new f.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:f.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new f.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,E,d),this._outlinePolygon&&this._outlinePolygon.update(l,E,d)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),f.destroyObject(this)},a.prototype.setStrokeStyle=function(l,E){(!this.strokeColor||!this.strokeColor.equals(l)||this.strokeWidth!=E)&&(this._createPrimitive=!0,this.strokeColor=l,this.strokeWidth=E)},a}();i.ExtentPrimitive=function(){function a(l){if(!f.defined(l.extent))throw new f.DeveloperError("Extent is required");l=B(l,o),this.initialiseOptions(l),this.setExtent(l.extent)}return a.prototype=new D,a.prototype.setExtent=function(l){this.setAttribute("extent",l)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(f.defined(this.extent))return new f.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.RectangleOutlineGeometry({rectangle:this.extent})},a}(),i.PolygonPrimitive=function(){function a(l){l=B(l,o),this.initialiseOptions(l),this.isPolygon=!0}return a.prototype=new D,a.prototype.setPositions=function(l){this.setAttribute("positions",l)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!f.defined(this.positions)||this.positions.length<3))return f.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return f.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),i.CirclePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.radius)))throw new f.DeveloperError("Center and radius are required");l=B(l,o),this.initialiseOptions(l),this.setRadius(l.radius)}return a.prototype=new D,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(f.defined(this.center)&&f.defined(this.radius))return new f.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),i.EllipsePrimitive=function(){function a(l){if(!(f.defined(l.center)&&f.defined(l.semiMajorAxis)&&f.defined(l.semiMinorAxis)))throw new f.DeveloperError("Center and semi major and semi minor axis are required");l=B(l,w),this.initialiseOptions(l)}return a.prototype=new D,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(f.defined(this.center)&&f.defined(this.semiMajorAxis)&&f.defined(this.semiMinorAxis))return new f.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new f.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),i.PolylinePrimitive=function(){function a(l){l=B(l,b),this.initialiseOptions(l)}return a.prototype=new D,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(!(!f.defined(this.positions)||this.positions.length<2))return new f.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:f.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var P={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},x={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},V={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};i.prototype.createBillboardGroup=function(a,l,E){var d=new i.BillboardGroup(this,l);return d.addBillboards(a,E),d},i.BillboardGroup=function(a,l){this._drawHelper=a,this._scene=a._scene,this._options=B(l,P);var E=new f.BillboardCollection;this._scene.primitives.add(E),this._billboards=E,this._orderedBillboards=[]},i.BillboardGroup.prototype.createBillboard=function(a,l){var E=this._billboards.add({show:!0,position:a,pixelOffset:new f.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new f.Cartesian3(0,0,0),horizontalOrigin:f.HorizontalOrigin.CENTER,verticalOrigin:f.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(l){let p=function(y){v.enableRotate=y},C=function(){for(var y=0,S=d._orderedBillboards.length;y<S&&d._orderedBillboards[y]!=E;++y);return y};var d=this,v=this._scene.screenSpaceCameraController;if(l.dragHandlers){var d=this;$(E,"leftDown",function(S){function L(A){E.position=A;for(var I=0,j=d._orderedBillboards.length;I<j&&d._orderedBillboards[I]!=E;++I);l.dragHandlers.onDrag&&l.dragHandlers.onDrag(C(),A)}function M(A){_.destroy(),p(!0),l.dragHandlers.onDragEnd&&l.dragHandlers.onDragEnd(C(),A)}var _=new f.ScreenSpaceEventHandler(d._scene.canvas);_.setInputAction(function(A){var I=d._scene.camera.pickEllipsoid(A.endPosition,e);I?L(I):M(I)},f.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(A){M(d._scene.camera.pickEllipsoid(A.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1),l.dragHandlers.onDragStart&&l.dragHandlers.onDragStart(C(),d._scene.camera.pickEllipsoid(S,e))})}l.onDoubleClick&&$(E,"leftDoubleClick",function(y){l.onDoubleClick(C())}),l.onClick&&$(E,"leftClick",function(y){l.onClick(C())}),l.tooltip&&($(E,"mouseMove",function(y){d._drawHelper._tooltip.showAt(y,l.tooltip())}),$(E,"mouseOut",function(y){d._drawHelper._tooltip.setVisible(!1)}))}return E},i.BillboardGroup.prototype.insertBillboard=function(a,l,E){this._orderedBillboards.splice(a,0,this.createBillboard(l,E))},i.BillboardGroup.prototype.addBillboard=function(a,l){this._orderedBillboards.push(this.createBillboard(a,l))},i.BillboardGroup.prototype.addBillboards=function(a,l){for(var E=0;E<a.length;E++)this.addBillboard(a[E],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=B(l,P);this.startDrawing(function(){p.remove(),C.destroy(),v.setVisible(!1)});var E=this,d=this._scene;d.primitives;var v=this._tooltip,p=new i.BillboardGroup(this,l),C=new f.ScreenSpaceEventHandler(d.canvas);C.setInputAction(function(y){if(y.position!=null){var S=d.camera.pickEllipsoid(y.position,e);S&&(p.addBillboard(S),E.stopDrawing(),l.callback(S))}},f.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(y){var S=y.endPosition;if(S!=null){var L=d.camera.pickEllipsoid(S,e);L?v.showAt(S,"<p>Click to add your marker. Position is: </p>"+K(e.cartesianToCartographic(L))):v.showAt(S,"<p>Click on the globe to add your marker.</p>")}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingPolygon=function(l){var l=B(l,o);this.startDrawingPolyshape(!0,l)},i.prototype.startDrawingPolyline=function(l){var l=B(l,b);this.startDrawingPolyshape(!1,l)},i.prototype.startDrawingPolyshape=function(a,l){this.startDrawing(function(){v.remove(y),L.remove(),M.destroy(),p.setVisible(!1),G(d)});var E=this,d=this._scene,v=d.primitives,p=this._tooltip,C=a?3:2,y;a?y=new ye.PolygonPrimitive(l):y=new ye.PolylinePrimitive(l),y.asynchronous=!1,v.add(y);var S=[],L=new i.BillboardGroup(this,P),M=new f.ScreenSpaceEventHandler(d.canvas);Z(d),M.setInputAction(function(_){if(_.position!=null){var A=d.camera.pickEllipsoid(_.position,e);A&&(S.length==0&&(S.push(A.clone()),L.addBillboard(S[0])),S.length>=C&&(y.positions=S,y._createPrimitive=!0),S.push(A),L.addBillboard(A))}},f.ScreenSpaceEventType.LEFT_CLICK),M.setInputAction(function(_){var A=_.endPosition;if(A!=null)if(S.length==0)p.showAt(A,"<p>Click to add first point</p>");else{var I=d.camera.pickEllipsoid(A,e);I&&(S.pop(),I.y+=1+Math.random(),S.push(I),S.length>=C&&(y.positions=S,y._createPrimitive=!0),L.getBillboard(S.length-1).position=I,p.showAt(A,"<p>Click to add new point ("+S.length+")</p>"+(S.length>C?"<p>Double click to finish drawing</p>":"")))}},f.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(_){var A=_.position;if(A!=null){if(S.length<C+2)return;var I=d.camera.pickEllipsoid(A,e);I&&(G(d),E.stopDrawing(),typeof l.callback=="function"&&(S.length-1,l.callback(S)))}},f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function X(a){return e.cartographicArrayToCartesianArray([f.Rectangle.northwest(a),f.Rectangle.northeast(a),f.Rectangle.southeast(a),f.Rectangle.southwest(a)])}function Z(a){a&&(a.canvas.style.cursor="crosshair")}function G(a){a&&(a.canvas.style.cursor="")}i.prototype.startDrawingExtent=function(l){var l=B(l,o);this.startDrawing(function(){y!=null&&v.remove(y),S!=null&&S.remove(),L.destroy(),p.setVisible(!1),G(d)});var E=this,d=this._scene,v=this._scene.primitives,p=this._tooltip,C=null,y=null,S=null,L=new f.ScreenSpaceEventHandler(d.canvas);Z(d);function M(_){y==null&&(y=new ye.ExtentPrimitive({extent:_,material:l.material}),y.asynchronous=!1,v.add(y)),y.setExtent(_);var A=X(_);S==null?(S=new i.BillboardGroup(E,P),S.addBillboards(A)):S.updateBillboardsPositions(A)}L.setInputAction(function(_){if(_.position!=null){var A=d.camera.pickEllipsoid(_.position,e);if(A)if(y==null){C=e.cartesianToCartographic(A);var I=Q(C,C);M(I)}else E.stopDrawing(),typeof l.callback=="function"&&l.callback(Q(C,e.cartesianToCartographic(A)))}},f.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(_){var A=_.endPosition;if(A!=null)if(y==null)p.showAt(A,"<p>Click to start drawing rectangle</p>");else{var I=d.camera.pickEllipsoid(A,e);if(I){var j=Q(C,e.cartesianToCartographic(I));M(j),p.showAt(A,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.startDrawingCircle=function(l){var l=B(l,o);this.startDrawing(function(){C!=null&&v.remove(C),y.remove(),S.destroy(),p.setVisible(!1)});var E=this,d=this._scene,v=this._scene.primitives,p=this._tooltip,C=null,y=null,S=new f.ScreenSpaceEventHandler(d.canvas);S.setInputAction(function(L){if(L.position!=null){var M=d.camera.pickEllipsoid(L.position,e);M&&(C==null?(C=new i.CirclePrimitive({center:M,radius:0,asynchronous:!1,material:l.material}),v.add(C),y=new i.BillboardGroup(E,P),y.addBillboards([M])):(typeof l.callback=="function"&&l.callback(C.getCenter(),C.getRadius()),E.stopDrawing()))}},f.ScreenSpaceEventType.LEFT_DOWN),S.setInputAction(function(L){var M=L.endPosition;if(M!=null)if(C==null)p.showAt(M,"<p>Click to start drawing the circle</p>");else{var _=d.camera.pickEllipsoid(M,e);_&&(C.setRadius(f.Cartesian3.distance(C.getCenter(),_)),y.updateBillboardsPositions(_),p.showAt(M,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},f.ScreenSpaceEventType.MOUSE_MOVE)},i.prototype.enhancePrimitives=function(){var a=this;f.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var d=this,v=this;function p(C){a._scene.screenSpaceCameraController.enableRotate=C}$(d,"leftDown",function(C){function y(M){d.position=M,v.executeListeners({name:"drag",positions:M})}function S(M){L.destroy(),p(!0),v.executeListeners({name:"dragEnd",positions:M})}var L=new f.ScreenSpaceEventHandler(a._scene.canvas);L.setInputAction(function(M){var _=a._scene.camera.pickEllipsoid(M.endPosition,e);_?y(_):S(_)},f.ScreenSpaceEventType.MOUSE_MOVE),L.setInputAction(function(M){S(a._scene.camera.pickEllipsoid(M.position,e))},f.ScreenSpaceEventType.LEFT_UP),p(!1)}),R(d)};function l(d){a._scene,!(this._highlighted&&this._highlighted==d)&&this._editMode!==!0&&(this._highlighted=d,d?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(f.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function E(d){if(this._editMode!=d)if(a.disableAllHighlights(),d){a.setEdited(this);var v=a._scene,p=this;if(this._markers==null){let I=function(F,k){var O=F-1<0?k.length-1:F-1;O<y.countBillboards()&&(y.getBillboard(O).position=J(O)),O=F,O<y.countBillboards()&&(y.getBillboard(O).position=J(O))},j=function(){p.executeListeners({name:"onEdited",positions:p.positions})},J=function(F){var k=p.positions;return e.cartographicToCartesian(new f.EllipsoidGeodesic(e.cartesianToCartographic(k[F]),e.cartesianToCartographic(k[F<k.length-1?F+1:0])).interpolateUsingFraction(.5))};var C=new i.BillboardGroup(a,x),y=new i.BillboardGroup(a,V),S={dragHandlers:{onDrag:function(F,k){p.positions[F]=k,I(F,p.positions),p._createPrimitive=!0},onDragEnd:function(F,k){p._createPrimitive=!0,j()}},onDoubleClick:function(F){p.positions.length<4||(p.positions.splice(F,1),p._createPrimitive=!0,C.removeBillboard(F),y.removeBillboard(F),I(F,p.positions),j())},tooltip:function(){if(p.positions.length>3)return"Double click to remove this point"}};C.addBillboards(p.positions,S),this._markers=C;for(var L=[],M=0,_=p.positions.length+(this.isPolygon?0:-1);M<_;M++)L.push(J(M));var A={dragHandlers:{onDragStart:function(F,k){this.index=F+1,p.positions.splice(this.index,0,k),p._createPrimitive=!0},onDrag:function(F,k){p.positions[this.index]=k,p._createPrimitive=!0},onDragEnd:function(F,k){C.insertBillboard(this.index,k,S),y.getBillboard(this.index-1).position=J(this.index-1),y.insertBillboard(this.index,J(this.index),A),p._createPrimitive=!0,j()}},tooltip:function(){return"Drag to create a new point"}};y.addBillboards(L,A),this._editMarkers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(F){var k=v.pick(F.position);k&&k.primitive||p.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop(),y.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}ye.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this;d.isPolygon=!1,d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=E;var v=this.width;d.setHighlighted=function(p){this._editMode!==!0&&(p?(a.setHighlighted(this),this.setWidth(v*2)):this.setWidth(v))},d.getExtent=function(){return f.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},R(d),d.setEditMode(!1)}},ye.PolygonPrimitive.prototype.setEditable=function(){var d=this;d.asynchronous=!1,a._scene,a.registerEditableShape(d),d.setEditMode=E,d.setHighlighted=l,R(d),d.setEditMode(!1)},ye.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;a.registerEditableShape(d),d.asynchronous=!1,d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){if(a.setEdited(this),this._markers==null){let S=function(){d.executeListeners({name:"onEdited",extent:d.extent})};var C=new i.BillboardGroup(a,x),y={dragHandlers:{onDrag:function(L,M){var _=C.getBillboard((L+2)%4).position;d.setExtent(Q(e.cartesianToCartographic(_),e.cartesianToCartographic(M))),C.updateBillboardsPositions(X(d.extent))},onDragEnd:function(L,M){S()}},tooltip:function(){return"Drag to change the corners of this extent"}};C.addBillboards(X(d.extent),y),this._markers=C,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(L){var M=v.pick(L.position);M&&!M.isDestroyed()&&M.primitive||d.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),C.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}},i.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var C=this;if(this._markers==null){let L=function(){return f.EllipseOutlineGeometry(e,d.getCenter(),d.getSemiMajorAxis(),d.getSemiMinorAxis(),d.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},M=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),semiMajorAxis:d.getSemiMajorAxis(),semiMinorAxis:d.getSemiMinorAxis(),rotation:0})};var y=new i.BillboardGroup(a,x),S={dragHandlers:{onDrag:function(_,A){var I=f.Cartesian3.distance(d.getCenter(),A);_%2==0?d.setSemiMajorAxis(I):d.setSemiMinorAxis(I),y.updateBillboardsPositions(L())},onDragEnd:function(_,A){M()}},tooltip:function(){return"Drag to change the excentricity and radius"}};y.addBillboards(L(),S),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(_){var A=v.pick(_.position);A&&A.primitive||C.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}},i.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(d){for(var v=f.CircleOutlineGeometry.createGeometry(new f.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:d})),p=0,C,y=[];p<v.attributes.position.values.length;p+=3)C=v.attributes.position.values,y.push(new f.Cartesian3(C[p],C[p+1],C[p+2]));return y},i.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var d=this,v=a._scene;d.asynchronous=!1,a.registerEditableShape(d),d.setEditMode=function(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var C=this;if(this._markers==null){let L=function(){return C.getCircleCartesianCoordinates(f.Math.PI_OVER_TWO)},M=function(){d.executeListeners({name:"onEdited",center:d.getCenter(),radius:d.getRadius()})};var y=new i.BillboardGroup(a,x),S={dragHandlers:{onDrag:function(_,A){d.setRadius(f.Cartesian3.distance(d.getCenter(),A)),y.updateBillboardsPositions(L())},onDragEnd:function(_,A){M()}},tooltip:function(){return"Drag to change the radius"}};y.addBillboards(L(),S),this._markers=y,this._globeClickhandler=new f.ScreenSpaceEventHandler(v.canvas),this._globeClickhandler.setInputAction(function(_){var A=v.pick(_.position);A&&A.primitive||C.setEditMode(!1)},f.ScreenSpaceEventType.LEFT_CLICK),y.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},d.setHighlighted=l,R(d),d.setEditMode(!1)}}},i.DrawHelperWidget=function(){function a(l,E){if(!f.defined(E.container))throw new f.DeveloperError("Container is required");var d={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:b,polygonDrawingOptions:u,extentDrawingOptions:h,circleDrawingOptions:m};q(E,d);var v=this,p=document.createElement("DIV");p.className="toolbar",E.container.appendChild(p);function C(L,M,_,A){var I=document.createElement("DIV");I.className="button",I.title=_,p.appendChild(I),I.onclick=A;var j=document.createElement("SPAN");I.appendChild(j);var J=document.createElement("IMG");return J.src=M,j.appendChild(J),I}var y=l._scene;C("marker",E.markerIcon,"Click to start drawing a 2D marker",function(){l.startDrawingMarker({callback:function(L){v.executeListeners({name:"markerCreated",position:L})}})}),C("polyline",E.polylineIcon,"Click to start drawing a 2D polyline",function(){l.startDrawingPolyline({callback:function(L){v.executeListeners({name:"polylineCreated",positions:L})}})}),C("polygon",E.polygonIcon,"Click to start drawing a 2D polygon",function(){l.startDrawingPolygon({callback:function(L){v.executeListeners({name:"polygonCreated",positions:L})}})}),C("extent",E.extentIcon,"Click to start drawing an Extent",function(){l.startDrawingExtent({callback:function(L){v.executeListeners({name:"extentCreated",extent:L})}})}),C("circle",E.circleIcon,"Click to start drawing a Circle",function(){l.startDrawingCircle({callback:function(L,M){v.executeListeners({name:"circleCreated",center:L,radius:M})}})});var S=document.createElement("DIV");S.className="divider",p.appendChild(S),C("clear",E.clearIcon,"Remove all primitives",function(){y.primitives.removeAll()}),R(this)}return a}(),i.prototype.addToolbar=function(a,l){return l=B(l,{container:a}),new i.DrawHelperWidget(this,l)};function Q(a,l){var E=new f.Rectangle;E.west=Math.min(a.longitude,l.longitude),E.east=Math.max(a.longitude,l.longitude),E.south=Math.min(a.latitude,l.latitude),E.north=Math.max(a.latitude,l.latitude);var d=f.Math.EPSILON7;return E.east-E.west<d&&(E.east+=d*2),E.north-E.south<d&&(E.north+=d*2),E}function K(a,l){return a.longitude.toFixed(l||3)+", "+a.latitude.toFixed(l||3)}function N(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 E in a)l[E]=typeof l[E]>"u"?N(a[E],null):l[E];return l}function q(a,l){a=a||{};var E;for(E in l)a[E]===void 0&&(a[E]=N(l[E]))}function B(a,l){var E=N(a),d;for(d in l)E[d]===void 0&&(E[d]=N(l[d]));return E}function $(a,l,E){a[l]=E}function R(a){a._listeners={},a.addListener=function(l,E){return this._listeners[l]=this._listeners[l]||[],this._listeners[l].push(E),this._listeners[l].length},a.executeListeners=function(l,E){if(this._listeners[l.name]&&this._listeners[l.name].length>0)for(var d=0;d<this._listeners[l.name].length;d++)this._listeners[l.name][d](l);else E&&E(l)}}return i}();const yi=2,vi=(e,n)=>{switch(e){case re.BOX:{if(n.features.length!==yi)throw new Error(`${e} must have 2 points`);const t=U.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Te.BOTTOM_LEFT}),i=U.find(n.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Te.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 T.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`)}},Ei=e=>{const n=e.map(t=>{const i=T.Cartographic.fromCartesian(t);return[T.Math.toDegrees(i.longitude),T.Math.toDegrees(i.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},Ci=e=>{const n=et.lineString([[T.Math.toDegrees(e.west),T.Math.toDegrees(e.south)],[T.Math.toDegrees(e.east),T.Math.toDegrees(e.north)]]);return Je(Ze(n))},wi=e=>{const n=et.lineString([[e.west,e.south],[e.east,e.north]]);return Je(Ze(n)).geometry.coordinates[0].map(i=>T.Cartesian3.fromRadiansArray(i)[0])};class Si extends T.Color{}const Ti=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:i,material:s,hollow:o,outlineWidth:u}=e,h=he(),[m,w]=c.useState();c.useEffect(()=>{w(new ye(h,t,i))},[]),c.useEffect(()=>{if(m){const D=m;if(n.drawing)switch(n.type){case re.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingPolygon({callback:P=>{n.handler({primitive:P,type:re.POLYGON,geojson:Ei(P)})}});break;case re.BOX:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingExtent({callback:P=>{n.handler({primitive:P,type:re.BOX,geojson:Ci(P)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else D.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[n,m]);const b=D=>{let P=D.coordinates!==void 0?D.coordinates:vi(D.type,D.geojson);if(o!==!0)switch(D.type){case re.BOX:return r.jsx(Dt,{coordinates:P,material:s??t});case re.POLYGON:return r.jsx(At,{hierarchy:new T.PolygonHierarchy(P),material:s??t});default:return r.jsx(r.Fragment,{})}else{switch(D.type){case re.BOX:P=wi(P);break;case re.POLYGON:P=[...P,P[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(mi,{positions:P,width:u??1,material:s??t})}};return r.jsx(It,{...e,children:e.drawings.map((D,P)=>r.jsxs(Pt,{name:D.name,children:[r.jsxs(Lt,{children:[r.jsxs("h1",{children:["Drawed Entity ",D.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),b(D)]},D.id))})};class bi extends T.PolylineDashMaterialProperty{}class _i extends T.ConstantProperty{}class Mi extends T.ConstantPositionProperty{}class Pi extends T.Cartesian2{}class Li extends T.Cartesian3{}class Ai extends T.Cartographic{}class Di extends T.BoundingSphere{}class Ii extends T.Ellipsoid{}class ki extends T.GeographicTilingScheme{}class Oi extends T.Rectangle{}class xi extends T.Resource{}class Ni extends T.EllipsoidTerrainProvider{}class Bi extends T.CesiumTerrainProvider{}const Fi=T.VerticalOrigin,Hi=T.LabelStyle,Tr="",Gi=38,Vi=40,zi=13,$i=14,Wi=27,Ui=9,qi=10,ji=100,Ki=e=>{const[n,t]=c.useState(e.defaultValue??""),[i,s]=c.useState(!1),[o,u]=c.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=c.useRef(null);c.useEffect(()=>(window.addEventListener("resize",V),()=>{try{window.removeEventListener("resize",V)}catch(v){console.log('WINDOW "resize" remove listener failed',v)}}),[]),c.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),c.useEffect(()=>{const{options:v}=e,{caret:p}=o;Q(n,p,v)},[e]);const m=(v,p,C)=>{const{trigger:y,matchAny:S,regex:L}=e,M=new RegExp(L);let _=y;Array.isArray(_)||(_=new Array(y)),_.sort();const A={};Array.isArray(C)&&_.forEach(J=>{A[J]=C});const I=w(_,M);let j={};for(let J=0;J<I.length;J++){const{triggerStr:F,triggerMatch:k,triggerLength:O}=I[J];for(let W=p-1;W>=0;--W){const ae=v.substring(W,p).match(M);let ne=-1;if(O>0){const ce=k?W:W-O+1;if(ce<0||(b(F,v,ce)&&(ne=ce+O),!ae&&ne<0))break}else{if(ae&&W>0)continue;if(ne=W===0&&ae?0:W+1,p-ne===0)break}if(ne>=0){const ce=A[F];if(!Array.isArray(ce))continue;const we=v.substring(ne,p),ke=ce.filter(or=>{const Ot=or.toLowerCase().indexOf(we.toLowerCase());return Ot!==-1&&(S||Ot===0)}),ir=F,rr=we.length;j={...j,trigger:ir,matchStart:ne,matchLength:rr,options:ke}}}}return j},w=(v,p)=>v.map(y=>({triggerStr:y,triggerMatch:y.match(p),triggerLength:y.length})),b=(v,p,C)=>!v||!v.length||p.substr(C,v.length)===v,D=v=>{const{onChange:p,options:C,spaceRemovers:y,spacer:S,value:L}=e,M=n,_=v.target.value,A=Qe(P(v.target)).end;if(_.length||G({...o,helperVisible:!1}),t(_),G({...o,caret:A,value:v.target.value}),!_.length||!A)return p(v.target.value);if(i&&y.length&&_.length>2&&S.length){for(let I=0;I<Math.max(M.length,_.length);++I)if(M[I]!==_[I]){if(I>=2&&_[I-1]===S&&y.indexOf(_[I-2])===-1&&y.indexOf(_[I])!==-1&&!U.isEmpty(m(_.substring(0,I-2),A-3,C))){const j=`${_.slice(0,I-1)}${_.slice(I,I+1)}${_.slice(I-1,I)}${_.slice(I+1)}`;return Z(I+1),h.current!==null&&(h.current.value=j),L||G({...o,value:j}),p(j)}break}s(!1)}return Q(_,A,C),p(v.target.value)},P=v=>{if(v!==void 0)if(v.children.length>0){const p=v.getElementsByTagName("textarea");if(p.length>0)return p[0];const C=v.getElementsByTagName("input");if(C.length>0)return C[0]}else return v},x=v=>{const{helperVisible:p,options:C,selection:y}=o,{onKeyDown:S,passThroughEnter:L}=e;if(p)switch(v.keyCode){case Wi:v.preventDefault(),K();break;case Gi:v.preventDefault(),G({...o,selection:(C.length+y-1)%C.length});break;case Vi:v.preventDefault(),G({...o,selection:(y+1)%C.length});break;case $i:case zi:L||v.preventDefault(),X(y);break;case Ui:X(y);break;default:S(v);break}else S(v)},V=()=>{G({...o,helperVisible:!1})},X=v=>{const{spacer:p,onSelect:C,changeOnSelect:y}=e,{matchStart:S,matchLength:L,options:M,trigger:_}=o,A=M[v],I=n,j=I.substring(0,S-_.length),J=I.substring(S+L),F={target:h.current},k=y(_,A);F.target!==null&&(F.target.value=`${j}${k}${p}${J}`),D(F),F.target!==null&&C(F.target.value),K(),Z(j.length+k.length+1),s(!0)},Z=v=>{G({...o,caret:v});const p=P(h.current);Qe.setCaretPosition(p,v)},G=v=>{setTimeout(()=>{u({...v})},0)},Q=(v,p,C)=>{const y=h.current;if(h.current===null)return;const S=P(y);if(S===void 0)return;const L=y.getBoundingClientRect(),M=m(v,p,C);if(Object.keys(M).length>0&&S!==null){const _=jt(S,p),A=S.getBoundingClientRect(),{minChars:I,onRequestOptions:j,requestOnlyIfNoOptions:J,mode:F}=e;let k,O,W,fe="unset";F==="assist"?(k=y===S?_.top+S.offsetTop:_.top+L.top,O=Math.min(_.left+S.offsetLeft-qi,S.offsetLeft+A.width-ji)):(k=L.top+y.offsetHeight,O=y.offsetLeft,W=y.offsetLeft-y.offsetWidth,fe=`${L.width}px`),M.matchLength>=I&&(M.options.length>1||M.options.length===1&&M.options[0].length!==M.matchLength)?G({...o,value:v,helperVisible:!0,top:k,left:O,right:W,width:fe,...M}):((!J||!M.options.length)&&j(v.substr(M.matchStart,M.matchLength)),K())}else K()},K=()=>{setTimeout(()=>{G({...o,helperVisible:!1,selection:0})},100)},N=()=>{const{helperVisible:v,left:p,right:C,matchStart:y,matchLength:S,options:L,selection:M,top:_,value:A,width:I}=o;if(!v)return null;const{maxOptions:j,offsetX:J,offsetY:F,direction:k}=e;if(L.length===0)return null;if(M>=L.length)return G({...o,selection:0}),null;const O=j===0?L.length:j,W=L.slice(0,O).map((ae,ne)=>{const ce=ae.toLowerCase().indexOf(A.substr(y,S).toLowerCase());return r.jsxs("li",{className:ne===M?"active":void 0,onClick:()=>{X(ne)},onMouseEnter:()=>{G({...o,selection:ne})},children:[ae.slice(0,ce),r.jsx("strong",{children:ae.substr(ce,S)}),ae.slice(ce+S)]},ae)}),fe=k==="ltr"?{left:p+J}:{right:C+J};return r.jsx("ul",{className:"react-autocomplete-input",style:{...fe,top:_+F,width:I},children:W})},{Component:q,ComponentProps:B,defaultValue:$,disabled:R,onBlur:a,value:l,...E}=e,d=Object.assign({},E);return Object.keys(e).forEach(v=>{delete d[v]}),r.jsxs(r.Fragment,{children:[c.cloneElement(q,{disabled:R,onBlur:a,onChange:D,onKeyDown:x,ref:h,value:n,...d,...B}),N()]})},Yi={Component:r.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"},Xi=e=>{let n={...Yi,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),r.jsx(Ki,{...n})},Ie={formatFileModDate:(e,n)=>{const t=H.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=Yt(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()}`}},Zi={locale:le.EN,formatters:{...Ie}},Ji={locale:le.RU,formatters:{...Ie},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
2
2
  one {# файл}
3
3
  few {# файла}
4
4
  other {# файлов}
@@ -10,7 +10,7 @@
10
10
  =0 {}
11
11
  one {# скрыт}
12
12
  other {# скрыто}
13
- }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${H.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${H.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${H.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${H.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${H.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${H.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${H.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${H.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${H.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${H.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${H.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${H.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Qi={locale:ae.HE,formatters:{...Ie},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
13
+ }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${H.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${H.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${H.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${H.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${H.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${H.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${H.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${H.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${H.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${H.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${H.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${H.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Qi={locale:le.HE,formatters:{...Ie},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
14
14
  one {פריט #}
15
15
  other {# פריטים}
16
16
  }`,"chonky.toolbar.selectedFileCount":`{fileCount, plural,
@@ -21,4 +21,4 @@
21
21
  =0 {}
22
22
  one {# נסתר}
23
23
  other {# נסתרים}
24
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${H.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${H.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${H.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${H.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${H.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${H.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${H.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${H.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${H.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${H.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${H.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${H.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Ri={[ae.EN]:Zi,[ae.RU]:Ji,[ae.HE]:Qi},br="";class er extends H.FileHelper{}const tr=H.ChonkyActions,kt={listView:H.ChonkyActions.EnableListView.id,gridView:H.ChonkyActions.EnableGridView.id};H.setChonkyDefaults({iconComponent:Kt.ChonkyIconFA});const nr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=kt.listView,readOnlyMode:i=!1,locale:s,files:o,folderChain:u,onFileAction:h,...m},w)=>{const _=c.useCallback($=>null,[]);me.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 D=$=>$.replace(/([A-Z])/g,R=>"-"+R.toLowerCase()),P=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((R,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${D(a)}`,R[a]=l,R},{}):{},[e]),[x,V]=c.useState(!1),[X,Z]=c.useState(),[G,Q]=c.useState(!1),[K,N]=c.useState(),[q,B]=c.useState();return c.useEffect(()=>{e&&V(!0),Z(t),i?Q(!0):N([H.ChonkyActions.CreateFolder,H.ChonkyActions.DeleteFiles]),s!==void 0&&B(Ri[s])},[e,t,i,s]),r.jsx(se,{style:{...n,...P},children:r.jsx(H.FullFileBrowser,{ref:w,files:o??[],folderChain:u,onFileAction:$=>{typeof h=="function"&&h($)},thumbnailGenerator:_,defaultFileViewActionId:X,disableDragAndDrop:G,fileActions:K,darkMode:x,i18n:q,...m})})}));g.useMediaQuery=xt,Object.defineProperty(g,"CesiumMath",{enumerable:!0,get:()=>T.Math}),Object.defineProperty(g,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>T.sampleTerrainMostDetailed}),g.Autocomplete=Xi,g.BboxCorner=Te,g.Box=se,g.COORDINATES_MERCATOR_FRACTION_DIGITS=Me,g.COORDINATES_WGS_FRACTION_DIGITS=_e,g.Cesium3DTileset=ci,g.CesiumBoundingSphere=Di,g.CesiumCartesian2=Pi,g.CesiumCartesian3=Li,g.CesiumCartographic=Ai,g.CesiumCesiumTerrainProvider=Bi,g.CesiumColor=Si,g.CesiumConstantPositionProperty=Mi,g.CesiumConstantProperty=_i,g.CesiumCustomDataSource=It,g.CesiumDrawingsDataSource=Ti,g.CesiumEllipsoid=Ii,g.CesiumEllipsoidTerrainProvider=Ni,g.CesiumEntity=Pt,g.CesiumEntityDescription=fi,g.CesiumEntityStaticDescription=Lt,g.CesiumGeographicTilingScheme=ki,g.CesiumGeojsonLayer=di,g.CesiumImageryLayer=Ce,g.CesiumLabelStyle=Hi,g.CesiumMap=ai,g.CesiumOSMLayer=pi,g.CesiumPolygonGraphics=At,g.CesiumPolylineDashMaterialProperty=bi,g.CesiumRectangle=Oi,g.CesiumRectangleGraphics=Dt,g.CesiumResource=xi,g.CesiumSceneMode=ie,g.CesiumVerticalOrigin=Fi,g.CesiumViewer=oi,g.CesiumWMSLayer=ui,g.CesiumWMTSLayer=hi,g.CesiumXYZLayer=gi,g.CssBaseline=xn,g.DateRangePicker=nn,g.DateTimePicker=rn,g.DateTimeRangePicker=nt,g.DateTimeRangePickerFormControl=Qt,g.DrawType=re,g.FileHelper=er,g.FilePicker=nr,g.FilePickerActions=tr,g.FilePickerViewObj=kt,g.MapFilterContainer=Ln,g.Popover=it,g.Proj=ue,g.ScopedCssBaseline=Nn,g.SmartTable=On,g.SupportedLocales=ae,g.TimeRangeInput=Rt,g.defaultFormatters=Ie,g.isDateRange=be,g.mapMcToMuiTheme=tt,g.useCesiumMap=he,g.useMappedMuiTheme=Be,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
24
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${H.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${H.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${H.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${H.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${H.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${H.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${H.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${H.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${H.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${H.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${H.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${H.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${H.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Ri={[le.EN]:Zi,[le.RU]:Ji,[le.HE]:Qi},br="";class er extends H.FileHelper{}const tr=H.ChonkyActions,kt={listView:H.ChonkyActions.EnableListView.id,gridView:H.ChonkyActions.EnableGridView.id};H.setChonkyDefaults({iconComponent:Kt.ChonkyIconFA});const nr=c.memo(c.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=kt.listView,readOnlyMode:i=!1,locale:s,files:o,folderChain:u,onFileAction:h,...m},w)=>{const b=c.useCallback($=>null,[]);me.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 D=$=>$.replace(/([A-Z])/g,R=>"-"+R.toLowerCase()),P=c.useMemo(()=>e!==void 0?Object.keys(e).reduce((R,a)=>{const l=e[a];return a=a.startsWith("--")?a:`--fp-theme-${D(a)}`,R[a]=l,R},{}):{},[e]),[x,V]=c.useState(!1),[X,Z]=c.useState(),[G,Q]=c.useState(!1),[K,N]=c.useState(),[q,B]=c.useState();return c.useEffect(()=>{e&&V(!0),Z(t),i?Q(!0):N([H.ChonkyActions.CreateFolder,H.ChonkyActions.DeleteFiles]),s!==void 0&&B(Ri[s])},[e,t,i,s]),r.jsx(se,{style:{...n,...P},children:r.jsx(H.FullFileBrowser,{ref:w,files:o??[],folderChain:u,onFileAction:$=>{typeof h=="function"&&h($)},thumbnailGenerator:b,defaultFileViewActionId:X,disableDragAndDrop:G,fileActions:K,darkMode:x,i18n:q,...m})})}));g.useMediaQuery=xt,Object.defineProperty(g,"CesiumMath",{enumerable:!0,get:()=>T.Math}),Object.defineProperty(g,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>T.sampleTerrainMostDetailed}),g.Autocomplete=Xi,g.BboxCorner=Te,g.Box=se,g.COORDINATES_MERCATOR_FRACTION_DIGITS=Me,g.COORDINATES_WGS_FRACTION_DIGITS=_e,g.Cesium3DTileset=ci,g.CesiumBoundingSphere=Di,g.CesiumCartesian2=Pi,g.CesiumCartesian3=Li,g.CesiumCartographic=Ai,g.CesiumCesiumTerrainProvider=Bi,g.CesiumColor=Si,g.CesiumConstantPositionProperty=Mi,g.CesiumConstantProperty=_i,g.CesiumCustomDataSource=It,g.CesiumDrawingsDataSource=Ti,g.CesiumEllipsoid=Ii,g.CesiumEllipsoidTerrainProvider=Ni,g.CesiumEntity=Pt,g.CesiumEntityDescription=fi,g.CesiumEntityStaticDescription=Lt,g.CesiumGeographicTilingScheme=ki,g.CesiumGeojsonLayer=di,g.CesiumImageryLayer=Ce,g.CesiumLabelStyle=Hi,g.CesiumMap=ai,g.CesiumOSMLayer=pi,g.CesiumPolygonGraphics=At,g.CesiumPolylineDashMaterialProperty=bi,g.CesiumRectangle=Oi,g.CesiumRectangleGraphics=Dt,g.CesiumResource=xi,g.CesiumSceneMode=ie,g.CesiumVerticalOrigin=Fi,g.CesiumViewer=oi,g.CesiumWMSLayer=ui,g.CesiumWMTSLayer=hi,g.CesiumXYZLayer=gi,g.CssBaseline=xn,g.DateRangePicker=nn,g.DateTimePicker=rn,g.DateTimeRangePicker=nt,g.DateTimeRangePickerFormControl=Qt,g.DrawType=re,g.FileHelper=er,g.FilePicker=nr,g.FilePickerActions=tr,g.FilePickerViewObj=kt,g.MapFilterContainer=Ln,g.Popover=it,g.Proj=ue,g.ScopedCssBaseline=Nn,g.SmartTable=On,g.SupportedLocales=le,g.TimeRangeInput=Rt,g.defaultFormatters=Ie,g.isDateRange=be,g.mapMcToMuiTheme=tt,g.useCesiumMap=he,g.useMappedMuiTheme=Be,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
@@ -50,7 +50,7 @@ declare class LayerManager {
50
50
  showAllNotBase(isShow: boolean): void;
51
51
  get(layerId: string): ICesiumImageryLayer | undefined;
52
52
  pickImageryLayers(position: CesiumCartesian2): ICesiumImageryLayer[] | undefined;
53
- findLayerByPOI(x: number, y: number): ICesiumImageryLayer[] | undefined;
53
+ findLayerByPOI(x: number, y: number, onlyShown?: boolean): ICesiumImageryLayer[] | undefined;
54
54
  addTransparentImageryProvider(): void;
55
55
  private setLegends;
56
56
  private getBaseLayersCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@map-colonies/react-components",
3
- "version": "4.1.2",
3
+ "version": "4.2.0",
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",
@@ -69,5 +69,5 @@
69
69
  "files": [
70
70
  "dist"
71
71
  ],
72
- "gitHead": "5333eef37d29894ececbee824c738b109c95cede"
72
+ "gitHead": "64310a1a782ef4c5a2f353937c68c3951c3b29ed"
73
73
  }