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