@map-colonies/react-components 4.1.0 → 4.1.2

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