@map-colonies/react-components 4.13.1 → 4.13.3

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,14 +1,14 @@
1
- (function(u,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/bbox"),require("@turf/invariant"),require("@turf/area"),require("@turf/bbox-polygon"),require("@turf/centroid"),require("@turf/helpers"),require("@turf/intersect"),require("@turf/point-to-polygon-distance"),require("@map-colonies/react-core/dist/list/styles"),require("@map-colonies/react-core/dist/textfield/styles"),require("@turf/boolean-point-in-polygon"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@map-colonies/react-core/dist/checkbox/styles"),require("p-map"),require("uuid"),require("@turf/boolean-valid"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize"),require("react-select"),require("react-circular-progressbar"),require("react-circular-progressbar/dist/styles.css"),require("react-move")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/bbox","@turf/invariant","@turf/area","@turf/bbox-polygon","@turf/centroid","@turf/helpers","@turf/intersect","@turf/point-to-polygon-distance","@map-colonies/react-core/dist/list/styles","@map-colonies/react-core/dist/textfield/styles","@turf/boolean-point-in-polygon","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@map-colonies/react-core/dist/linear-progress/styles","@map-colonies/react-core/dist/checkbox/styles","p-map","uuid","@turf/boolean-valid","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize","react-select","react-circular-progressbar","react-circular-progressbar/dist/styles.css","react-move"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u.reactComponents={},u.jsxRuntime,u.React,u.dateFns,u.locale,u.pickers,u.DateFnsUtils,u.styles,u.core,u.reactCore,u.useMediaQuery,u.DatePicker,u.datePickerHebrewLocale,u.moment,u.rewind,u.ol,null,u.coordinate,u.control,u.MousePosition,u.proj,u.layer,u.source,u.format,u.interaction,u.Draw,u.VectorTile,u.style,u.WMTSTileGrid,u.extent,u.OlTileWMS,u.OlXYZ,u.VectorTileSource,u.OlExtLegend,u.OlExtLegendCtrl,null,u.TableHead,u.utils,u.CssBaseline,u.ScopedCssBaseline,u.ReactDOM,u.resium,u.Cesium,u.lodash,u.bbox,u.invariant,u.area,u.bboxPolygon,u.centroid,u.turf,u.intersect,u.pointToPolygonDistance,null,null,u.booleanPointInPolygon,u.viewerCesiumNavigationMixin,null,null,null,u.pMap,u.uuid,u.booleanValid,u.getCaretCoordinates,u.getInputSelection,u.chonky,u.chonkyIconFontawesome,u.filesize,u.Select,u.reactCircularProgressbar,null,u.reactMove))})(this,function(u,i,a,Te,Ue,Ne,St,De,ae,J,Xn,bt,Jn,Be,Kn,Ct,os,Mt,at,lt,_t,Pt,ct,dt,Qn,Rn,er,$e,tr,It,nr,rr,ir,At,or,ss,sr,Ot,ar,lr,ut,Me,g,$,qe,cr,Dt,je,dr,kt,xt,ur,as,ls,hr,gr,cs,ds,us,ht,Nt,pr,fr,Bt,re,mr,yr,Ft,Ye,hs,vr){"use strict";var rs=Object.defineProperty;var is=(u,i,a)=>i in u?rs(u,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[i]=a;var ue=(u,i,a)=>(is(u,typeof i!="symbol"?i+"":i,a),a);function gt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Vt=gt(a),M=gt(g),Gt=gt(kt);var we=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(we||{}),Se=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(Se||{}),Ze=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Ze||{});const ge={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:Se.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:Se.EN},renderAsButton:!0,offset:0,disableFuture:!0}},Q=e=>{const{children:t,...n}=e;return i.jsx(ae.Box,{...n,children:t})},Xe=e=>{const t=e.type==="dark";return a.useMemo(()=>Ht(e,t),[t,e])},Ht=(e,t=!1)=>De.createTheme({palette:{type:t?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:t?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:t?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),Wt=e=>a.useMemo(()=>({...e,"cesium-color":"#EDFFFF","cesium-error":e["--mdc-theme-gc-error-medium"]??"#FF3636","cesium-warning":e["--mdc-theme-gc-warning-high"]??"#FFA032","cesium-checkbox-color":"#1A73E8","cesium-checkbox-width":"12px","cesium-checkbox-height":"12px","cesium-font-size":"10pt"}),[e]),gs="",Er=2,wr=.5,Lr=De.makeStyles(e=>De.createStyles({container:{padding:e.spacing(Er),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(wr)}})),zt=e=>{var Y,V,X,W;const t=Lr(),n=J.useTheme(),r=Xe(n),[s,o]=a.useState(null),[d,h]=a.useState(null),[f,v]=a.useState(ge.DATE_RANGE_PICKER.dateFormat),C=e.controlsLayout??ge.DATE_RANGE_PICKER.controlsLayout,b=e.disableFuture??ge.DATE_RANGE_PICKER.disableFuture,p=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,E=((V=e.local)==null?void 0:V.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,I=((X=e.local)==null?void 0:X.setText)??ge.DATE_RANGE_PICKER.local.setText,F=(((W=e.local)==null?void 0:W.calendarLocale)??ge.DATE_RANGE_PICKER.local.calendarLocale)===Se.HE?Ue.he:Ue.enUS;a.useEffect(()=>{o(e.from??null)},[e.from]),a.useEffect(()=>{h(e.to??null)},[e.to]),a.useEffect(()=>{v(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(Te.isValid(s)&&!d||Te.isValid(d)&&!s||s&&d&&Te.isValid(s)&&Te.isValid(d)&&Te.isBefore(s,d)),j=()=>{e.onChange({from:s&&Te.isValid(s)?s:void 0,to:d&&Te.isValid(d)?d:void 0})};return i.jsx(ae.ThemeProvider,{theme:r,children:i.jsx(Q,{className:`${t.container} drpContainer`,display:"flex",flexDirection:C,width:C==="column"?e.contentWidth:"unset",children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:St,locale:F,children:[i.jsx(Ne.KeyboardDateTimePicker,{variant:"inline",placeholder:p,onChange:Z=>o(Z),value:s,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(Ne.KeyboardDateTimePicker,{variant:"inline",placeholder:E,className:t.margin,onChange:Z=>h(Z),value:d,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(J.ThemeProvider,{options:n,children:i.jsx(J.Button,{className:`${t.setButton} ${t.margin}`,raised:!0,onClick:j,disabled:!G,children:I})})]})})})},Ut=e=>{const{children:t,...n}=e;return i.jsx(ae.Popover,{...n,children:t})},ps="",Tr=e=>{var V,X;const[t,n]=a.useState(null),[r,s]=a.useState(null),[o,d]=a.useState(ge.DATE_RANGE_PICKER.dateFormat),[h,f]=a.useState(null),v=W=>{f(W.currentTarget)},C=W=>{W.currentTarget.tagName==="I"?f(W.currentTarget.previousElementSibling):f(W.currentTarget)},b=()=>{f(null)},p=Boolean(h),E=e.controlsLayout??"column";a.useEffect(()=>{n(e.from??null)},[e.from]),a.useEffect(()=>{s(e.to??null)},[e.to]),a.useEffect(()=>{d(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const I=((V=e.local)==null?void 0:V.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,L=((X=e.local)==null?void 0:X.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,F=e.renderAsButton===void 0?ge.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?ge.DATE_RANGE_PICKER.offset:e.offset,j=e.disableFuture===void 0?ge.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=a.useMemo(()=>`${t?Te.format(t,o):I} - ${r?Te.format(r,o):L}`,[t,r,o,I,L]);return i.jsxs(i.Fragment,{children:[F?i.jsx(J.Button,{style:{width:e.width},raised:!0,onClick:v,className:"drpOpener",children:Y}):i.jsx(J.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:C,trailingIcon:{icon:"date_range",tabIndex:0,onClick:C}}),i.jsx(Ut,{open:p,anchorEl:h,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:i.jsx(zt,{controlsLayout:E,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:o,disableFuture:j,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:t??void 0,to:r??void 0,onChange:({from:W,to:Z})=>{n(W??null),s(Z??null),e.onChange({from:W,to:Z}),b()}})})]})},Je=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Sr=({endDate:e,startDate:t,setEndDate:n=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:d="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:f="",startTimeLabel:v="",startTimeWrapperClassName:C=""})=>i.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[i.jsx("div",{className:`startTimeWrapper ${C}`,children:i.jsx(J.TextField,{label:v,disabled:t===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Be(t).format("HH:mm"),onChange:b=>{const p=Be(t),E=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:E.get("hours"),minutes:E.get("minutes")});r(I.toDate())}})}),i.jsx("div",{className:`endTimeWrapper ${d}`,children:i.jsx(J.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Be(e).format("HH:mm"),onChange:b=>{const p=Be(e),E=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:E.get("hours"),minutes:E.get("minutes")});n(I.toDate())}})})]}),br=a.forwardRef(({value:e,onClick:t,onInputClick:n,...r},s)=>i.jsx(J.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{t==null||t(o),n==null||n()},ref:s,value:e})),Cr=({setStartDate:e=()=>{},setEndDate:t=()=>{},shortcuts:n,dateRange:r,onShortcut:s})=>{const[o,d]=a.useState(),h=a.useMemo(()=>n.map(f=>f instanceof Function?f():f),[n]);return a.useEffect(()=>{for(const f of h){const v=r.startDate&&r.endDate&&Te.isSameDay(f.startDate,r.startDate)&&Te.isSameDay(f.endDate,r.endDate);o?f.id===o&&(v||d(void 0)):v&&d(f.id)}},[r,o,h]),i.jsx("div",{className:"shortcutsContainer",children:h.map((f,v)=>{const C=()=>{e(f.startDate),t(f.endDate)};return i.jsx(J.Button,{type:"button",className:`shortcut ${o===f.id?"selected":""}`,onClick:b=>{C(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+v)})})},Mr=a.forwardRef((e,t)=>{const{calendarClassName:n,dayClassName:r,monthClassName:s,selectsRange:o,onChange:d,inputName:h,showMonthYearDropdown:f,withShortcuts:v,locale:C="en"}=e,[b,p]=a.useState(null),[E,I]=a.useState(null),[L,F]=a.useState(!1),G=o?{startDate:b,endDate:E}:b;a.useEffect(()=>{C==="he"&&bt.registerLocale("he",Jn)},[C]),a.useEffect(()=>{var V,X;((V=e.startDate)==null?void 0:V.toString())!==(b==null?void 0:b.toString())&&p(e.startDate),((X=e.endDate)==null?void 0:X.toString())!==(E==null?void 0:E.toString())&&I(e.endDate)},[e.startDate,e.endDate,b,E]);const j=a.useMemo(()=>{let V="pickerContainer"+(C==="he"?" pickerContainer-rtl":"");return v&&o&&(V+=" pickerContainer-withShortcuts"),V},[C,v,o]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return i.jsx("div",{className:j,style:{direction:C==="he"?"rtl":"ltr"},children:i.jsx(bt,{...e,ref:t,onClickOutside:()=>F(!1),open:L,startDate:Je(G)?b:void 0,selected:b,endDate:Je(G)?E:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${n}`,weekDayClassName:V=>`pickerWeek ${(r==null?void 0:r(V))??""}`,dayClassName:V=>`pickerDay ${(r==null?void 0:r(V))??""}`,monthClassName:V=>`pickerMonth ${(s==null?void 0:s(V))??""}`,onChange:(V,X)=>{if(Array.isArray(V)){const[W,Z]=V;p(W),I(Z),d==null||d({startDate:W,endDate:Z&&Te.endOfDay(Z)},X)}else p(V),d==null||d(V,X)},customInput:i.jsx(br,{name:h,onInputClick:()=>{F(!0)}}),showTimeInput:!!(v&&o),timeInputLabel:"",customTimeInput:v&&Je(G)&&i.jsx(Cr,{onShortcut:V=>{d==null||d(V),F(!1)},shortcuts:v,setEndDate:I,setStartDate:p,dateRange:G}),showMonthYearDropdown:void 0,...Y})})}),fs="",_r=e=>{const t=J.useTheme(),n=Xe(t),{format:r=ge.DATE_PICKER.dateFormat,variant:s=ge.DATE_PICKER.variant,disableFuture:o=ge.DATE_PICKER.disableFuture,local:d,onChange:h,showTime:f=ge.DATE_PICKER.showTime,value:v,...C}=e,{placeHolderText:b=ge.DATE_PICKER.local.placeHolderText,calendarLocale:p}=d??{placeHolderText:ge.DATE_PICKER.local.placeHolderText,calendarLocale:Se.EN},E=p===Se.HE?Ue.he:Ue.enUS,I=L=>{h(L)};return i.jsx(ae.ThemeProvider,{theme:n,children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:St,locale:E,children:[f&&i.jsx(Ne.KeyboardDateTimePicker,{variant:s,placeholder:b,onChange:I,value:v,disableFuture:o,format:r,...C}),!f&&i.jsx(Ne.KeyboardDatePicker,{variant:s,placeholder:b,onChange:I,value:v,disableFuture:o,format:r,...C})]})})},Pr=18,Ir=De.makeStyles(e=>De.createStyles({drawingButton:{width:e.spacing(Pr)},fullWidth:{width:"100%",marginTop:"36px"}})),Ar=e=>{const t=Ir(),[n,r]=a.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:d,onReset:h}=e,f=C=>{r(C.currentTarget)},v=()=>{r(null)};return s?i.jsx(J.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):i.jsxs(Q,{position:"relative",children:[i.jsx(J.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),i.jsxs(J.Menu,{className:t.fullWidth,open:Boolean(n),onClose:v,children:[i.jsx(J.MenuItem,{onClick:()=>{d(we.POLYGON),v()},children:"Polygon"}),i.jsx(J.MenuItem,{onClick:()=>{d(we.BOX),v()},children:"Box"}),i.jsx(J.MenuItem,{onClick:()=>{h(),v()},children:"Clear"})]})]})},ms="";var be=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(be||{});const Ke=5,Qe=2,$t=a.createContext(null),Or=$t.Provider,qt=35,jt=32,Dr=10,kr=e=>e!==void 0&&e!==be.WGS84?_t.transform([qt,jt],be.WGS84,e):[qt,jt],xr=e=>{switch(e){case be.WEB_MERCATOR:return t=>Mt.format(t,"Mercator: {y}m, {x}m",Qe);case be.WGS84:return t=>Mt.format(t,"WGS84: {y}°N {x}°E",Ke);default:return t=>""}},ke=()=>{const e=a.useContext($t);if(e===null)throw new Error("map context is null, please check the provider");return e},Yt=e=>{const t=a.useRef(null),{allowFullScreen:n,showMousePosition:r,projection:s}=e,[o]=a.useState(new Ct.Map({view:new Ct.View({projection:s??be.WGS84}),controls:at.defaults()}));a.useEffect(()=>{o.getView().setCenter(e.center??kr(e.projection))},[o,e.center,e.projection]),a.useEffect(()=>{o.getView().setZoom(e.zoom??Dr)},[o,e.zoom,e.projection]);const d=(h,f)=>{f.getControls().forEach(C=>{C instanceof h&&f.removeControl(C)})};return a.useEffect(()=>{o.setTarget(t.current),n!==void 0&&n?o.addControl(new at.FullScreen):d(at.FullScreen,o)},[o,n]),a.useEffect(()=>{r!==void 0&&r?(d(lt,o),o.addControl(new lt({coordinateFormat:xr(s??be.WGS84),projection:s??be.WGS84,undefinedHTML:"&nbsp;"}))):d(lt,o)},[o,r,s]),i.jsxs(Or,{value:o,children:[i.jsx("div",{className:"map",ref:t}),e.children]})},Zt=a.createContext(null),Nr=Zt.Provider,Ge=()=>{const e=a.useContext(Zt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Xt=({options:e,children:t})=>{const n=ke(),[r]=a.useState(new Pt.Tile(e));return a.useEffect(()=>(n.addLayer(r),()=>{n.removeLayer(r)}),[n,r]),i.jsx(Nr,{value:r,children:t})},Jt=a.createContext(null),Br=Jt.Provider,Kt=()=>{const e=a.useContext(Jt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Qt=({children:e})=>{const t=ke(),[n]=a.useState(new Pt.Vector);return a.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),i.jsx(Br,{value:n,children:e})},Rt=a.createContext(null),Fr=Rt.Provider,en=()=>{const e=a.useContext(Rt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},tn=({children:e})=>{const t=Kt(),[n]=a.useState(new ct.Vector);return a.useEffect(()=>{t.setSource(n)},[n,t]),i.jsx(Fr,{value:n,children:e})},nn=({geometry:e,fitOptions:t,fit:n,featureStyle:r})=>{const s=en(),o=ke();return a.useLayoutEffect(()=>{const h=new dt.GeoJSON().readFeature(e);return n&&s.on("addfeature",function(){o.getView().fit(s.getExtent(),t)}),r&&h.setStyle(r),s.addFeature(h),()=>{s.removeFeature(h)}},[e,s,n]),null},rn=e=>{const t=Ge();return a.useEffect(()=>{t.setSource(new ct.OSM)},[t]),null},on=({drawType:e,onPolygonSelected:t})=>{const n=ke();return a.useEffect(()=>{const r={type:"Circle"};switch(e){case we.BOX:r.geometryFunction=Rn.createBox();break;case we.POLYGON:r.type="Polygon";break;default:return}const s=new Qn.Draw(r);n.addInteraction(s);const o=d=>{const f=new dt.GeoJSON().writeGeometryObject(d.feature.getGeometry());t==null||t(f)};return s.on("drawend",o),()=>{s.un("drawend",o),n.removeInteraction(s)}},[t,e,n]),null},ys="",Vr=e=>{const t=n=>{const r=Kn(n);e.onPolygonSelection(r)};return i.jsxs(Yt,{allowFullScreen:!0,showMousePosition:!0,children:[i.jsx(Xt,{children:i.jsx(rn,{})}),e.selectionPolygon&&i.jsx(Qt,{children:i.jsx(tn,{children:i.jsx(nn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&i.jsx(on,{drawType:e.drawType,onPolygonSelected:t})]})},pt=1.5,Gr=80,Hr=De.makeStyles(e=>De.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(pt),top:e.spacing(pt)},contentContainer:{marginTop:e.spacing(pt),width:e.spacing(Gr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Wr=e=>{var f;const[t,n]=a.useState(),[r,s]=a.useState(),o=Hr(),d=v=>{s(v),n(void 0),e.handlePolygonSelected(v)},h=()=>{s(void 0),e.handlePolygonReset()};return i.jsxs("div",{className:o.map,children:[i.jsxs("div",{className:`${o.absolute}`,children:[i.jsxs(ae.Paper,{className:o.filtersContainer,children:[i.jsx(Ar,{onCancelDraw:()=>n(void 0),onReset:h,onStartDraw:n,isSelectionEnabled:t!==void 0}),(f=e.filters)==null?void 0:f.map((v,C)=>i.jsx("div",{className:o.filtersMargin,children:v},C))]}),i.jsx(ae.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),i.jsx(Vr,{children:e.mapContent,onPolygonSelection:d,drawType:t,selectionPolygon:r})]})},sn=new $e.Fill({color:"rgba(255,255,255,0.4)"}),an=new $e.Stroke({color:"#3399CC",width:1.25}),ln=[new $e.Style({image:new $e.Circle({fill:sn,stroke:an,radius:5}),fill:sn,stroke:an})],cn=a.createContext(null),zr=cn.Provider,dn=()=>{const e=a.useContext(cn);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},Ur=({children:e,options:t,style:n})=>{const r=ke(),[s]=a.useState(new er({...t,style:n||ln}));return a.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),a.useEffect(()=>{s.setStyle(n||ln)},[s,n]),i.jsx(zr,{value:s,children:e})},ft=20,$r=256,qr=2,jr=2,Yr="REST",Zr=e=>{const t=_t.get(e.projection),n=t.getExtent(),r=new Array(ft),s=new Array(ft),o=It.getWidth(n)/$r,d=e.heightWidthRatio!==void 0?e.heightWidthRatio:jr,h=e.requestEncoding!==void 0?e.requestEncoding:Yr;for(let v=0;v<ft;++v)r[v]=o/Math.pow(qr,v)/d,s[v]=v.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:t,tileGrid:new tr({origin:It.getTopLeft(n),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:h,wrapX:e.wrapX!==void 0?e.wrapX:!0}},Xr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new ct.WMTS(n))},[t,n]),null},Jr=e=>{const{attributions:t,url:n,params:r,serverType:s,transition:o}=e;return{attributions:t,url:n,params:r,serverType:s,transition:o}},Kr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new nr(n))},[t,n]),null},Qr=e=>{const{attributions:t,url:n}=e;return{attributions:t,url:n}},Rr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new rr(n))},[t,n]),null},ei=a.createContext(null),ti=()=>{const e=a.useContext(ei);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},ni=e=>{const{url:t}=e;return{url:t,format:new dt.MVT}},ri=({children:e,options:t})=>{const n=dn();return a.useEffect(()=>{n.setSource(new ir(t))},[t,n]),null},ii=({legendItems:e,title:t,isCollapsed:n})=>{const r=ke();return a.useEffect(()=>{const s=new At({title:t??"",margin:5,maxWidth:300}),o=new or({legend:s,collapsed:n===void 0?!0:n});r.addControl(o);const d=new At({margin:4});return e.forEach(h=>{d.addItem({title:h.title,style:h.style,typeGeom:"Polygon"})}),s.addItem(d),()=>{r.removeControl(o)}},[r,e,t,n]),i.jsx(i.Fragment,{})};function oi(e){const{headCells:t,order:n,orderBy:r,onRequestSort:s,isCollapseable:o}=e,d=h=>f=>{s(f,h)};return i.jsx(sr,{children:i.jsxs(ae.TableRow,{children:[o&&i.jsx(ae.TableCell,{}),t.map(h=>i.jsx(ae.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:r===h.id?n:!1,children:i.jsx(ae.TableSortLabel,{active:r===h.id,direction:r===h.id?n:"asc",onClick:d(h.id),children:h.label})},h.id))]})})}const si=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),ai=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function li(e){const{cellsMetadata:t,isRowSelected:n,item:r,onRowSelected:s,rowIndex:o,isCollapseable:d,collapsedElement:h}=e,[f,v]=a.useState(!1),C=t.length,b=()=>{s==null||s(o)};return i.jsxs(i.Fragment,{children:[i.jsxs(ae.TableRow,{hover:!0,selected:n,onClick:b,children:[d&&i.jsx(ae.TableCell,{padding:"checkbox",children:i.jsx(ae.IconButton,{"aria-label":"expand row",size:"small",onClick:p=>{p.stopPropagation(),v(!f)},children:f?i.jsx(ai,{}):i.jsx(si,{})})}),t.map(p=>i.jsx(ae.TableCell,{align:p.numeric?"right":"left",padding:p.disablePadding?"none":"default",children:p.transform?p.transform(r[p.id]):r[p.id]},p.id+o.toString()))]}),d&&i.jsx(ae.TableRow,{children:i.jsx(ae.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:C+1,children:i.jsx(ae.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(r)})})})]})}function ci(e){const[t,n]=a.useState(""),[r,s]=a.useState("asc"),{cellsMetadata:o,items:d,onRequestSort:h,onRowSelected:f,isCollapseable:v,collapsedElement:C,isDense:b,page:p,rowsPerPage:E,count:I,handleChangePage:L,handleChangeRowsPerPage:F}=e,G=(j,Y)=>{const V=t===Y&&r==="asc";s(V?"desc":"asc"),n(Y),h(Y,V?"desc":"asc")};return i.jsxs(ae.TableContainer,{component:ae.Paper,children:[i.jsxs(ae.Table,{size:b?"small":"medium",children:[i.jsx(oi,{headCells:o,onRequestSort:G,order:r,orderBy:t,isCollapseable:v}),i.jsxs(ae.TableBody,{children:[d.map((j,Y)=>i.jsx(li,{item:j,rowIndex:Y,isCollapseable:v,cellsMetadata:o,collapsedElement:C,isRowSelected:!1,onRowSelected:f},Y)),(d.length===0||E>d.length)&&i.jsx(ae.TableRow,{style:{height:(b?33:53)*(E-d.length)},children:i.jsx(ae.TableCell,{colSpan:v?o.length+1:o.length,children:d.length===0&&i.jsx(ae.Typography,{align:"center",children:"No results :("})})})]})]}),i.jsx(ae.TablePagination,{rowsPerPage:E,rowsPerPageOptions:[5,10],component:"div",count:I,page:p,onPageChange:L,onRowsPerPageChange:F})]})}const di=e=>{const{children:t,...n}=e;return i.jsx(ar,{...n,children:t})},ui=e=>{const{children:t,...n}=e;return i.jsx(lr,{...n,children:t})},un=e=>e*Math.PI/180,Re=e=>e*(180/Math.PI),hi=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(un(85.362/2))/Math.sin(un(85.362/2))),gi=({title:e,onClick:t})=>i.jsx("div",{className:"cesium-cesiumInspector-button",onClick:t,children:e}),pi=({title:e,isVisible:t,onClick:n,children:r})=>i.jsxs(Q,{className:`cesium-cesiumInspector ${t?"cesium-cesiumInspector-visible":""}`,children:[i.jsx(gi,{title:e,onClick:n}),t&&i.jsx(Q,{className:"cesium-cesiumInspector-dropDown",children:r})]}),vs="",mt="Imagery",yt="Data",fi=({locale:e})=>{var b,p;const t=pe(),[n,r]=a.useState([{id:mt,values:[]},{id:yt,values:[]}]),[s,o]=a.useState({}),d=E=>$.get(e,E.toUpperCase())??E,h=()=>t.imageryLayers?Array.from({length:t.imageryLayers.length},(E,I)=>{var G;const L=t.imageryLayers.get(I),F=L.meta;return{id:F==null?void 0:F.id,name:$.get(F,"layerRecord.productName")??(F==null?void 0:F.id),rect:L.rectangle,isBaseMap:(G=t.layersManager)==null?void 0:G.isBaseMapLayer(F)}}):[],f=()=>{var E;return((E=t.layersManager)==null?void 0:E.dataLayerList.map(I=>{var L,F;return{id:(L=I.meta)==null?void 0:L.id,name:$.get(I.meta,"featureStructure.aliasLayerName")??I.meta.productName,rect:g.Rectangle.fromDegrees(...qe((F=I.meta)==null?void 0:F.footprint)),isBaseMap:!1}}))||[]};a.useEffect(()=>{(()=>{const I=[{id:mt,values:h()},{id:yt,values:f()}];r(I),o(I.reduce((L,F)=>({...L,[F.id]:!0}),{}))})()},[]),a.useEffect(()=>{if(!t.layersManager)return;const E=()=>{r(I=>I.map(L=>L.id===mt?{...L,values:h()}:L))};return t.layersManager.addLayerUpdatedListener(E),t.imageryLayers.layerRemoved.addEventListener(E),()=>{var I;$.get(t,"_cesiumWidget")!==void 0&&((I=t.layersManager)==null||I.removeLayerUpdatedListener(E),t.imageryLayers.layerRemoved.removeEventListener(E))}},[(b=t.layersManager)==null?void 0:b.layerList]),a.useEffect(()=>{if(!t.layersManager)return;const E=()=>{r(I=>I.map(L=>L.id===yt?{...L,values:f()}:L))};return t.layersManager.addDataLayerUpdatedListener(E),()=>{var I;(I=t.layersManager)==null||I.removeDataLayerUpdatedListener(E)}},[(p=t.layersManager)==null?void 0:p.dataLayerList]);const v=E=>{o(I=>({...I,[E]:!I[E]}))},C=E=>{t.camera.flyTo({destination:E})};return i.jsx(Q,{className:"activeLayersPanel",children:n.filter(E=>E.values.length>0).map(E=>i.jsxs(Q,{className:`cesium-cesiumInspector-section ${s[E.id]?"cesium-cesiumInspector-section-collapsed":""}`,onClick:()=>v(E.id),children:[i.jsx(J.Typography,{tag:"h3",className:"cesium-cesiumInspector-sectionHeader",children:d(E.id)}),i.jsx(Q,{className:"cesium-cesiumInspector-sectionContent",children:E.values.map(I=>i.jsxs(Q,{className:"layer",children:[i.jsx(J.Tooltip,{content:I.name,children:i.jsx(Q,{className:`name ${I.isBaseMap?"disabled":""}`,children:I.name})}),i.jsx(Q,{className:"icons",children:i.jsx(J.Tooltip,{content:$.get(e,"FLY_TO")??"Fly To",children:i.jsx(Q,{className:"icon",onClick:L=>{L.stopPropagation(),C(I.rect)},children:i.jsxs("svg",{fill:"var(--mdc-theme-cesium-color)",width:"100%",height:"100%",viewBox:"0 0 256 256",children:[i.jsx("path",{d:"M236,120H223.66406A96.15352,96.15352,0,0,0,136,32.33618V20a8,8,0,0,0-16,0V32.33618A96.15352,96.15352,0,0,0,32.33594,120H20a8,8,0,0,0,0,16H32.33594A96.15352,96.15352,0,0,0,120,223.66382V236a8,8,0,0,0,16,0V223.66382A96.15352,96.15352,0,0,0,223.66406,136H236a8,8,0,0,0,0-16Zm-40,16h11.59912A80.14164,80.14164,0,0,1,136,207.59912V196a8,8,0,0,0-16,0v11.59912A80.14164,80.14164,0,0,1,48.40088,136H60a8,8,0,0,0,0-16H48.40088A80.14164,80.14164,0,0,1,120,48.40088V60a8,8,0,0,0,16,0V48.40088A80.14164,80.14164,0,0,1,207.59912,120H196a8,8,0,0,0,0,16Z"}),i.jsx("polygon",{points:"128,80 80,170 128,150 176,170",fill:"var(--mdc-theme-cesium-color)"})]})})})})]},I.id))})]},E.id))})},mi=({locale:e})=>{const[t,n]=a.useState(!1),r=a.useMemo(()=>$.get(e,"ACTIVE_LAYERS_TITLE")??"Active Layers",[e]);return i.jsx(pi,{title:r,isVisible:t,onClick:()=>n(!t),children:i.jsx(fi,{locale:e})})},et=({onClick:e,children:t})=>i.jsx("div",{className:"cesium-toolbar-button cesium-button",onClick:e,children:t}),vt=({title:e})=>i.jsx(Q,{className:"cesium-mc-title",children:e}),Et=({isVisible:e,children:t,title:n})=>i.jsxs(Q,{className:`cesium-mc-tool ${e?"cesium-mc-tool-visible":""}`,children:[n&&i.jsx(vt,{title:n}),t]}),hn=({item:e,isSelected:t,onClick:n})=>i.jsxs(Q,{className:`cesium-baseLayerPicker-item ${t?"cesium-baseLayerPicker-selectedItem":""}`,title:e.title,onClick:n,children:[i.jsx("img",{className:"cesium-baseLayerPicker-itemIcon",src:e.thumbnail,alt:e.title}),i.jsx(Q,{className:"cesium-baseLayerPicker-itemLabel",children:e.title})]}),yi=({title:e,baseMaps:t,setCurrent:n})=>{const r=pe(),[s,o]=a.useState();a.useEffect(()=>{const h=t.maps.find(f=>f.isCurrent);h&&(o(h),n(h))},[t]);const d=h=>{var v,C;(v=r.layersManager)==null||v.removeBaseMapLayers();const f=t.maps.find(b=>b.id===h);f&&((C=r.layersManager)==null||C.setBaseMapLayers(f),o(f),n(f),t.maps.forEach(b=>{b.isCurrent=f===b}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.maps.map(h=>i.jsx(hn,{item:h,isSelected:s===h,onClick:()=>d(h.id)},h.id))})]})},vi=({title:e,terrains:t})=>{const[n,r]=a.useState(),s=pe();a.useEffect(()=>{const d=t.find(h=>h.isCurrent);d&&r(d)},[t]);const o=d=>{const h=t.find(f=>f.id===d);h&&(s.terrainProvider=h.terrainProvider??new g.EllipsoidTerrainProvider({}),r(h),t.forEach(f=>{f.isCurrent=h===f}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.map(d=>i.jsx(hn,{item:d,isSelected:n===d,onClick:()=>o(d.id)},d.id))})]})},Ei=({baseMaps:e,terrains:t,locale:n})=>{const[r,s]=a.useState(!1),[o,d]=a.useState(),h=a.useMemo(()=>$.get(n,"BASE_MAP_TITLE")??"Base Map",[n]),f=a.useMemo(()=>$.get(n,"TERRAIN_TITLE")??"Terrain",[n]);return i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>s(v=>!v),children:i.jsx("img",{className:"cesium-baseLayerPicker-selected",src:o==null?void 0:o.thumbnail,title:o==null?void 0:o.title,alt:"Current Map"})}),i.jsxs(Et,{isVisible:r,children:[e&&i.jsx(yi,{title:h,baseMaps:e,setCurrent:d}),t&&i.jsx(vi,{title:f,terrains:t})]})]})},Es="",wi=({featureTypes:e,locale:t})=>{const n=a.useMemo(()=>$.get(t,"WFS_TITLE")??"Data Layers",[t]),r=a.useMemo(()=>$.get(t,"WFS_CACHE")??"Cache",[t]),s=a.useMemo(()=>$.get(t,"WFS_EXTENT")??"Extent",[t]),o=a.useMemo(()=>$.get(t,"NO_DATA_LAYERS")??"No layers found",[t]),d=a.useMemo(()=>i.jsx(Q,{className:"title",children:n}),[n]),h=a.useMemo(()=>i.jsx(i.Fragment,{children:e.length>0?e.map((f,v)=>i.jsxs(Q,{className:"featureType",children:[i.jsx(J.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:i.jsxs(Q,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," (",String(f.zoomLevel),"):"]})}),i.jsxs(Q,{className:"info",children:[i.jsxs(Q,{children:[r,": ",f.cache??0]}),f.total>0&&i.jsxs(Q,{className:"spacer",children:[s,": ",f.items," / ",f.total]})]})]},v)):i.jsx(Q,{children:o})}),[e]);return i.jsxs(Q,{className:"wfsContainer",children:[d,h]})},Li=({locale:e})=>{var h;const[t,n]=a.useState(!1),[r,s]=a.useState([]),o=a.useMemo(()=>$.get(e,"DEBUG_PANEL_TITLE")??"Debugger Tool",[e]),d=pe();return a.useEffect(()=>{if(!d.layersManager)return;const f=(v,C)=>{var p;v.forEach(E=>{if(C!==void 0&&C!==E.meta.id)return;const{options:I,meta:L}=E,{zoomLevel:F}=I,{id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W}=L;s(Z=>{const te=Z.findIndex(l=>l.id===G);if(te>=0){if(JSON.stringify(Z[te])!==JSON.stringify({id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F})){const l=[...Z];return l[te]={id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F},l}}else return[...Z,{id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F}];return Z})});const b=new Set((p=d.layersManager)==null?void 0:p.dataLayerList.map(E=>E.meta.id));s(E=>E.filter(I=>b.has(I.id)))};return d.layersManager.addDataLayerUpdatedListener(f),()=>{var v;(v=d.layersManager)==null||v.removeDataLayerUpdatedListener(f)}},[(h=d.layersManager)==null?void 0:h.dataLayerList]),i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>n(!t),children:i.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z",fill:"orange"})})}),i.jsx(Et,{isVisible:t,title:o,children:i.jsx(wi,{featureTypes:r,locale:e})})]})};class Ti extends g.PolylineDashMaterialProperty{}class Si extends g.ConstantProperty{}class bi extends g.ConstantPositionProperty{}class Ci extends g.Cartesian2{}class Mi extends g.Cartesian3{}class gn extends g.Cartographic{}class _i extends g.BoundingSphere{}class Pi extends g.Ellipsoid{}class Ii extends g.GeographicTilingScheme{}class pn extends g.Rectangle{}class Ai extends g.Resource{}class Oi extends g.EllipsoidTerrainProvider{}class Di extends g.CesiumTerrainProvider{}class ki extends g.PolylineGraphics{}class xi extends g.JulianDate{}class Ni extends g.PositionProperty{}class Bi extends g.BillboardGraphics{}class Fi extends g.Color{}class Vi extends g.PolygonHierarchy{}class Gi extends g.Scene{}const Hi=g.VerticalOrigin,Wi=g.HorizontalOrigin,tt=g.SceneMode,zi=g.LabelStyle,Ui=g.HeightReference,_e=document.createElement("canvas"),Le=_e.getContext("2d"),fn=e=>{const r=(e==null?void 0:e.data)??[];for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1},$i=async(e,t)=>(t&&t.tileTransparencyCheckedCounter++,new Promise((n,r)=>{try{Le==null||Le.clearRect(0,0,_e.width,_e.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){_e.width=e.width,_e.height=e.height,Le==null||Le.drawImage(e,0,0);const o=Le==null?void 0:Le.getImageData(0,0,_e.width,_e.height),d=fn(o);d&&t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(d);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{_e.width=s.width,_e.height=s.height,Le==null||Le.drawImage(s,0,0);const o=Le==null?void 0:Le.getImageData(0,0,_e.width,_e.height);fn(o)?(t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(!0)):n(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),nt=(e,t)=>{const{west:n,east:r,north:s,south:o}=e,{west:d,east:h,north:f,south:v}=t;return n>=d&&r<=h&&s<=f&&o>=v},qi=(e,t)=>ur(e,je(t)),ji=e=>{const t=(g.Math.toDegrees(e.west)+g.Math.toDegrees(e.east))/2,n=(g.Math.toDegrees(e.south)+g.Math.toDegrees(e.north))/2;return kt.point([t,n])},mn=e=>[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south),g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)],yn=e=>{const t=e.scene;let r=e.camera.computeViewRectangle(t.globe.ellipsoid);if(!g.defined(r)||!r){console.error("cesium native computeViewRectangle returned invalid rectangle, fallback to custom calculation ");const s=new g.Cartesian2(0,0),o=t.camera.pickEllipsoid(s,t.globe.ellipsoid),d=new g.Cartesian2(t.canvas.width,t.canvas.height),h=t.camera.pickEllipsoid(d,t.globe.ellipsoid),f=t.globe.ellipsoid.cartesianToCartographic(o),v=t.globe.ellipsoid.cartesianToCartographic(h);r=new g.Rectangle(f.longitude,v.latitude,v.longitude,f.latitude)}return r},Yi=(e,t=100)=>{const n=e.scene,r=e.camera,s=n.mode,o=yn(e);if(!g.defined(o)||!o){console.error("customComputeViewRectangle returned invalid rectangle.");return}if(s===g.SceneMode.SCENE2D)return o;const d=r.positionCartographic;if(!g.defined(d)){console.error("Camera position is undefined in 3D mode.");return}const h=d.latitude,f=d.longitude;if(h<-g.Math.PI_OVER_TWO||h>g.Math.PI_OVER_TWO||f<-g.Math.PI||f>g.Math.PI){console.error("Invalid latitude or longitude values.");return}const v=111320,C=111320*Math.cos(h);let b=t/v,p=t/C;const E=g.Cartesian3.magnitude(r.positionWC);E>1e7&&(b=10,p=10);const I=r.frustum instanceof g.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let L=1;E<5e5?L=.05:E<2e6&&(L=.1),b*=L*(I/Math.PI),p*=L*(I/Math.PI);const F=r.pitch;if(F===void 0)return;const G=Math.PI/4,j=Math.max(0,1-Math.abs(F)/G);b*=j,p*=j;const Y=5e-4;b=Math.max(b,Y),p=Math.max(p,Y);const V=d.latitude-b,X=d.latitude+b,W=d.longitude-p,Z=d.longitude+p,te=g.Math.clamp(V,o.south,o.north),l=g.Math.clamp(X,o.south,o.north),c=g.Math.clamp(W,o.west,o.east),_=g.Math.clamp(Z,o.west,o.east),y=Math.min(1,F/g.Math.PI_OVER_TWO),S=o.north-(o.north-o.south)*y,w=Math.min(l,S);return new g.Rectangle(g.Math.negativePiToPi(c),g.Math.clamp(te,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO),g.Math.negativePiToPi(_),g.Math.clamp(w,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO))},vn=(e,t,n,r,s,o)=>{const d=e.scene.mode===g.SceneMode.SCENE2D,h=p=>{var E;if(p.polygon)return{type:"Polygon",coordinates:[((E=p.polygon.hierarchy)==null?void 0:E.getValue(g.JulianDate.now())).positions.map(F=>{const G=g.Cartographic.fromCartesian(F),j=new g.Cartographic(g.Math.toDegrees(G.longitude),g.Math.toDegrees(G.latitude),d?500:void 0);return[j.longitude,j.latitude,j.height]})]}},f=(p,E,I,L)=>{const F=g.SceneTransforms.wgs84ToWindowCoordinates(p,E);if(!F)return null;const G=F.x+I,j=F.y+L,Y=new g.Cartesian2(G,F.y),V=new g.Cartesian2(F.x,j),X=p.camera.pickEllipsoid(Y,p.globe.ellipsoid),W=p.camera.pickEllipsoid(V,p.globe.ellipsoid);if(!X||!W)return null;const Z=g.Cartesian3.distance(E,X),te=g.Cartesian3.distance(E,W);return{widthMeters:Z,heightMeters:te}},v=(p,E,I)=>{const L=g.Ellipsoid.WGS84,F=p.latitude,G=p.longitude,j=Math.PI/180*L.maximumRadius,Y=Math.PI/180*L.maximumRadius,V=I/2/j,X=E/2/Y,W=F+V,Z=F-V,te=G+X,l=G-X;return{type:"Polygon",coordinates:[[[l,W],[te,W],[te,Z],[l,Z],[l,W]]]}},C=(p,E)=>Dt(p)/Dt(E);if(!e.dataSources.getByName(t.name)[0])return;const b=[];if(t==null||t.entities.values.forEach(p=>{var E,I;if(s&&o&&d)try{const L=je(s),F=xt(h(p),L);if(F){const G=(E=p.properties)==null?void 0:E.label.getValue(g.JulianDate.now()),j=dr(F,{properties:{label:G}}),Y={width:G.width,height:G.height},[V,X,W=0]=j.geometry.coordinates,Z=g.Cartesian3.fromDegrees(V,X,W),te=f(e.scene,Z,Y.width,Y.height);if(te){const l=v({longitude:V,latitude:X},te.widthMeters,te.heightMeters),c=xt(F,{type:"Feature",properties:{},geometry:l});C(c==null?void 0:c.geometry,l)>.7&&b.push(j)}}}catch{console.log("*** Label placement failed: turf.intersect() failed ***","entity -->",p,"extent -->",s)}if(!(n.length>0&&!n.some(L=>p.id.startsWith(L)))&&(p.polygon&&(p.polygon=new g.PolygonGraphics({hierarchy:p.polygon.hierarchy,material:d?g.Color.fromCssColorString(r).withAlpha(.2):g.Color.fromCssColorString(r).withAlpha(.5),outline:!0,outlineColor:g.Color.fromCssColorString(r),outlineWidth:3,height:d?1e4:void 0,perPositionHeight:!1})),p.polyline&&(p.polyline=new g.PolylineGraphics({positions:p.polyline.positions,material:g.Color.fromCssColorString(r).withAlpha(.5),clampToGround:!0,width:4})),p.billboard)){const L=(I=p.position)==null?void 0:I.getValue(g.JulianDate.now()),F=g.Cartographic.fromCartesian(L),G=new g.Cartographic(F.longitude,F.latitude,d?500:e.scene.sampleHeight(g.Cartographic.fromCartesian(L))),j=g.Cartesian3.fromRadians(G.longitude,G.latitude,G.height),Y="#FFFF00";p.position=j,p.billboard=new g.BillboardGraphics({image:"data:image/svg+xml;base64,"+btoa(`
1
+ (function(u,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@date-io/date-fns"),require("@material-ui/pickers"),require("@material-ui/core"),require("@material-ui/core/styles"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/bbox"),require("@turf/invariant"),require("@turf/area"),require("@turf/bbox-polygon"),require("@turf/centroid"),require("@turf/helpers"),require("@turf/intersect"),require("@turf/point-to-polygon-distance"),require("@map-colonies/react-core/dist/list/styles"),require("@map-colonies/react-core/dist/textfield/styles"),require("@turf/boolean-point-in-polygon"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@map-colonies/react-core/dist/checkbox/styles"),require("p-map"),require("uuid"),require("@turf/boolean-valid"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize"),require("react-select"),require("react-circular-progressbar"),require("react-circular-progressbar/dist/styles.css"),require("react-move")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@date-io/date-fns","@material-ui/pickers","@material-ui/core","@material-ui/core/styles","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/bbox","@turf/invariant","@turf/area","@turf/bbox-polygon","@turf/centroid","@turf/helpers","@turf/intersect","@turf/point-to-polygon-distance","@map-colonies/react-core/dist/list/styles","@map-colonies/react-core/dist/textfield/styles","@turf/boolean-point-in-polygon","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@map-colonies/react-core/dist/linear-progress/styles","@map-colonies/react-core/dist/checkbox/styles","p-map","uuid","@turf/boolean-valid","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize","react-select","react-circular-progressbar","react-circular-progressbar/dist/styles.css","react-move"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u.reactComponents={},u.jsxRuntime,u.React,u.dateFns,u.locale,u.DateFnsUtils,u.pickers,u.core,u.styles,u.reactCore,u.useMediaQuery,u.DatePicker,u.datePickerHebrewLocale,u.moment,u.rewind,u.ol,null,u.coordinate,u.control,u.MousePosition,u.proj,u.layer,u.source,u.format,u.interaction,u.Draw,u.VectorTile,u.style,u.WMTSTileGrid,u.extent,u.OlTileWMS,u.OlXYZ,u.VectorTileSource,u.OlExtLegend,u.OlExtLegendCtrl,null,u.TableHead,u.utils,u.CssBaseline,u.ScopedCssBaseline,u.ReactDOM,u.resium,u.Cesium,u.lodash,u.bbox,u.invariant,u.area,u.bboxPolygon,u.centroid,u.turf,u.intersect,u.pointToPolygonDistance,null,null,u.booleanPointInPolygon,u.viewerCesiumNavigationMixin,null,null,null,u.pMap,u.uuid,u.booleanValid,u.getCaretCoordinates,u.getInputSelection,u.chonky,u.chonkyIconFontawesome,u.filesize,u.Select,u.reactCircularProgressbar,null,u.reactMove))})(this,function(u,i,a,Le,Ue,bt,Ne,ae,Oe,J,Jn,Ct,Kn,Be,Qn,Mt,ss,_t,at,lt,Pt,It,ct,dt,Rn,er,tr,$e,nr,At,rr,ir,or,Dt,sr,as,ar,Ot,lr,cr,ut,Me,g,$,qe,dr,kt,je,ur,xt,Nt,hr,ls,cs,gr,pr,ds,us,hs,ht,Bt,fr,mr,Ft,re,yr,vr,Gt,Ye,gs,Er){"use strict";var is=Object.defineProperty;var os=(u,i,a)=>i in u?is(u,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[i]=a;var ue=(u,i,a)=>(os(u,typeof i!="symbol"?i+"":i,a),a);function gt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Vt=gt(a),M=gt(g),Ht=gt(xt),Q=e=>{const{children:t,...n}=e;return i.jsx(ae.Box,{...n,children:t})};var we=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(we||{}),Se=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(Se||{}),Ze=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Ze||{});const he={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:Se.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:Se.EN},renderAsButton:!0,offset:0,disableFuture:!0,showTime:!0}},Xe=e=>{const t=e.type==="dark";return a.useMemo(()=>Wt(e,t),[t,e])},Wt=(e,t=!1)=>Oe.createTheme({palette:{type:t?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:t?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:t?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),zt=e=>a.useMemo(()=>({...e,"cesium-color":"#EDFFFF","cesium-error":e["--mdc-theme-gc-error-medium"]??"#FF3636","cesium-warning":e["--mdc-theme-gc-warning-high"]??"#FFA032","cesium-checkbox-color":"#1A73E8","cesium-checkbox-width":"12px","cesium-checkbox-height":"12px","cesium-font-size":"10pt"}),[e]),ps="",wr=2,Tr=.5,Lr=Oe.makeStyles(e=>Oe.createStyles({container:{padding:e.spacing(wr),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Tr)}})),Ut=e=>{var X,W,Z,ee;const t=Lr(),n=J.useTheme(),r=Xe(n),[s,o]=a.useState(null),[d,h]=a.useState(null),[f,E]=a.useState(he.DATE_RANGE_PICKER.dateFormat),C=e.controlsLayout??he.DATE_RANGE_PICKER.controlsLayout,b=e.disableFuture??he.DATE_RANGE_PICKER.disableFuture,p=((X=e.local)==null?void 0:X.startPlaceHolderText)??he.DATE_RANGE_PICKER.local.startPlaceHolderText,v=((W=e.local)==null?void 0:W.endPlaceHolderText)??he.DATE_RANGE_PICKER.local.endPlaceHolderText,I=((Z=e.local)==null?void 0:Z.setText)??he.DATE_RANGE_PICKER.local.setText,T=((ee=e.local)==null?void 0:ee.calendarLocale)??he.DATE_RANGE_PICKER.local.calendarLocale,F=e.showTime??he.DATE_RANGE_PICKER.showTime,V=T===Se.HE?Ue.he:Ue.enUS;a.useEffect(()=>{o(e.from??null)},[e.from]),a.useEffect(()=>{h(e.to??null)},[e.to]),a.useEffect(()=>{E(e.dateFormat??he.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const j=Boolean(Le.isValid(s)&&!d||Le.isValid(d)&&!s||s&&d&&Le.isValid(s)&&Le.isValid(d)&&Le.isBefore(s,d)),Y=()=>{e.onChange({from:s&&Le.isValid(s)?s:void 0,to:d&&Le.isValid(d)?d:void 0})},G=F?Ne.KeyboardDateTimePicker:Ne.KeyboardDatePicker;return i.jsx(ae.ThemeProvider,{theme:r,children:i.jsx(Q,{className:`${t.container} drpContainer`,display:"flex",flexDirection:C,width:C==="column"?e.contentWidth:"unset",children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:bt,locale:V,children:[i.jsx(G,{variant:"inline",placeholder:p,onChange:l=>o(l),value:s,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(G,{variant:"inline",placeholder:v,className:t.margin,onChange:l=>h(l),value:d,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(J.ThemeProvider,{options:n,children:i.jsx(J.Button,{className:`${t.setButton} ${t.margin}`,raised:!0,onClick:Y,disabled:!j,children:I})})]})})})},$t=e=>{const{children:t,...n}=e;return i.jsx(ae.Popover,{...n,children:t})},fs="",Sr=e=>{var G,X;const[t,n]=a.useState(null),[r,s]=a.useState(null),[o,d]=a.useState(he.DATE_RANGE_PICKER.dateFormat),[h,f]=a.useState(null),E=W=>{f(W.currentTarget)},C=W=>{W.currentTarget.tagName==="I"?f(W.currentTarget.previousElementSibling):f(W.currentTarget)},b=()=>{f(null)},p=Boolean(h),v=e.controlsLayout??"column";a.useEffect(()=>{n(e.from??null)},[e.from]),a.useEffect(()=>{s(e.to??null)},[e.to]),a.useEffect(()=>{d(e.dateFormat??he.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const I=((G=e.local)==null?void 0:G.startPlaceHolderText)??he.DATE_RANGE_PICKER.local.startPlaceHolderText,T=((X=e.local)==null?void 0:X.endPlaceHolderText)??he.DATE_RANGE_PICKER.local.endPlaceHolderText,F=e.renderAsButton===void 0?he.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,V=e.offset===void 0?he.DATE_RANGE_PICKER.offset:e.offset,j=e.disableFuture===void 0?he.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=a.useMemo(()=>`${t?Le.format(t,o):I} - ${r?Le.format(r,o):T}`,[t,r,o,I,T]);return i.jsxs(i.Fragment,{children:[F?i.jsx(J.Button,{style:{width:e.width},raised:!0,onClick:E,className:"drpOpener",children:Y}):i.jsx(J.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:C,trailingIcon:{icon:"date_range",tabIndex:0,onClick:C}}),i.jsx($t,{open:p,anchorEl:h,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:i.jsx(Ut,{controlsLayout:v,contentWidth:((h==null?void 0:h.clientWidth)??0)-V,dateFormat:o,disableFuture:j,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:t??void 0,to:r??void 0,onChange:({from:W,to:Z})=>{n(W??null),s(Z??null),e.onChange({from:W,to:Z}),b()}})})]})},Je=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,br=({endDate:e,startDate:t,setEndDate:n=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:d="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:f="",startTimeLabel:E="",startTimeWrapperClassName:C=""})=>i.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[i.jsx("div",{className:`startTimeWrapper ${C}`,children:i.jsx(J.TextField,{label:E,disabled:t===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Be(t).format("HH:mm"),onChange:b=>{const p=Be(t),v=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:v.get("hours"),minutes:v.get("minutes")});r(I.toDate())}})}),i.jsx("div",{className:`endTimeWrapper ${d}`,children:i.jsx(J.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Be(e).format("HH:mm"),onChange:b=>{const p=Be(e),v=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:v.get("hours"),minutes:v.get("minutes")});n(I.toDate())}})})]}),Cr=a.forwardRef(({value:e,onClick:t,onInputClick:n,...r},s)=>i.jsx(J.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{t==null||t(o),n==null||n()},ref:s,value:e})),Mr=({setStartDate:e=()=>{},setEndDate:t=()=>{},shortcuts:n,dateRange:r,onShortcut:s})=>{const[o,d]=a.useState(),h=a.useMemo(()=>n.map(f=>f instanceof Function?f():f),[n]);return a.useEffect(()=>{for(const f of h){const E=r.startDate&&r.endDate&&Le.isSameDay(f.startDate,r.startDate)&&Le.isSameDay(f.endDate,r.endDate);o?f.id===o&&(E||d(void 0)):E&&d(f.id)}},[r,o,h]),i.jsx("div",{className:"shortcutsContainer",children:h.map((f,E)=>{const C=()=>{e(f.startDate),t(f.endDate)};return i.jsx(J.Button,{type:"button",className:`shortcut ${o===f.id?"selected":""}`,onClick:b=>{C(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+E)})})},_r=a.forwardRef((e,t)=>{const{calendarClassName:n,dayClassName:r,monthClassName:s,selectsRange:o,onChange:d,inputName:h,showMonthYearDropdown:f,withShortcuts:E,locale:C="en"}=e,[b,p]=a.useState(null),[v,I]=a.useState(null),[T,F]=a.useState(!1),V=o?{startDate:b,endDate:v}:b;a.useEffect(()=>{C==="he"&&Ct.registerLocale("he",Kn)},[C]),a.useEffect(()=>{var G,X;((G=e.startDate)==null?void 0:G.toString())!==(b==null?void 0:b.toString())&&p(e.startDate),((X=e.endDate)==null?void 0:X.toString())!==(v==null?void 0:v.toString())&&I(e.endDate)},[e.startDate,e.endDate,b,v]);const j=a.useMemo(()=>{let G="pickerContainer"+(C==="he"?" pickerContainer-rtl":"");return E&&o&&(G+=" pickerContainer-withShortcuts"),G},[C,E,o]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return i.jsx("div",{className:j,style:{direction:C==="he"?"rtl":"ltr"},children:i.jsx(Ct,{...e,ref:t,onClickOutside:()=>F(!1),open:T,startDate:Je(V)?b:void 0,selected:b,endDate:Je(V)?v:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${n}`,weekDayClassName:G=>`pickerWeek ${(r==null?void 0:r(G))??""}`,dayClassName:G=>`pickerDay ${(r==null?void 0:r(G))??""}`,monthClassName:G=>`pickerMonth ${(s==null?void 0:s(G))??""}`,onChange:(G,X)=>{if(Array.isArray(G)){const[W,Z]=G;p(W),I(Z),d==null||d({startDate:W,endDate:Z&&Le.endOfDay(Z)},X)}else p(G),d==null||d(G,X)},customInput:i.jsx(Cr,{name:h,onInputClick:()=>{F(!0)}}),showTimeInput:!!(E&&o),timeInputLabel:"",customTimeInput:E&&Je(V)&&i.jsx(Mr,{onShortcut:G=>{d==null||d(G),F(!1)},shortcuts:E,setEndDate:I,setStartDate:p,dateRange:V}),showMonthYearDropdown:void 0,...Y})})}),ms="",Pr=e=>{const t=J.useTheme(),n=Xe(t),{format:r=he.DATE_PICKER.dateFormat,variant:s=he.DATE_PICKER.variant,disableFuture:o=he.DATE_PICKER.disableFuture,local:d,onChange:h,showTime:f=he.DATE_PICKER.showTime,value:E,...C}=e,{placeHolderText:b=he.DATE_PICKER.local.placeHolderText,calendarLocale:p}=d??{placeHolderText:he.DATE_PICKER.local.placeHolderText,calendarLocale:Se.EN},v=p===Se.HE?Ue.he:Ue.enUS,I=T=>{h(T)};return i.jsx(ae.ThemeProvider,{theme:n,children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:bt,locale:v,children:[f&&i.jsx(Ne.KeyboardDateTimePicker,{variant:s,placeholder:b,onChange:I,value:E,disableFuture:o,format:r,...C}),!f&&i.jsx(Ne.KeyboardDatePicker,{variant:s,placeholder:b,onChange:I,value:E,disableFuture:o,format:r,...C})]})})},Ir=18,Ar=Oe.makeStyles(e=>Oe.createStyles({drawingButton:{width:e.spacing(Ir)},fullWidth:{width:"100%",marginTop:"36px"}})),Dr=e=>{const t=Ar(),[n,r]=a.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:d,onReset:h}=e,f=C=>{r(C.currentTarget)},E=()=>{r(null)};return s?i.jsx(J.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):i.jsxs(Q,{position:"relative",children:[i.jsx(J.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),i.jsxs(J.Menu,{className:t.fullWidth,open:Boolean(n),onClose:E,children:[i.jsx(J.MenuItem,{onClick:()=>{d(we.POLYGON),E()},children:"Polygon"}),i.jsx(J.MenuItem,{onClick:()=>{d(we.BOX),E()},children:"Box"}),i.jsx(J.MenuItem,{onClick:()=>{h(),E()},children:"Clear"})]})]})},ys="";var be=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(be||{});const Ke=5,Qe=2,qt=a.createContext(null),Or=qt.Provider,jt=35,Yt=32,kr=10,xr=e=>e!==void 0&&e!==be.WGS84?Pt.transform([jt,Yt],be.WGS84,e):[jt,Yt],Nr=e=>{switch(e){case be.WEB_MERCATOR:return t=>_t.format(t,"Mercator: {y}m, {x}m",Qe);case be.WGS84:return t=>_t.format(t,"WGS84: {y}°N {x}°E",Ke);default:return t=>""}},ke=()=>{const e=a.useContext(qt);if(e===null)throw new Error("map context is null, please check the provider");return e},Zt=e=>{const t=a.useRef(null),{allowFullScreen:n,showMousePosition:r,projection:s}=e,[o]=a.useState(new Mt.Map({view:new Mt.View({projection:s??be.WGS84}),controls:at.defaults()}));a.useEffect(()=>{o.getView().setCenter(e.center??xr(e.projection))},[o,e.center,e.projection]),a.useEffect(()=>{o.getView().setZoom(e.zoom??kr)},[o,e.zoom,e.projection]);const d=(h,f)=>{f.getControls().forEach(C=>{C instanceof h&&f.removeControl(C)})};return a.useEffect(()=>{o.setTarget(t.current),n!==void 0&&n?o.addControl(new at.FullScreen):d(at.FullScreen,o)},[o,n]),a.useEffect(()=>{r!==void 0&&r?(d(lt,o),o.addControl(new lt({coordinateFormat:Nr(s??be.WGS84),projection:s??be.WGS84,undefinedHTML:"&nbsp;"}))):d(lt,o)},[o,r,s]),i.jsxs(Or,{value:o,children:[i.jsx("div",{className:"map",ref:t}),e.children]})},Xt=a.createContext(null),Br=Xt.Provider,Ve=()=>{const e=a.useContext(Xt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Jt=({options:e,children:t})=>{const n=ke(),[r]=a.useState(new It.Tile(e));return a.useEffect(()=>(n.addLayer(r),()=>{n.removeLayer(r)}),[n,r]),i.jsx(Br,{value:r,children:t})},Kt=a.createContext(null),Fr=Kt.Provider,Qt=()=>{const e=a.useContext(Kt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Rt=({children:e})=>{const t=ke(),[n]=a.useState(new It.Vector);return a.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),i.jsx(Fr,{value:n,children:e})},en=a.createContext(null),Gr=en.Provider,tn=()=>{const e=a.useContext(en);if(e===null)throw new Error("vector source context is null, please check the provider");return e},nn=({children:e})=>{const t=Qt(),[n]=a.useState(new ct.Vector);return a.useEffect(()=>{t.setSource(n)},[n,t]),i.jsx(Gr,{value:n,children:e})},rn=({geometry:e,fitOptions:t,fit:n,featureStyle:r})=>{const s=tn(),o=ke();return a.useLayoutEffect(()=>{const h=new dt.GeoJSON().readFeature(e);return n&&s.on("addfeature",function(){o.getView().fit(s.getExtent(),t)}),r&&h.setStyle(r),s.addFeature(h),()=>{s.removeFeature(h)}},[e,s,n]),null},on=e=>{const t=Ve();return a.useEffect(()=>{t.setSource(new ct.OSM)},[t]),null},sn=({drawType:e,onPolygonSelected:t})=>{const n=ke();return a.useEffect(()=>{const r={type:"Circle"};switch(e){case we.BOX:r.geometryFunction=er.createBox();break;case we.POLYGON:r.type="Polygon";break;default:return}const s=new Rn.Draw(r);n.addInteraction(s);const o=d=>{const f=new dt.GeoJSON().writeGeometryObject(d.feature.getGeometry());t==null||t(f)};return s.on("drawend",o),()=>{s.un("drawend",o),n.removeInteraction(s)}},[t,e,n]),null},vs="",Vr=e=>{const t=n=>{const r=Qn(n);e.onPolygonSelection(r)};return i.jsxs(Zt,{allowFullScreen:!0,showMousePosition:!0,children:[i.jsx(Jt,{children:i.jsx(on,{})}),e.selectionPolygon&&i.jsx(Rt,{children:i.jsx(nn,{children:i.jsx(rn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&i.jsx(sn,{drawType:e.drawType,onPolygonSelected:t})]})},pt=1.5,Hr=80,Wr=Oe.makeStyles(e=>Oe.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(pt),top:e.spacing(pt)},contentContainer:{marginTop:e.spacing(pt),width:e.spacing(Hr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),zr=e=>{var f;const[t,n]=a.useState(),[r,s]=a.useState(),o=Wr(),d=E=>{s(E),n(void 0),e.handlePolygonSelected(E)},h=()=>{s(void 0),e.handlePolygonReset()};return i.jsxs("div",{className:o.map,children:[i.jsxs("div",{className:`${o.absolute}`,children:[i.jsxs(ae.Paper,{className:o.filtersContainer,children:[i.jsx(Dr,{onCancelDraw:()=>n(void 0),onReset:h,onStartDraw:n,isSelectionEnabled:t!==void 0}),(f=e.filters)==null?void 0:f.map((E,C)=>i.jsx("div",{className:o.filtersMargin,children:E},C))]}),i.jsx(ae.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),i.jsx(Vr,{children:e.mapContent,onPolygonSelection:d,drawType:t,selectionPolygon:r})]})},an=new $e.Fill({color:"rgba(255,255,255,0.4)"}),ln=new $e.Stroke({color:"#3399CC",width:1.25}),cn=[new $e.Style({image:new $e.Circle({fill:an,stroke:ln,radius:5}),fill:an,stroke:ln})],dn=a.createContext(null),Ur=dn.Provider,un=()=>{const e=a.useContext(dn);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},$r=({children:e,options:t,style:n})=>{const r=ke(),[s]=a.useState(new tr({...t,style:n||cn}));return a.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),a.useEffect(()=>{s.setStyle(n||cn)},[s,n]),i.jsx(Ur,{value:s,children:e})},ft=20,qr=256,jr=2,Yr=2,Zr="REST",Xr=e=>{const t=Pt.get(e.projection),n=t.getExtent(),r=new Array(ft),s=new Array(ft),o=At.getWidth(n)/qr,d=e.heightWidthRatio!==void 0?e.heightWidthRatio:Yr,h=e.requestEncoding!==void 0?e.requestEncoding:Zr;for(let E=0;E<ft;++E)r[E]=o/Math.pow(jr,E)/d,s[E]=E.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:t,tileGrid:new nr({origin:At.getTopLeft(n),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:h,wrapX:e.wrapX!==void 0?e.wrapX:!0}},Jr=e=>{const t=Ve(),{options:n}=e;return a.useEffect(()=>{t.setSource(new ct.WMTS(n))},[t,n]),null},Kr=e=>{const{attributions:t,url:n,params:r,serverType:s,transition:o}=e;return{attributions:t,url:n,params:r,serverType:s,transition:o}},Qr=e=>{const t=Ve(),{options:n}=e;return a.useEffect(()=>{t.setSource(new rr(n))},[t,n]),null},Rr=e=>{const{attributions:t,url:n}=e;return{attributions:t,url:n}},ei=e=>{const t=Ve(),{options:n}=e;return a.useEffect(()=>{t.setSource(new ir(n))},[t,n]),null},ti=a.createContext(null),ni=()=>{const e=a.useContext(ti);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},ri=e=>{const{url:t}=e;return{url:t,format:new dt.MVT}},ii=({children:e,options:t})=>{const n=un();return a.useEffect(()=>{n.setSource(new or(t))},[t,n]),null},oi=({legendItems:e,title:t,isCollapsed:n})=>{const r=ke();return a.useEffect(()=>{const s=new Dt({title:t??"",margin:5,maxWidth:300}),o=new sr({legend:s,collapsed:n===void 0?!0:n});r.addControl(o);const d=new Dt({margin:4});return e.forEach(h=>{d.addItem({title:h.title,style:h.style,typeGeom:"Polygon"})}),s.addItem(d),()=>{r.removeControl(o)}},[r,e,t,n]),i.jsx(i.Fragment,{})};function si(e){const{headCells:t,order:n,orderBy:r,onRequestSort:s,isCollapseable:o}=e,d=h=>f=>{s(f,h)};return i.jsx(ar,{children:i.jsxs(ae.TableRow,{children:[o&&i.jsx(ae.TableCell,{}),t.map(h=>i.jsx(ae.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:r===h.id?n:!1,children:i.jsx(ae.TableSortLabel,{active:r===h.id,direction:r===h.id?n:"asc",onClick:d(h.id),children:h.label})},h.id))]})})}const ai=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),li=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function ci(e){const{cellsMetadata:t,isRowSelected:n,item:r,onRowSelected:s,rowIndex:o,isCollapseable:d,collapsedElement:h}=e,[f,E]=a.useState(!1),C=t.length,b=()=>{s==null||s(o)};return i.jsxs(i.Fragment,{children:[i.jsxs(ae.TableRow,{hover:!0,selected:n,onClick:b,children:[d&&i.jsx(ae.TableCell,{padding:"checkbox",children:i.jsx(ae.IconButton,{"aria-label":"expand row",size:"small",onClick:p=>{p.stopPropagation(),E(!f)},children:f?i.jsx(li,{}):i.jsx(ai,{})})}),t.map(p=>i.jsx(ae.TableCell,{align:p.numeric?"right":"left",padding:p.disablePadding?"none":"default",children:p.transform?p.transform(r[p.id]):r[p.id]},p.id+o.toString()))]}),d&&i.jsx(ae.TableRow,{children:i.jsx(ae.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:C+1,children:i.jsx(ae.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(r)})})})]})}function di(e){const[t,n]=a.useState(""),[r,s]=a.useState("asc"),{cellsMetadata:o,items:d,onRequestSort:h,onRowSelected:f,isCollapseable:E,collapsedElement:C,isDense:b,page:p,rowsPerPage:v,count:I,handleChangePage:T,handleChangeRowsPerPage:F}=e,V=(j,Y)=>{const G=t===Y&&r==="asc";s(G?"desc":"asc"),n(Y),h(Y,G?"desc":"asc")};return i.jsxs(ae.TableContainer,{component:ae.Paper,children:[i.jsxs(ae.Table,{size:b?"small":"medium",children:[i.jsx(si,{headCells:o,onRequestSort:V,order:r,orderBy:t,isCollapseable:E}),i.jsxs(ae.TableBody,{children:[d.map((j,Y)=>i.jsx(ci,{item:j,rowIndex:Y,isCollapseable:E,cellsMetadata:o,collapsedElement:C,isRowSelected:!1,onRowSelected:f},Y)),(d.length===0||v>d.length)&&i.jsx(ae.TableRow,{style:{height:(b?33:53)*(v-d.length)},children:i.jsx(ae.TableCell,{colSpan:E?o.length+1:o.length,children:d.length===0&&i.jsx(ae.Typography,{align:"center",children:"No results :("})})})]})]}),i.jsx(ae.TablePagination,{rowsPerPage:v,rowsPerPageOptions:[5,10],component:"div",count:I,page:p,onPageChange:T,onRowsPerPageChange:F})]})}const ui=e=>{const{children:t,...n}=e;return i.jsx(lr,{...n,children:t})},hi=e=>{const{children:t,...n}=e;return i.jsx(cr,{...n,children:t})},hn=e=>e*Math.PI/180,Re=e=>e*(180/Math.PI),gi=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(hn(85.362/2))/Math.sin(hn(85.362/2))),pi=({title:e,onClick:t})=>i.jsx("div",{className:"cesium-cesiumInspector-button",onClick:t,children:e}),fi=({title:e,isVisible:t,onClick:n,children:r})=>i.jsxs(Q,{className:`cesium-cesiumInspector ${t?"cesium-cesiumInspector-visible":""}`,children:[i.jsx(pi,{title:e,onClick:n}),t&&i.jsx(Q,{className:"cesium-cesiumInspector-dropDown",children:r})]}),Es="",mt="Imagery",yt="Data",mi=({locale:e})=>{var b,p;const t=pe(),[n,r]=a.useState([{id:mt,values:[]},{id:yt,values:[]}]),[s,o]=a.useState({}),d=v=>$.get(e,v.toUpperCase())??v,h=()=>t.imageryLayers?Array.from({length:t.imageryLayers.length},(v,I)=>{var V;const T=t.imageryLayers.get(I),F=T.meta;return{id:F==null?void 0:F.id,name:$.get(F,"layerRecord.productName")??(F==null?void 0:F.id),rect:T.rectangle,isBaseMap:(V=t.layersManager)==null?void 0:V.isBaseMapLayer(F)}}):[],f=()=>{var v;return((v=t.layersManager)==null?void 0:v.dataLayerList.map(I=>{var T,F;return{id:(T=I.meta)==null?void 0:T.id,name:$.get(I.meta,"featureStructure.aliasLayerName")??I.meta.productName,rect:g.Rectangle.fromDegrees(...qe((F=I.meta)==null?void 0:F.footprint)),isBaseMap:!1}}))||[]};a.useEffect(()=>{(()=>{const I=[{id:mt,values:h()},{id:yt,values:f()}];r(I),o(I.reduce((T,F)=>({...T,[F.id]:!0}),{}))})()},[]),a.useEffect(()=>{if(!t.layersManager)return;const v=()=>{r(I=>I.map(T=>T.id===mt?{...T,values:h()}:T))};return t.layersManager.addLayerUpdatedListener(v),t.imageryLayers.layerRemoved.addEventListener(v),()=>{var I;$.get(t,"_cesiumWidget")!==void 0&&((I=t.layersManager)==null||I.removeLayerUpdatedListener(v),t.imageryLayers.layerRemoved.removeEventListener(v))}},[(b=t.layersManager)==null?void 0:b.layerList]),a.useEffect(()=>{if(!t.layersManager)return;const v=()=>{r(I=>I.map(T=>T.id===yt?{...T,values:f()}:T))};return t.layersManager.addDataLayerUpdatedListener(v),()=>{var I;(I=t.layersManager)==null||I.removeDataLayerUpdatedListener(v)}},[(p=t.layersManager)==null?void 0:p.dataLayerList]);const E=v=>{o(I=>({...I,[v]:!I[v]}))},C=v=>{t.camera.flyTo({destination:v})};return i.jsx(Q,{className:"activeLayersPanel",children:n.filter(v=>v.values.length>0).map(v=>i.jsxs(Q,{className:`cesium-cesiumInspector-section ${s[v.id]?"cesium-cesiumInspector-section-collapsed":""}`,onClick:()=>E(v.id),children:[i.jsx(J.Typography,{tag:"h3",className:"cesium-cesiumInspector-sectionHeader",children:d(v.id)}),i.jsx(Q,{className:"cesium-cesiumInspector-sectionContent",children:v.values.map(I=>i.jsxs(Q,{className:"layer",children:[i.jsx(J.Tooltip,{content:I.name,children:i.jsx(Q,{className:`name ${I.isBaseMap?"disabled":""}`,children:I.name})}),i.jsx(Q,{className:"icons",children:i.jsx(J.Tooltip,{content:$.get(e,"FLY_TO")??"Fly To",children:i.jsx(Q,{className:"icon",onClick:T=>{T.stopPropagation(),C(I.rect)},children:i.jsxs("svg",{fill:"var(--mdc-theme-cesium-color)",width:"100%",height:"100%",viewBox:"0 0 256 256",children:[i.jsx("path",{d:"M236,120H223.66406A96.15352,96.15352,0,0,0,136,32.33618V20a8,8,0,0,0-16,0V32.33618A96.15352,96.15352,0,0,0,32.33594,120H20a8,8,0,0,0,0,16H32.33594A96.15352,96.15352,0,0,0,120,223.66382V236a8,8,0,0,0,16,0V223.66382A96.15352,96.15352,0,0,0,223.66406,136H236a8,8,0,0,0,0-16Zm-40,16h11.59912A80.14164,80.14164,0,0,1,136,207.59912V196a8,8,0,0,0-16,0v11.59912A80.14164,80.14164,0,0,1,48.40088,136H60a8,8,0,0,0,0-16H48.40088A80.14164,80.14164,0,0,1,120,48.40088V60a8,8,0,0,0,16,0V48.40088A80.14164,80.14164,0,0,1,207.59912,120H196a8,8,0,0,0,0,16Z"}),i.jsx("polygon",{points:"128,80 80,170 128,150 176,170",fill:"var(--mdc-theme-cesium-color)"})]})})})})]},I.id))})]},v.id))})},yi=({locale:e})=>{const[t,n]=a.useState(!1),r=a.useMemo(()=>$.get(e,"ACTIVE_LAYERS_TITLE")??"Active Layers",[e]);return i.jsx(fi,{title:r,isVisible:t,onClick:()=>n(!t),children:i.jsx(mi,{locale:e})})},et=({onClick:e,children:t})=>i.jsx("div",{className:"cesium-toolbar-button cesium-button",onClick:e,children:t}),vt=({title:e})=>i.jsx(Q,{className:"cesium-mc-title",children:e}),Et=({isVisible:e,children:t,title:n})=>i.jsxs(Q,{className:`cesium-mc-tool ${e?"cesium-mc-tool-visible":""}`,children:[n&&i.jsx(vt,{title:n}),t]}),ws="";function wt(e){return function(n){const r=a.useRef(null),[s,o]=a.useState(!1);return a.useEffect(()=>{if(!s)return;const d=h=>{const f=h.target;r.current&&!r.current.contains(f)&&o(!1)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[s]),i.jsx("div",{ref:r,className:"disappear",children:i.jsx(e,{...n,isOpen:s,setIsOpen:o})})}}const gn=({item:e,isSelected:t,onClick:n})=>i.jsxs(Q,{className:`cesium-baseLayerPicker-item ${t?"cesium-baseLayerPicker-selectedItem":""}`,title:e.title,onClick:n,children:[i.jsx("img",{className:"cesium-baseLayerPicker-itemIcon",src:e.thumbnail,alt:e.title}),i.jsx(Q,{className:"cesium-baseLayerPicker-itemLabel",children:e.title})]}),vi=({title:e,baseMaps:t,setCurrent:n})=>{const r=pe(),[s,o]=a.useState();a.useEffect(()=>{const h=t.maps.find(f=>f.isCurrent);h&&(o(h),n(h))},[t]);const d=h=>{var E,C;(E=r.layersManager)==null||E.removeBaseMapLayers();const f=t.maps.find(b=>b.id===h);f&&((C=r.layersManager)==null||C.setBaseMapLayers(f),o(f),n(f),t.maps.forEach(b=>{b.isCurrent=f===b}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.maps.map(h=>i.jsx(gn,{item:h,isSelected:s===h,onClick:()=>d(h.id)},h.id))})]})},Ei=({title:e,terrains:t})=>{const[n,r]=a.useState(),s=pe();a.useEffect(()=>{const d=t.find(h=>h.isCurrent);d&&r(d)},[t]);const o=d=>{const h=t.find(f=>f.id===d);h&&(s.terrainProvider=h.terrainProvider??new g.EllipsoidTerrainProvider({}),r(h),t.forEach(f=>{f.isCurrent=h===f}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.map(d=>i.jsx(gn,{item:d,isSelected:n===d,onClick:()=>o(d.id)},d.id))})]})},wi=wt(({baseMaps:e,terrains:t,locale:n,isOpen:r,setIsOpen:s})=>{const[o,d]=a.useState(),h=a.useMemo(()=>$.get(n,"BASE_MAP_TITLE")??"Base Map",[n]),f=a.useMemo(()=>$.get(n,"TERRAIN_TITLE")??"Terrain",[n]);return i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>s(!r),children:i.jsx("img",{className:"cesium-baseLayerPicker-selected",src:o==null?void 0:o.thumbnail,title:o==null?void 0:o.title,alt:"Current Map"})}),i.jsxs(Et,{isVisible:r,children:[e&&i.jsx(vi,{title:h,baseMaps:e,setCurrent:d}),t&&i.jsx(Ei,{title:f,terrains:t})]})]})}),Ls="",Ti=({featureTypes:e,locale:t})=>{const n=a.useMemo(()=>$.get(t,"WFS_TITLE")??"Data Layers",[t]),r=a.useMemo(()=>$.get(t,"WFS_CACHE")??"Cache",[t]),s=a.useMemo(()=>$.get(t,"WFS_EXTENT")??"Extent",[t]),o=a.useMemo(()=>$.get(t,"NO_DATA_LAYERS")??"No layers found",[t]),d=a.useMemo(()=>i.jsx(Q,{className:"title",children:n}),[n]),h=a.useMemo(()=>i.jsx(i.Fragment,{children:e.length>0?e.map((f,E)=>i.jsxs(Q,{className:"featureType",children:[i.jsx(J.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:i.jsxs(Q,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," (",String(f.zoomLevel),"):"]})}),i.jsxs(Q,{className:"info",children:[i.jsxs(Q,{children:[r,": ",f.cache??0]}),f.total>0&&i.jsxs(Q,{className:"spacer",children:[s,": ",f.items," / ",f.total]})]})]},E)):i.jsx(Q,{children:o})}),[e]);return i.jsxs(Q,{className:"wfsContainer",children:[d,h]})},Li=wt(({locale:e,isOpen:t,setIsOpen:n})=>{var h;const[r,s]=a.useState([]),o=a.useMemo(()=>$.get(e,"DEBUG_PANEL_TITLE")??"Debugger Tool",[e]),d=pe();return a.useEffect(()=>{if(!d.layersManager)return;const f=(E,C)=>{var p;E.forEach(v=>{if(C!==void 0&&C!==v.meta.id)return;const{options:I,meta:T}=v,{zoomLevel:F}=I,{id:V,items:j,total:Y,cache:G,currentZoomLevel:X,featureStructure:W}=T;s(Z=>{const ee=Z.findIndex(l=>l.id===V);if(ee>=0){if(JSON.stringify(Z[ee])!==JSON.stringify({id:V,items:j,total:Y,cache:G,currentZoomLevel:X,featureStructure:W,zoomLevel:F})){const l=[...Z];return l[ee]={id:V,items:j,total:Y,cache:G,currentZoomLevel:X,featureStructure:W,zoomLevel:F},l}}else return[...Z,{id:V,items:j,total:Y,cache:G,currentZoomLevel:X,featureStructure:W,zoomLevel:F}];return Z})});const b=new Set((p=d.layersManager)==null?void 0:p.dataLayerList.map(v=>v.meta.id));s(v=>v.filter(I=>b.has(I.id)))};return d.layersManager.addDataLayerUpdatedListener(f),()=>{var E;(E=d.layersManager)==null||E.removeDataLayerUpdatedListener(f)}},[(h=d.layersManager)==null?void 0:h.dataLayerList]),i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>n(!t),children:i.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z",fill:"orange"})})}),i.jsx(Et,{isVisible:t,title:o,children:i.jsx(Ti,{featureTypes:r,locale:e})})]})});class Si extends g.PolylineDashMaterialProperty{}class bi extends g.ConstantProperty{}class Ci extends g.ConstantPositionProperty{}class Mi extends g.Cartesian2{}class _i extends g.Cartesian3{}class pn extends g.Cartographic{}class Pi extends g.BoundingSphere{}class Ii extends g.Ellipsoid{}class Ai extends g.GeographicTilingScheme{}class fn extends g.Rectangle{}class Di extends g.Resource{}class Oi extends g.EllipsoidTerrainProvider{}class ki extends g.CesiumTerrainProvider{}class xi extends g.PolylineGraphics{}class Ni extends g.JulianDate{}class Bi extends g.PositionProperty{}class Fi extends g.BillboardGraphics{}class Gi extends g.Color{}class Vi extends g.PolygonHierarchy{}class Hi extends g.Scene{}const Wi=g.VerticalOrigin,zi=g.HorizontalOrigin,tt=g.SceneMode,Ui=g.LabelStyle,$i=g.HeightReference,_e=document.createElement("canvas"),Te=_e.getContext("2d"),mn=e=>{const r=(e==null?void 0:e.data)??[];for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1},qi=async(e,t)=>(t&&t.tileTransparencyCheckedCounter++,new Promise((n,r)=>{try{Te==null||Te.clearRect(0,0,_e.width,_e.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){_e.width=e.width,_e.height=e.height,Te==null||Te.drawImage(e,0,0);const o=Te==null?void 0:Te.getImageData(0,0,_e.width,_e.height),d=mn(o);d&&t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(d);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{_e.width=s.width,_e.height=s.height,Te==null||Te.drawImage(s,0,0);const o=Te==null?void 0:Te.getImageData(0,0,_e.width,_e.height);mn(o)?(t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(!0)):n(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),nt=(e,t)=>{const{west:n,east:r,north:s,south:o}=e,{west:d,east:h,north:f,south:E}=t;return n>=d&&r<=h&&s<=f&&o>=E},ji=(e,t)=>hr(e,je(t)),Yi=e=>{const t=(g.Math.toDegrees(e.west)+g.Math.toDegrees(e.east))/2,n=(g.Math.toDegrees(e.south)+g.Math.toDegrees(e.north))/2;return xt.point([t,n])},yn=e=>[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south),g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)],vn=e=>{const t=e.scene;let r=e.camera.computeViewRectangle(t.globe.ellipsoid);if(!g.defined(r)||!r){console.error("cesium native computeViewRectangle returned invalid rectangle, fallback to custom calculation ");const s=new g.Cartesian2(0,0),o=t.camera.pickEllipsoid(s,t.globe.ellipsoid),d=new g.Cartesian2(t.canvas.width,t.canvas.height),h=t.camera.pickEllipsoid(d,t.globe.ellipsoid),f=t.globe.ellipsoid.cartesianToCartographic(o),E=t.globe.ellipsoid.cartesianToCartographic(h);r=new g.Rectangle(f.longitude,E.latitude,E.longitude,f.latitude)}return r},Zi=(e,t=100)=>{const n=e.scene,r=e.camera,s=n.mode,o=vn(e);if(!g.defined(o)||!o){console.error("customComputeViewRectangle returned invalid rectangle.");return}if(s===g.SceneMode.SCENE2D)return o;const d=r.positionCartographic;if(!g.defined(d)){console.error("Camera position is undefined in 3D mode.");return}const h=d.latitude,f=d.longitude;if(h<-g.Math.PI_OVER_TWO||h>g.Math.PI_OVER_TWO||f<-g.Math.PI||f>g.Math.PI){console.error("Invalid latitude or longitude values.");return}const E=111320,C=111320*Math.cos(h);let b=t/E,p=t/C;const v=g.Cartesian3.magnitude(r.positionWC);v>1e7&&(b=10,p=10);const I=r.frustum instanceof g.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let T=1;v<5e5?T=.05:v<2e6&&(T=.1),b*=T*(I/Math.PI),p*=T*(I/Math.PI);const F=r.pitch;if(F===void 0)return;const V=Math.PI/4,j=Math.max(0,1-Math.abs(F)/V);b*=j,p*=j;const Y=5e-4;b=Math.max(b,Y),p=Math.max(p,Y);const G=d.latitude-b,X=d.latitude+b,W=d.longitude-p,Z=d.longitude+p,ee=g.Math.clamp(G,o.south,o.north),l=g.Math.clamp(X,o.south,o.north),c=g.Math.clamp(W,o.west,o.east),_=g.Math.clamp(Z,o.west,o.east),y=Math.min(1,F/g.Math.PI_OVER_TWO),S=o.north-(o.north-o.south)*y,w=Math.min(l,S);return new g.Rectangle(g.Math.negativePiToPi(c),g.Math.clamp(ee,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO),g.Math.negativePiToPi(_),g.Math.clamp(w,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO))},En=(e,t,n,r,s,o)=>{const d=e.scene.mode===g.SceneMode.SCENE2D,h=p=>{var v;if(p.polygon)return{type:"Polygon",coordinates:[((v=p.polygon.hierarchy)==null?void 0:v.getValue(g.JulianDate.now())).positions.map(F=>{const V=g.Cartographic.fromCartesian(F),j=new g.Cartographic(g.Math.toDegrees(V.longitude),g.Math.toDegrees(V.latitude),d?500:void 0);return[j.longitude,j.latitude,j.height]})]}},f=(p,v,I,T)=>{const F=g.SceneTransforms.wgs84ToWindowCoordinates(p,v);if(!F)return null;const V=F.x+I,j=F.y+T,Y=new g.Cartesian2(V,F.y),G=new g.Cartesian2(F.x,j),X=p.camera.pickEllipsoid(Y,p.globe.ellipsoid),W=p.camera.pickEllipsoid(G,p.globe.ellipsoid);if(!X||!W)return null;const Z=g.Cartesian3.distance(v,X),ee=g.Cartesian3.distance(v,W);return{widthMeters:Z,heightMeters:ee}},E=(p,v,I)=>{const T=g.Ellipsoid.WGS84,F=p.latitude,V=p.longitude,j=Math.PI/180*T.maximumRadius,Y=Math.PI/180*T.maximumRadius,G=I/2/j,X=v/2/Y,W=F+G,Z=F-G,ee=V+X,l=V-X;return{type:"Polygon",coordinates:[[[l,W],[ee,W],[ee,Z],[l,Z],[l,W]]]}},C=(p,v)=>kt(p)/kt(v);if(!e.dataSources.getByName(t.name)[0])return;const b=[];if(t==null||t.entities.values.forEach(p=>{var v,I;if(s&&o&&d)try{const T=je(s),F=Nt(h(p),T);if(F){const V=(v=p.properties)==null?void 0:v.label.getValue(g.JulianDate.now()),j=ur(F,{properties:{label:V}}),Y={width:V.width,height:V.height},[G,X,W=0]=j.geometry.coordinates,Z=g.Cartesian3.fromDegrees(G,X,W),ee=f(e.scene,Z,Y.width,Y.height);if(ee){const l=E({longitude:G,latitude:X},ee.widthMeters,ee.heightMeters),c=Nt(F,{type:"Feature",properties:{},geometry:l});C(c==null?void 0:c.geometry,l)>.7&&b.push(j)}}}catch{console.log("*** Label placement failed: turf.intersect() failed ***","entity -->",p,"extent -->",s)}if(!(n.length>0&&!n.some(T=>p.id.startsWith(T)))&&(p.polygon&&(p.polygon=new g.PolygonGraphics({hierarchy:p.polygon.hierarchy,material:d?g.Color.fromCssColorString(r).withAlpha(.2):g.Color.fromCssColorString(r).withAlpha(.5),outline:!0,outlineColor:g.Color.fromCssColorString(r),outlineWidth:3,height:d?1e4:void 0,perPositionHeight:!1})),p.polyline&&(p.polyline=new g.PolylineGraphics({positions:p.polyline.positions,material:g.Color.fromCssColorString(r).withAlpha(.5),clampToGround:!0,width:4})),p.billboard)){const T=(I=p.position)==null?void 0:I.getValue(g.JulianDate.now()),F=g.Cartographic.fromCartesian(T),V=new g.Cartographic(F.longitude,F.latitude,d?500:e.scene.sampleHeight(g.Cartographic.fromCartesian(T))),j=g.Cartesian3.fromRadians(V.longitude,V.latitude,V.height),Y="#FFFF00";p.position=j,p.billboard=new g.BillboardGraphics({image:"data:image/svg+xml;base64,"+btoa(`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
3
3
  <circle cx="8" cy="8" r="6" fill="${r}33" stroke="${Y}80" stroke-width="2"/>
4
4
  </svg>
5
- `),verticalOrigin:g.VerticalOrigin.BOTTOM,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})}}),e.dataSources.remove(e.dataSources.getByName(`${o==null?void 0:o.dataSourcePrefix}${t.name}`)[0]),o&&d){const p=new g.GeoJsonDataSource(`${o==null?void 0:o.dataSourcePrefix}${t.name}`);e.dataSources.add(p),p.load({type:"FeatureCollection",features:b}).then(E=>{E==null||E.entities.values.forEach(I=>{var L;I.billboard=new g.BillboardGraphics({image:(L=I.properties)==null?void 0:L.label.getValue(g.JulianDate.now()).dataURL,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})})})}},Zi=.2,Xi=(e,t=Zi)=>e.width===0?(e.east=e.east+1e-4*t,e.west=e.west-1e-4*t,e.south=e.south-1e-4*t,e.north=e.north+1e-4*t,e):(e.east=e.east+e.width*t,e.west=e.west-e.width*t,e.south=e.south-e.height*t,e.north=e.north+e.height*t,e),ws="",Ji=({options:e,isOpen:t,locale:n})=>{const r=pe(),s=a.useRef(void 0),o=a.useRef(null),[d,h]=a.useState(""),[f,v]=a.useState(!1),[C,b]=a.useState(!0),[p,E]=a.useState(),[I,L]=a.useState(),F=a.useMemo(()=>$.get(n,"SHOW_FEATURE_ON_MAP")??"Show on map",[n]),G=a.useMemo(()=>$.get(n,"IN_MAP_EXTENT")??"Search in extent",[n]),j=a.useMemo(()=>$.get(n,"SEARCH_PLACEHOLDER")??"Search...",[n]),Y=a.useMemo(()=>$.get(n,"NO_RESULTS")??"No Results",[n]),V=a.useMemo(()=>r.scene.mode===g.SceneMode.SCENE2D?!1:(v(!1),!0),[r.scene.mode]),X=300,W=i.jsx("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"white",stroke:"#ccc",strokeWidth:1})}),Z=i.jsxs("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:[i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"#1976d2",stroke:"#1976d2",strokeWidth:1}),i.jsx("path",{d:"M4 8l2 2 6-6",fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]});a.useEffect(()=>{e.forEach(m=>{m.baseUrl&&m.endPoint&&!m.url&&(m.url=m.baseUrl+m.endPoint)})},[e]),a.useEffect(()=>{t&&o.current&&o.current.focus()},[t]),a.useEffect(()=>{if(!r)return;if(!s.current){const T=new g.GeoJsonDataSource("geocoderDataSource");s.current=T,r.dataSources.add(T)}const m=s.current;I&&C?(async()=>{const k={type:"FeatureCollection",features:[I]};await m.load(k),vn(r,m,[],"#01FF1F")})():m.entities.removeAll()},[r,C,I]);const te=m=>{switch(typeof m){case"object":return Array.isArray(m)?`[${m.map(T=>`'${T}'`).join(", ")}]`:JSON.stringify(m);case"boolean":case"number":case"string":return m.toString();case"undefined":return}},l=(m,T,k)=>{const N=te(k);if(N){const A=m.includes("?")?m.endsWith("?")||m.endsWith("&")?"":"&":"?";return`${m}${A}${encodeURIComponent(T)}=${encodeURIComponent(N)}`}return m},c=(m,T)=>(m&&m.forEach(k=>{T=l(T,k[0],k[1])}),T),_=a.useCallback((m,T,k,N)=>((()=>{const D=T.dynamic.queryText,B=typeof D=="string"?D:D.name,ee=typeof D=="string"?void 0:D.relatedParams;if(m=l(m,B,k),ee&&ee.forEach(ne=>{m=l(m,ne[0],ne[1])}),N){const ne=yn(r),q=T.dynamic.geoContext,R=typeof q=="string"?q:q==null?void 0:q.name;if(ne&&R){const ie=mn(ne),he={bbox:[ie[0],ie[1],ie[2],ie[3]]};m=l(m,R,he);const ve=typeof q=="string"||q==null?void 0:q.relatedParams;ve&&ve.forEach(oe=>{m=l(m,oe[0],oe[1])})}}})(),m=c(T.static,m),m),[r]),y=a.useCallback(async(m,T)=>{if(!m){E([]);return}const k=e.map(async D=>{if(D.url){const B=_(D.url,D.params,m,T);return fetch(B,{method:"GET"})}else return Promise.reject({message:"No URL provided. Please provide one"})}),N=await Promise.all(k),A=await Promise.all(N.filter(D=>D!==void 0).map(async D=>{var ee;const B=await D.json();return B.features=(ee=B.features)==null?void 0:ee.map(ne=>({...ne,properties:{...ne.properties,headers:D.headers}})),{body:B,status:D.status,url:D.url,headers:Object.fromEntries(D.headers.entries())}}));E(A)},[_,e]),S=a.useMemo(()=>$.debounce((m,T)=>{y(m,T)},X),[y]);a.useEffect(()=>()=>S.cancel(),[S]);const w=(m,T)=>{h(m),S(m,T)};a.useEffect(()=>{y(d,f)},[f]);const P=m=>{const T=cr.getType(m);let k;switch(T){case"Point":k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"var(--mdc-theme-cesium-color)",children:i.jsx("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})});break;case"LineString":k=i.jsxs("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"var(--mdc-theme-cesium-color)",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:.5,d:"M21 6h.046l-5.25 9h-.944L10 9.455V7H7v2.926L1.862 18H0v3h3v-2.926L8.138 10h1.01L14 15.545V18h3v-3h-.046l5.25-9H24V3h-3zM8 8h1v1H8zM2 20H1v-1h1zm14-3h-1v-1h1zm7-13v1h-1V4z"}),i.jsx("path",{fill:"none",d:"M0 0h24v24H0z"})]});break;default:k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"none",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M11 4 L20 14 L20 20 L4 20 L4 10 Z"})});break}return i.jsx(Q,{children:k})};return i.jsx(Q,{className:"geocoderContainer",children:i.jsxs(Q,{className:"geocoderForm",children:[i.jsx(J.TextField,{id:"geocoderTextField",className:"cesium-geocoder-input",ref:o,onChange:m=>w(m.target.value,f),placeholder:j,value:d,autoComplete:"off"}),i.jsxs(Q,{className:"search-results",children:[i.jsxs(Q,{className:"checkboxesContainer",children:[i.jsx(J.Checkbox,{className:"checkboxElement",label:F,icon:W,checkedicon:Z,checked:C,onClick:()=>{b(!C)}}),i.jsx(J.Checkbox,{className:"checkboxElement",label:i.jsx(J.Typography,{tag:"span",className:V?"disabled":"",children:G}),checked:f,icon:W,checkedicon:Z,disabled:V,onClick:()=>{v(!f)}})]}),i.jsx(Q,{className:"listsContainer",children:e.map((m,T)=>i.jsxs(J.List,{children:[i.jsx(J.Typography,{className:"bold",tag:"span",children:m.title??m.endPoint}),i.jsx(Q,{className:"listContainer",children:(()=>{var B,ee,ne,q,R,ie,he,ve;const k=(ee=(B=p==null?void 0:p[T])==null?void 0:B.body)==null?void 0:ee.features,N=(R=(q=(ne=p==null?void 0:p[T])==null?void 0:ne.body)==null?void 0:q.features)==null?void 0:R.length,A=(he=(ie=p==null?void 0:p[T])==null?void 0:ie.body)==null?void 0:he.message,D=(ve=p==null?void 0:p[T])==null?void 0:ve.status;return N?k.map((oe,fe)=>{var O,x,H,z,U;return i.jsx(J.ListItem,{className:I===oe?"mdc-ripple-upgraded--background-focused":"",onClick:()=>{var K;r.camera.flyTo({destination:Xi(pn.fromDegrees(...qe(oe.geometry)))}),L(oe),(K=m.callbackFunc)==null||K.call(m,oe,m,fe)},children:i.jsxs(Q,{className:"queryItemResult",children:[i.jsx(J.Tooltip,{content:(x=(O=oe==null?void 0:oe.properties)==null?void 0:O.names)==null?void 0:x.display,children:i.jsx(Q,{children:(U=(z=(H=oe==null?void 0:oe.properties)==null?void 0:H.names)==null?void 0:z.default)==null?void 0:U[0]})}),P(oe)]})},`feature-${fe}`)}):N===0?i.jsx(J.ListItemSecondaryText,{className:"generalListItem queryNoResults",children:Y}):A?i.jsx(J.ListItemSecondaryText,{className:`generalListItem ${D===400?"queryWarning":"queryError"}`,children:A}):i.jsx(J.ListItemSecondaryText,{className:"generalListItem"})})()})]}))})]})]})})},Ki=({options:e,locale:t})=>{const[n,r]=a.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>r(s=>!s),children:i.jsx("svg",{className:"cesium-svgPath-svg",width:"32",height:"32",fill:"var(--mdc-theme-cesium-color)",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z"})})}),i.jsx(Et,{isVisible:n,children:i.jsx(Ji,{options:e,isOpen:n,locale:t})})]})},Qi={GLOBAL:{"BM-GOOGLE_TERRAIN-XYZ_LAYER":"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}","BM-INFRARED_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?","BM-RADAR_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?","BM-VECTOR_TILES_GPS-XYZ_LAYER":"https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png","BM-VECTOR_TILES-XYZ_LAYER":"https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38","BM-WMTS_POPULATION_TILES-WMTS_LAYER":"https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/","3D_MODEL":"https://3d.ofek-air.com/3d/Jeru_Old_City_Cesium/ACT/Jeru_Old_City_Cesium_ACT.json"},"WFS Vector layer":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw",vector_geoserver:"http://geoserver-vector-dev.apps.j1lk3njp.eastus.aroapp.io/geoserver/core/ows"},"WFS Vector layer (Visual)":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw"},"WFS PP layer":{raster_pp_geoserver:"https://raster-serving-int-pp-geoserver-nginx-route-manual-integration.apps.j1lk3njp.eastus.aroapp.io/geoserver/wfs?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJkIjpbInJhc3RlciIsInJhc3RlcldtcyIsInJhc3RlckV4cG9ydCIsImRlbSIsInZlY3RvciIsIjNkIl0sImlhdCI6MTY3NDYzMjM0Niwic3ViIjoibWFwY29sb25pZXMtYXBwIiwiaXNzIjoibWFwY29sb25pZXMtdG9rZW4tY2xpIn0.D1u28gFlxf_Z1bzIiRHZonUgrdWwhZy8DtmQj15cIzaABRUrGV2n_OJlgWTuNfrao0SbUZb_s0_qUUW6Gz_zO3ET2bVx5xQjBu0CaIWdmUPDjEYr6tw-eZx8EjFFIyq3rs-Fo0daVY9cX1B2aGW_GeJir1oMnJUURhABYRoh60azzl_utee9UdhDpnr_QElNtzJZIKogngsxCWp7tI7wkTuNCBaQM7aLEcymk0ktxlWEAt1E0nGt1R-bx-HnPeeQyZlxx4UQ1nuYTijpz7N8poaCCExOFeafj9T7megv2BzTrKWgfM1eai8srSgNa3I5wKuW0EyYnGZxdbJe8aseZg"}},Pe=(e,t)=>Qi[e][t],Ri=Pe("GLOBAL","DEFAULT_TERRAIN_PROVIDER_URL");Pe("GLOBAL","TERRAIN_SRTM100"),Pe("GLOBAL","TERRAIN_COMBINED"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-INFRARED_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-RADAR_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-WMTS_POPULATION_TILES-WMTS_LAYER");const En=(e,t,n)=>{let r;if(e.scene.mode!==g.SceneMode.SCENE2D)r=e.scene.pickPosition(new g.Cartesian2(t,n));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new g.Cartesian2(t,n),s)}return g.Cartographic.fromCartesian(r)},eo=(e,t,n)=>{const r=En(e,t,n);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]}}},wn=(e,t,n)=>{try{const r=En(e,t,n);return{longitude:g.Math.toDegrees(r.longitude),latitude:g.Math.toDegrees(r.latitude)}}catch{return}},rt=3,it="hasTransparency";function wt(e,t,n,r,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(f=>{var v,C;return((v=f._imageryProvider._resource)==null?void 0:v._url)===((C=this._resource)==null?void 0:C._url)}))==null?void 0:h.meta,d=$.get(o,it)===!0;this.tileTransparencyCheckedCounter<rt&&!d&&$i(s==null?void 0:s.url,this).then(f=>{var v;(v=this.mapViewer.layersManager)==null||v.addMetaToLayer({[it]:f},C=>C._imageryProvider._resource._url===this._resource._url)})},0),e(t,n,r,s)}class Ln extends g.UrlTemplateImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}class Tn extends g.WebMapServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}class Sn extends g.WebMapTileServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}const to=1,no=-1,bn="TRANSPARENT_BASE_LAYER";class ro{constructor(t,n,r,s,o){ue(this,"mapViewer");ue(this,"legendsList");ue(this,"layerUpdated");ue(this,"dataLayerUpdated");ue(this,"layers");ue(this,"dataLayers");ue(this,"legendsExtractor");ue(this,"layerManagerFootprintMetaFieldPath");ue(this,"shouldOptimizedTileRequests");this.mapViewer=t,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=n,this.layerUpdated=new g.Event,this.dataLayerUpdated=new g.Event,this.layerManagerFootprintMetaFieldPath=s,this.shouldOptimizedTileRequests=o??!1,r&&this.addLayerUpdatedListener(r),this.shouldOptimizedTileRequests&&(this.addLayerUpdatedListener(d=>{const h=Object.keys(d);h.length===1&&h[0]===it&&(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}get dataLayerList(){return this.dataLayers}isBaseMapLayer(t){return!!$.get(t,"parentBasetMapId")}addDataLayer(t){this.dataLayers.push({...t}),this.dataLayerUpdated.raiseEvent(this.dataLayers)}addMetaToLayer(t,n){const r=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(r).then(s=>{const o=this.layers.find(n);o&&(o.meta={...o.meta??{},...t},this.setLegends(),this.layerUpdated.raiseEvent(t))})}addMetaToDataLayer(t){const n=this.findDataLayerById(t.id);n&&(n.meta={...n.meta??{},...t},this.dataLayerUpdated.raiseEvent(this.dataLayers,t.id))}setBaseMapLayers(t){t.baseRasterLayers.sort((r,s)=>r.zIndex-s.zIndex).forEach((r,s)=>{this.addRasterLayer(r,s,t.id)}),this.shouldOptimizedTileRequests&&(this.removeLayer(bn),this.addTransparentImageryProvider())}addRasterLayer(t,n,r){let s;switch(t.type){case"XYZ_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Ln(o,this.mapViewer):new g.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Tn(o,this.mapViewer):new g.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMTS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Sn(o,this.mapViewer):new g.WebMapTileServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}}s&&(s.alpha=t.opacity,s.meta={parentBasetMapId:r,...t},t.show!==void 0&&(s.show=t.show))}removeLayer(t){const n=this.findLayerById(t);n&&this.mapViewer.imageryLayers.remove(n,!0)}removeDataLayer(t){const n=this.findDataLayerById(t);if(n){const r=this.dataLayers.indexOf(n);r>-1&&this.dataLayers.splice(r,1),this.dataLayerUpdated.raiseEvent(this.dataLayers)}}removeBaseMapLayers(){this.layers.filter(n=>this.isBaseMapLayer(n.meta)).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}removeNotBaseMapLayers(){this.layers.filter(n=>!$.get(n.meta,"parentBasetMapId")).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}raise(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex;if(r)for(let o=0;o<n;o++)this.mapViewer.imageryLayers.raise(r);this.updateLayersOrder(t,s,s+n)}lower(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex,o=this.getBaseLayersCount(),d=this.mapViewer.imageryLayers.indexOf(r);if(d-n<=o&&(n=d-o),r)for(let h=0;h<n;h++)this.mapViewer.imageryLayers.lower(r);this.updateLayersOrder(t,s,s-n)}raiseToTop(t){const n=this.findLayerById(t),r=(n==null?void 0:n.meta).zIndex;n&&this.mapViewer.imageryLayers.raiseToTop(n),this.updateLayersOrder(t,r,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(t){const n=this.findLayerById(t),r=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(n);this.lower(t,s-r)}length(){return this.mapViewer.imageryLayers.length}show(t,n){const r=this.get(t);r!==void 0&&(r.show=n)}showAllNotBase(t){this.layers.filter(r=>!$.get(r.meta,"parentBasetMapId")).forEach(r=>{var s;this.show((s=r.meta)==null?void 0:s.id,t)})}get(t){const n=this.findLayerById(t),r=this.mapViewer.imageryLayers.indexOf(n);return r?this.mapViewer.imageryLayers.get(r):void 0}pickImageryLayers(t){var s;const n=this.mapViewer.camera.getPickRay(t);let r;return n&&(r=(s=this.mapViewer.imageryLayers.pickImageryLayers(n,this.mapViewer.scene))==null?void 0:s.filter(o=>!$.get(o.meta,"parentBasetMapId"))),r}findLayerByPOI(t,n,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=eo(this.mapViewer,t,n);return this.layers.filter(h=>!$.get(h.meta,"parentBasetMapId")).filter(h=>{const f=$.get(h.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?hr(s.geometry,{type:"Feature",properties:{},geometry:f})&&(r?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,f)=>{var v,C;return((v=f.meta)==null?void 0:v.zIndex)-((C=h.meta)==null?void 0:C.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const t=this.mapViewer.imageryLayers.addImageryProvider(new g.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new g.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);t.meta={id:bn,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}addLayerUpdatedListener(t){this.layerUpdated.addEventListener(t,this)}removeLayerUpdatedListener(t){this.layerUpdated.removeEventListener(t,this)}addDataLayerUpdatedListener(t){this.dataLayerUpdated.addEventListener(t,this)}removeDataLayerUpdatedListener(t){this.dataLayerUpdated.removeEventListener(t,this)}findDataLayerById(t){return this.dataLayers.find(n=>n.meta.id===t)}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(n=>!!$.get(n.meta,"parentBasetMapId")).length}findLayerById(t){return this.layers.find(n=>n.meta!==void 0?n.meta.id===t:!1)}updateLayersOrder(t,n,r){const s=n>r?to:no,o=n<r?n:r,d=n<r?r:n;this.layers.forEach(h=>{var v;if(!$.get(h.meta,"parentBasetMapId")){const C=(v=h.meta)==null?void 0:v.zIndex;h.meta.zIndex=C>=o&&C<=d&&C!==n?C+s:C===n?r:C}})}hideNonRelevantLayers(){var t,n;for(const r of this.layers)((t=r.meta)==null?void 0:t.relevantToExtent)!==r.show&&r.imageryProvider.ready&&(r.show=((n=r.meta)==null?void 0:n.relevantToExtent)??!0)}markRelevantLayersForExtent(){var t,n;try{const r=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const o=this.layers[s],d=!$.isEmpty(r)&&!$.isEmpty(o.rectangle)&&g.Rectangle.intersection(r,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((t=o.meta)==null?void 0:t.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const f=this.layers[h],v=((n=f.meta)==null?void 0:n[it])===!0;if(o!==f)if(d instanceof g.Rectangle){if(nt(r,o.rectangle))if(nt(r,f.rectangle)&&!v){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(nt(r,f.rectangle)&&!v){o.meta={...o.meta??{},relevantToExtent:!1};break}if(nt(o.rectangle,f.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:v},!v)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:d instanceof g.Rectangle})}}}catch(r){console.error(r)}}}const Ts="",io=({legend:{legendImg:e,legendDoc:t,layer:n},docText:r,imgText:s})=>{const o=a.useCallback(()=>{window.open(e,"_blank")},[e]);a.useCallback(()=>{window.open(t,"_blank")},[t]);const d=a.useCallback(()=>{const v=i.jsx(Q,{className:"layerNameContainer",children:i.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:n})});return(n??"").length>15?i.jsx(J.Tooltip,{content:n,children:v}):v},[n]),h=a.useCallback(()=>[typeof e=="string"&&i.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof t=="string"&&i.jsx("a",{className:"legendAction",href:t,target:"_blank",rel:"noreferrer",children:r})],[e,s,t,r]);return i.jsxs(Q,{className:"mapLegend",children:[d(),i.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),i.jsx(Q,{className:"legendActionsContainer",children:h()})]})},oo=({legends:e,actionsTexts:{docText:t,imgText:n},noLegendsText:r})=>{const s=a.useCallback(()=>i.jsx(Q,{className:"noLegendsContainer",children:i.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),o=a.useCallback(()=>e.length?e.map((d,h)=>i.jsx(io,{legend:d,docText:t,imgText:n},`${d.layer}_${h}`)):s(),[e]);return i.jsx(Q,{className:"mapLegendsList",children:o()})},so=({isOpen:e,toggleSidebar:t,title:n="Map Legends",noLegendsText:r="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?i.jsxs(J.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[i.jsx(J.DrawerHeader,{className:"sidebarHeaderContainer",children:i.jsx(J.DrawerTitle,{className:"sidebarTitle",children:n})}),i.jsxs(J.DrawerContent,{className:"sidebarContent",children:[i.jsx(J.Icon,{onClick:t,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),i.jsx(oo,{noLegendsText:r,legends:o,actionsTexts:s})]})]}):null,ao=({legendToggle:e})=>i.jsx(i.Fragment,{children:i.jsx(et,{onClick:e,children:i.jsxs("svg",{height:"100%",width:"100%",viewBox:"-45 -45 650 650",children:[i.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\r
6
- 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`}),i.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})})}),Ss="",Cn=e=>{const t=pe(),{enableCompass:n=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:o={DIRECTION:"ltr"}}=e;return a.useEffect(()=>{if(typeof $.get(t,"cesiumNavigation")>"u"){t.extend(gr,{enableCompass:n,enableZoomControls:r,enableDistanceLegend:!1}),t.cesiumNavigation.setNavigationLocked(s);const d=document.querySelector(".compass");d&&o.DIRECTION&&d.classList.add(o.DIRECTION)}},[t,n,r,o.DIRECTION,s]),null},bs="",Mn=e=>{const t=pe(),n=a.useRef(null),[r,s]=a.useState({x:0,y:0});return a.useEffect(()=>{t.screenSpaceEventHandler.setInputAction(o=>{if(o!=null&&o.endPosition){const d={...o.endPosition};d.x=Math.ceil(d.x),d.y=Math.ceil(d.y),s(d)}},g.ScreenSpaceEventType.MOUSE_MOVE)},[n,t]),a.useEffect(()=>{const o=t.scene.globe.ellipsoid;if(r){const d=wn(t,r.x,r.y);if(d){const h=new gn(d.longitude,d.latitude);if(n.current){let f="";switch(e.projection){case be.WEB_MERCATOR:{const C=new g.WebMercatorProjection(o).project(h);f=`Mercator: ${C.y.toFixed(Qe)}m, ${C.x.toFixed(Qe)}m`,n.current.style.width="220px";break}case be.WGS84:{const v=h.longitude.toFixed(Ke);f=`WGS84: ${h.latitude.toFixed(Ke)}°N ${v}°E`,n.current.style.width="200px";break}}n.current.innerHTML=f}}}},[r,n,t,e.projection]),i.jsx("div",{className:"coordinatesTracker",ref:n})},Cs="",Lt=[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],lo=(e,t,n,r)=>{const s=$.get(r,"METERS_UNIT")??"m",o=$.get(r,"KILOMETERS_UNIT")??"km",d={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:t.lastLegendUpdate},h=new g.EllipsoidGeodesic,f=new Date().getTime();if(f<d.lastLegendUpdate+250)return;d.lastLegendUpdate=f;const v=e.scene.canvas.clientWidth,C=e.scene.canvas.clientHeight,b=e.scene.camera.getPickRay(new g.Cartesian2(v/2|0,C-1)),p=e.scene.camera.getPickRay(new g.Cartesian2(1+v/2|0,C-1)),E=e.scene.globe,I=E.pick(b,e.scene),L=E.pick(p,e.scene);if(!I||!L)return;const F=E.ellipsoid.cartesianToCartographic(I),G=E.ellipsoid.cartesianToCartographic(L);h.setEndPoints(F,G);const j=h.surfaceDistance,Y=100;let V;for(let X=Lt.length-1;!$.isNumber(V)&&X>=0;--X)Lt[X]/j<Y&&(V=Lt[X]);if($.isNumber(V)){let X="";V>=1e3?X=`${(V/1e3).toString()} ${o}`:X=`${V.toString()} ${s}`,d.barWidth=V/j|0,d.distanceLabel=X}n(d)},_n=e=>{const t=pe(),[n,r]=a.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});a.useEffect(()=>{const o=f=>{lo(t,n,r,e.locale)},d=new g.EventHelper,h=f=>{t.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),d.removeAll())};return d.add(t.scene.globe.tileLoadProgressEvent,h),t.camera.moveEnd.addEventListener(o),()=>{try{$.get(t,"_cesiumWidget")!=null&&t.camera.moveEnd.removeEventListener(o)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[t,e.locale,n]);const s=o=>5+(125-o)/2;return i.jsx("div",{className:"scaleTracker",children:$.isNumber(n.barWidth)&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"scaleTrackerLabel",children:i.jsx("bdi",{children:n.distanceLabel})}),i.jsx("div",{className:"scaleTrackerBar",style:{height:"2px",width:`${n.barWidth.toString()}px`,left:`${s(n.barWidth).toString()}px`}})]})})},Ms="",Pn=()=>{const e=pe(),t=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return i.jsx("div",{className:"zoomButtons",children:t.map((n,r)=>i.jsx(J.Icon,{icon:i.jsx("div",{className:"zoomButton",children:i.jsx("svg",{fill:"var(--mdc-theme-cesium-color)",width:"12px",height:"12px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:i.jsx("path",{d:n.iconPath})})}),onClick:n.onClick},r))})},_s="",In=(e,t)=>{const r=$.get(t.scene.globe,"_surface.tileProvider"),s=r._quadtree,o=t.canvas.height,d=$.get(t.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(r.getLevelMaximumGeometricError(h)*o/(e*d)<s.maximumScreenSpaceError)return h;return null},co=(e,t)=>{e=e||10;const n=[];let r=1e5,s=0;for(let o=1e8;o>r;o=o-r){const d=In(o,t);if(d===null)break;if(d!==s){let h=o,f=o+r;for(;f-h>e;)o=h+(f-h)/2,In(o,t)===d?h=o:f=o;n.push({level:d,height:Math.round(o)}),s=d,n.length>=2&&(r=(n[n.length-2].height-o)/1e3)}}return n},An=({locale:e=void 0,valueBy:t="RENDERED_TILES"})=>{const n=pe(),r=Fe(),[s,o]=a.useState(1),d=co(1,n),h=a.useCallback(()=>{const b=n.camera,p=.5;let E=0;switch(n.scene.mode){case tt.SCENE3D:E=n.scene.mapProjection.ellipsoid.cartesianToCartographic(b.positionWC).height;break;case tt.SCENE2D:E=(b.frustum.right-b.frustum.left)*p;break;case tt.COLUMBUS_VIEW:E=b.position.z;break;default:E=0;break}if(d.length>0){const I=d.reduce((L,F)=>Math.abs(F.height-E)<Math.abs(L.height-E)?F:L);o(I.level),r.setViewState&&r.setViewState(L=>({...L,currentZoomLevel:I.level}))}},[n,d]),f=a.useCallback(()=>{let b=0;n.scene.globe._surface.forEachRenderedTile(function(p){b=Math.max(b,p.level)}),o(b),r.setViewState&&r.setViewState(p=>({...p,currentZoomLevel:b}))},[n]),C=a.useMemo(()=>({CALCULATION:h,RENDERED_TILES:f}),[h,f])[t];return a.useEffect(()=>{const b=n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded&&C()});return n.camera.moveEnd.addEventListener(C),()=>{try{typeof $.get(n,"_cesiumWidget")<"u"&&(n.camera.moveEnd.removeEventListener(C),b())}catch(p){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',p)}}},[n,C]),i.jsxs("div",{className:"zoomLevel",children:[i.jsx("div",{className:"zoomLevelValue",children:s}),i.jsx("div",{className:"zoomLevelLabel",children:$.get(e,"ZOOM_LABEL")??"zoom"})]})},Ps="",On=2,Dn=212,kn=260,uo=0;class ho extends g.Viewer{constructor(n,r){super(n,r);ue(this,"layersManager")}}const Tt=a.createContext(null),go=Tt.Provider,pe=()=>{const e=a.useContext(Tt);if(e===null)throw new Error("map context is null, please check the provider");return e.mapViewer},Fe=()=>{const{mapViewer:e,...t}=a.useContext(Tt);if(t===null)throw new Error("map context viewstate is null, please check the provider");return t},po=e=>{var me,ye,Ie,Ve,We,qn,jn,Yn;const t=a.useRef(null),[n,r]=a.useState(),[s,o]=a.useState(),[d,h]=a.useState(),[f,v]=a.useState(),[C,b]=a.useState(),[p,E]=a.useState(),[I,L]=a.useState(),[F,G]=a.useState(),[j,Y]=a.useState(),[V,X]=a.useState(),[W,Z]=a.useState(!1),[te,l]=a.useState(!1),c=a.useRef(),[_,y]=a.useState([]),[S,w]=a.useState(),[P,m]=a.useState(),[T,k]=a.useState(!1),N=a.useRef(),[A,D]=a.useState(void 0),[B,ee]=a.useState(!1),[ne,q]=a.useState(),[R,ie]=a.useState(),he=J.useTheme(),ve=Wt(he),oe=a.useMemo(()=>W||te,[W,te]);a.useEffect(()=>{ie({currentZoomLevel:-1,shouldOptimizedTileRequests:e.useOptimizedTileRequests??!1})},[]);const fe={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:$.isNumber(e.zoom)&&$.isArray(e.center),sceneModePicker:!0,imageryProvider:!1,...e},O=(se,de,le,Ee,Ce)=>{const Oe=n.container,Ae=Oe.clientWidth,ze=Oe.clientHeight,Zn=Ee+Ce;return{left:`${Ae-se<le?se-(le-(Ae-se)):se}px`,top:`${ze-de<Zn?de-(Zn-(ze-de)):de}px`}},x=a.useCallback(se=>{if(t.current!==null){const de=t.current.cesiumElement,le={x:se.offsetX,y:se.offsetY};k(!1),D(le),q(wn(de,le.x,le.y)),k(!0),N.current=se}},[t]);a.useEffect(()=>{var se;if(t.current!==null){const de=t.current.cesiumElement;e.imageryContextMenu&&(de.scene.canvas.removeEventListener("contextmenu",x),de.scene.canvas.addEventListener("contextmenu",x))}r((se=t.current)==null?void 0:se.cesiumElement)},[t,e.imageryContextMenu]);const H=a.useMemo(()=>{var se;if(n)return{mapViewer:n.layersManager?n:Object.assign(n,{layersManager:new ro(n,(se=e.legends)==null?void 0:se.mapLegendsExtractor,()=>{var le;y((le=n.layersManager)==null?void 0:le.legendsList)},e.layerManagerFootprintMetaFieldPath,R==null?void 0:R.shouldOptimizedTileRequests)}),viewState:R,setViewState:ie}},[e.useOptimizedTileRequests,e.legends,e.layerManagerFootprintMetaFieldPath,n,R]);a.useEffect(()=>{var de,le;w(e.baseMaps);const se=(de=e.baseMaps)==null?void 0:de.maps.find(Ee=>Ee.isCurrent);se&&n&&((le=n.layersManager)==null||le.setBaseMapLayers(se))},[e.baseMaps,n]),a.useEffect(()=>{const se=e.terrains||(n&&n.terrainProvider?[{id:"1",url:Ri,title:"Default Terrain",thumbnail:"Cesium/Widgets/Images/TerrainProviders/Ellipsoid.png",isCurrent:!0,terrainProvider:n.terrainProvider}]:void 0);m(se)},[e.terrains,n]),a.useEffect(()=>{h(e.projection??be.WGS84)},[e.projection]),a.useEffect(()=>{o(e.locale)},[e.locale]),a.useEffect(()=>{v(e.showMousePosition??!0)},[e.showMousePosition]),a.useEffect(()=>{b(e.showZoomLevel??!0)},[e.showZoomLevel]),a.useEffect(()=>{E(e.showScale??!0)},[e.showScale]),a.useEffect(()=>{L(e.showCompass??!0)},[e.showCompass]),a.useEffect(()=>{X(e.showLoadingProgress??!0)},[e.showLoadingProgress]),a.useEffect(()=>{Y(e.showActiveLayersTool??!0)},[e.showActiveLayersTool]),a.useEffect(()=>{var de;const se=()=>{if(n===void 0)return{longitude:0,latitude:0,height:0};const le=()=>{const Ee=n.camera.positionCartographic;return{longitude:Re(Ee.longitude),latitude:Re(Ee.latitude),height:Ee.height}};if(n.scene.mode===g.SceneMode.SCENE3D){const Ee=new g.Cartesian2(n.container.clientWidth/On,n.container.clientHeight/On),Ce=n.scene.camera.getPickRay(Ee),Oe=n.scene.globe.pick(Ce,n.scene);if(!Oe)return{longitude:0,latitude:0,height:0};const Ae=n.scene.globe.ellipsoid.cartesianToCartographic(Oe);return Ae!==void 0?{longitude:Re(Ae.longitude),latitude:Re(Ae.latitude),height:n.scene.camera.positionCartographic.height}:le()}else return le()};n&&(n.camera.moveEnd.addEventListener(()=>{if(n.scene.mode!==g.SceneMode.MORPHING){const le=n.camera,Ee={position:se(),direction:le.direction.clone(),up:le.up.clone(),right:le.right.clone(),transform:le.transform.clone(),frustum:le.frustum.clone()};c.current=Ee}}),V&&(n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded?Z(!1):Z(!0)}),(de=n.layersManager)==null||de.addDataLayerUpdatedListener(()=>{var Ee;let le=!1;(Ee=n.layersManager)==null||Ee.dataLayerList.forEach(Ce=>{if(typeof Ce.meta.items=="number"&&typeof Ce.meta.total=="number"&&Ce.meta.items>0&&Ce.meta.items<Ce.meta.total){le=!0;return}}),l(le)})))},[n]),a.useEffect(()=>{const se=()=>{if(n&&c.current){const de=c.current;n.camera.flyTo({destination:g.Cartesian3.fromDegrees(de.position.longitude,de.position.latitude,de.position.height),duration:0})}};return n&&n.scene.morphComplete.addEventListener(se),()=>{if(n)try{n.scene.morphComplete.removeEventListener(se)}catch{console.error("morphCompleteHandler event not cleaned")}}},[n]),a.useEffect(()=>{const se=e.zoom,de=e.center;if(n&&$.isNumber(se)&&$.isArray(de)){const le=de[0],Ee=de[1],Ce=hi(se);n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:0});const Oe=n.homeButton.viewModel.command,Ae=function(ze){n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:1}),ze.cancel=!0};return Oe.beforeExecute.addEventListener(Ae),()=>{Oe.beforeExecute.removeEventListener(Ae);try{Oe.beforeExecute.removeEventListener(Ae)}catch{console.error("customHomeButtonHandler event not cleaned")}}}},[e.zoom,e.center,n]),a.useEffect(()=>{G(e.showZoomButtons??!0)},[e.showZoomButtons]);const z=()=>{ee(se=>!se)},U=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[V&&oe&&i.jsx(J.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),I&&i.jsx(Cn,{locale:s}),i.jsxs(Q,{className:"bottomToolsContainer",children:[f&&i.jsx(Mn,{projection:d}),C&&i.jsx(An,{locale:s,valueBy:"RENDERED_TILES"}),p&&i.jsx(_n,{locale:s})]}),F&&i.jsx(Pn,{})]}),document.querySelector(".cesium-viewer")),[n,s,d,f,p,oe]),K=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[e.geocoderPanel&&i.jsx(Ki,{options:[...e.geocoderPanel],locale:s}),i.jsx(Ei,{baseMaps:S,terrains:P,locale:s}),e.showDebuggerTool&&i.jsx(Li,{locale:s}),i.jsx(ao,{legendToggle:z})]}),document.querySelector(".cesium-viewer-toolbar")),[n,s,S,P]),ce=a.useCallback(()=>n&&ut.createPortal(i.jsx(Q,{className:"cesium-viewer-cesiumInspectorContainer widgetsContainer",children:j&&i.jsx(mi,{locale:s})}),document.querySelector(".cesium-widget")),[n,s]);return i.jsx(J.ThemeProvider,{id:"cesiumTheme",options:ve,children:i.jsx(Me.Viewer,{className:"viewer",full:!0,ref:t,...fe,children:i.jsxs(go,{value:H,children:[i.jsx(so,{title:(me=e.legends)==null?void 0:me.title,isOpen:B,toggleSidebar:z,noLegendsText:(ye=e.legends)==null?void 0:ye.emptyText,legends:((Ie=e.legends)==null?void 0:Ie.legendsList)??_,actionsTexts:(Ve=e.legends)==null?void 0:Ve.actionsTexts}),e.children,U(),K(),ce(),e.imageryContextMenu&&T&&A&&ne&&a.cloneElement(e.imageryContextMenu,{data:(We=n==null?void 0:n.layersManager)==null?void 0:We.findLayerByPOI(A.x,A.y,!1),position:{x:A.x,y:A.y},coordinates:ne,style:O(A.x,A.y,((qn=e.imageryContextMenuSize)==null?void 0:qn.width)??kn,((jn=e.imageryContextMenuSize)==null?void 0:jn.height)??Dn,((Yn=e.imageryContextMenuSize)==null?void 0:Yn.dynamicHeightIncrement)??uo),size:e.imageryContextMenuSize??{height:Dn,width:kn},handleClose:()=>{k(!T)},contextEvt:N.current})]})})})},fo=0,mo=e=>{const t=pe();return i.jsx(Me.Cesium3DTileset,{...e,onReady:n=>{e.isZoomTo===!0&&t.zoomTo(n);const r=t.scene;r.globe.depthTestAgainstTerrain=!0;const s=g.Cartographic.fromCartesian(n.boundingSphere.center),o=e.heightFromGround??fo;if(o){const d=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),f=g.Cartesian3.subtract(h,d,new g.Cartesian3);n.modelMatrix=g.Matrix4.fromTranslation(f)}}})},ot=180,xn=.001,Nn=e=>Math.abs(e)/e,Bn=e=>{ot-Math.abs(e[0])<xn&&(e[0]=Nn(e[0])*(ot-1)),ot/2-Math.abs(e[1])<xn&&(e[1]=Nn(e[1])*(ot/2-1))},Fn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(t=>{Bn(t)});break;case"Polygon":e.coordinates.forEach(t=>{t.forEach(n=>{Bn(n)})});break}},yo=e=>{const{data:t,...n}=e,r=$.cloneDeep(t);return r&&(typeof r.features<"u"?r.features.forEach(s=>{Fn(s.geometry)}):Fn(r)),i.jsx(Me.GeoJsonDataSource,{data:r,...n})},He=e=>{const{meta:t,...n}=e,r=pe();return a.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(t,t.searchLayerPredicate)},[t,r]),i.jsx(Me.ImageryLayer,{...n})},vo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Tn(t,r):new g.WebMapServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},Eo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Sn(t,r):new g.WebMapTileServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},wo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Ln(t,r):new g.UrlTemplateImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},Lo=e=>{const{options:t,...n}=e;return i.jsx(He,{...n,imageryProvider:new g.OpenStreetMapImageryProvider(t)})},To=e=>{const{options:t,meta:n,visualizationHandler:r,withGeometryValidation:s=!1}=e,{url:o,featureType:d,style:h,pageSize:f,zoomLevel:v,maxCacheSize:C,keyField:b,labeling:p}=t,{color:E,hover:I}=h,L=pe(),F=Fe(),G=a.useRef(F.viewState),j=a.useRef(new Map),Y=a.useRef(new Set),V=a.useRef(0),[X,W]=a.useState(n),Z=a.useMemo(()=>g.Color.fromCssColorString(I??"#24AEE9").withAlpha(.5),[I]),te=a.useMemo(()=>`wfs_${d}_${Nt.v4()}`,[d]),l=a.useRef(!1);a.useEffect(()=>{G.current=F.viewState},[F.viewState]);const c=new g.GeoJsonDataSource(te),_=O=>{const x=[],H=n.featureStructure;if(H&&H.fields)for(const U of H.fields){const{fieldName:K,aliasFieldName:ce}=U,me=ce,ye=O[K]??"N/A",Ie=Math.max(100,Math.min(180,me.length*10)),Ve="260px";x.push(`
5
+ `),verticalOrigin:g.VerticalOrigin.BOTTOM,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})}}),e.dataSources.remove(e.dataSources.getByName(`${o==null?void 0:o.dataSourcePrefix}${t.name}`)[0]),o&&d){const p=new g.GeoJsonDataSource(`${o==null?void 0:o.dataSourcePrefix}${t.name}`);e.dataSources.add(p),p.load({type:"FeatureCollection",features:b}).then(v=>{v==null||v.entities.values.forEach(I=>{var T;I.billboard=new g.BillboardGraphics({image:(T=I.properties)==null?void 0:T.label.getValue(g.JulianDate.now()).dataURL,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})})})}},Xi=.2,Ji=(e,t=Xi)=>e.width===0?(e.east=e.east+1e-4*t,e.west=e.west-1e-4*t,e.south=e.south-1e-4*t,e.north=e.north+1e-4*t,e):(e.east=e.east+e.width*t,e.west=e.west-e.width*t,e.south=e.south-e.height*t,e.north=e.north+e.height*t,e),bs="",Ki=({options:e,isOpen:t,locale:n})=>{const r=pe(),s=a.useRef(void 0),o=a.useRef(null),[d,h]=a.useState(""),[f,E]=a.useState(!1),[C,b]=a.useState(!0),[p,v]=a.useState(),[I,T]=a.useState(),F=a.useMemo(()=>$.get(n,"SHOW_FEATURE_ON_MAP")??"Show on map",[n]),V=a.useMemo(()=>$.get(n,"IN_MAP_EXTENT")??"Search in extent",[n]),j=a.useMemo(()=>$.get(n,"SEARCH_PLACEHOLDER")??"Search...",[n]),Y=a.useMemo(()=>$.get(n,"NO_RESULTS")??"No Results",[n]),G=a.useMemo(()=>r.scene.mode===g.SceneMode.SCENE2D?!1:(E(!1),!0),[r.scene.mode]),X=300,W=i.jsx("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"white",stroke:"#ccc",strokeWidth:1})}),Z=i.jsxs("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:[i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"#1976d2",stroke:"#1976d2",strokeWidth:1}),i.jsx("path",{d:"M4 8l2 2 6-6",fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]});a.useEffect(()=>{e.forEach(m=>{m.baseUrl&&m.endPoint&&!m.url&&(m.url=m.baseUrl+m.endPoint)})},[e]),a.useEffect(()=>{t&&o.current&&o.current.focus()},[t]),a.useEffect(()=>{if(!r)return;if(!s.current){const L=new g.GeoJsonDataSource("geocoderDataSource");s.current=L,r.dataSources.add(L)}const m=s.current;I&&C?(async()=>{const k={type:"FeatureCollection",features:[I]};await m.load(k),En(r,m,[],"#01FF1F")})():m.entities.removeAll()},[r,C,I]);const ee=m=>{switch(typeof m){case"object":return Array.isArray(m)?`[${m.map(L=>`'${L}'`).join(", ")}]`:JSON.stringify(m);case"boolean":case"number":case"string":return m.toString();case"undefined":return}},l=(m,L,k)=>{const N=ee(k);if(N){const A=m.includes("?")?m.endsWith("?")||m.endsWith("&")?"":"&":"?";return`${m}${A}${encodeURIComponent(L)}=${encodeURIComponent(N)}`}return m},c=(m,L)=>(m&&m.forEach(k=>{L=l(L,k[0],k[1])}),L),_=a.useCallback((m,L,k,N)=>((()=>{const O=L.dynamic.queryText,B=typeof O=="string"?O:O.name,te=typeof O=="string"?void 0:O.relatedParams;if(m=l(m,B,k),te&&te.forEach(ne=>{m=l(m,ne[0],ne[1])}),N){const ne=vn(r),q=L.dynamic.geoContext,R=typeof q=="string"?q:q==null?void 0:q.name;if(ne&&R){const ie=yn(ne),ge={bbox:[ie[0],ie[1],ie[2],ie[3]]};m=l(m,R,ge);const ve=typeof q=="string"||q==null?void 0:q.relatedParams;ve&&ve.forEach(oe=>{m=l(m,oe[0],oe[1])})}}})(),m=c(L.static,m),m),[r]),y=a.useCallback(async(m,L)=>{if(!m){v([]);return}const k=e.map(async O=>{if(O.url){const B=_(O.url,O.params,m,L);return fetch(B,{method:"GET"})}else return Promise.reject({message:"No URL provided. Please provide one"})}),N=await Promise.all(k),A=await Promise.all(N.filter(O=>O!==void 0).map(async O=>{var te;const B=await O.json();return B.features=(te=B.features)==null?void 0:te.map(ne=>({...ne,properties:{...ne.properties,headers:O.headers}})),{body:B,status:O.status,url:O.url,headers:Object.fromEntries(O.headers.entries())}}));v(A)},[_,e]),S=a.useMemo(()=>$.debounce((m,L)=>{y(m,L)},X),[y]);a.useEffect(()=>()=>S.cancel(),[S]);const w=(m,L)=>{h(m),S(m,L)};a.useEffect(()=>{y(d,f)},[f]);const P=m=>{const L=dr.getType(m);let k;switch(L){case"Point":k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"var(--mdc-theme-cesium-color)",children:i.jsx("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})});break;case"LineString":k=i.jsxs("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"var(--mdc-theme-cesium-color)",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:.5,d:"M21 6h.046l-5.25 9h-.944L10 9.455V7H7v2.926L1.862 18H0v3h3v-2.926L8.138 10h1.01L14 15.545V18h3v-3h-.046l5.25-9H24V3h-3zM8 8h1v1H8zM2 20H1v-1h1zm14-3h-1v-1h1zm7-13v1h-1V4z"}),i.jsx("path",{fill:"none",d:"M0 0h24v24H0z"})]});break;default:k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"none",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M11 4 L20 14 L20 20 L4 20 L4 10 Z"})});break}return i.jsx(Q,{children:k})};return i.jsx(Q,{className:"geocoderContainer",children:i.jsxs(Q,{className:"geocoderForm",children:[i.jsx(J.TextField,{id:"geocoderTextField",className:"cesium-geocoder-input",ref:o,onChange:m=>w(m.target.value,f),placeholder:j,value:d,autoComplete:"off"}),i.jsxs(Q,{className:"search-results",children:[i.jsxs(Q,{className:"checkboxesContainer",children:[i.jsx(J.Checkbox,{className:"checkboxElement",label:F,icon:W,checkedicon:Z,checked:C,onClick:()=>{b(!C)}}),i.jsx(J.Checkbox,{className:"checkboxElement",label:i.jsx(J.Typography,{tag:"span",className:G?"disabled":"",children:V}),checked:f,icon:W,checkedicon:Z,disabled:G,onClick:()=>{E(!f)}})]}),i.jsx(Q,{className:"listsContainer",children:e.map((m,L)=>i.jsxs(J.List,{children:[i.jsx(J.Typography,{className:"bold",tag:"span",children:m.title??m.endPoint}),i.jsx(Q,{className:"listContainer",children:(()=>{var B,te,ne,q,R,ie,ge,ve;const k=(te=(B=p==null?void 0:p[L])==null?void 0:B.body)==null?void 0:te.features,N=(R=(q=(ne=p==null?void 0:p[L])==null?void 0:ne.body)==null?void 0:q.features)==null?void 0:R.length,A=(ge=(ie=p==null?void 0:p[L])==null?void 0:ie.body)==null?void 0:ge.message,O=(ve=p==null?void 0:p[L])==null?void 0:ve.status;return N?k.map((oe,fe)=>{var D,x,H,z,U;return i.jsx(J.ListItem,{className:I===oe?"mdc-ripple-upgraded--background-focused":"",onClick:()=>{var K;r.camera.flyTo({destination:Ji(fn.fromDegrees(...qe(oe.geometry)))}),T(oe),(K=m.callbackFunc)==null||K.call(m,oe,m,fe)},children:i.jsxs(Q,{className:"queryItemResult",children:[i.jsx(J.Tooltip,{content:(x=(D=oe==null?void 0:oe.properties)==null?void 0:D.names)==null?void 0:x.display,children:i.jsx(Q,{children:(U=(z=(H=oe==null?void 0:oe.properties)==null?void 0:H.names)==null?void 0:z.default)==null?void 0:U[0]})}),P(oe)]})},`feature-${fe}`)}):N===0?i.jsx(J.ListItemSecondaryText,{className:"generalListItem queryNoResults",children:Y}):A?i.jsx(J.ListItemSecondaryText,{className:`generalListItem ${O===400?"queryWarning":"queryError"}`,children:A}):i.jsx(J.ListItemSecondaryText,{className:"generalListItem"})})()})]}))})]})]})})},Qi=wt(({options:e,locale:t,isOpen:n,setIsOpen:r})=>i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>r(!n),children:i.jsx("svg",{className:"cesium-svgPath-svg",width:"32",height:"32",fill:"var(--mdc-theme-cesium-color)",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z"})})}),i.jsx(Et,{isVisible:n,children:i.jsx(Ki,{options:e,isOpen:n,locale:t})})]})),Ri={GLOBAL:{"BM-GOOGLE_TERRAIN-XYZ_LAYER":"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}","BM-INFRARED_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?","BM-RADAR_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?","BM-VECTOR_TILES_GPS-XYZ_LAYER":"https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png","BM-VECTOR_TILES-XYZ_LAYER":"https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38","BM-WMTS_POPULATION_TILES-WMTS_LAYER":"https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/","3D_MODEL":"https://3d.ofek-air.com/3d/Jeru_Old_City_Cesium/ACT/Jeru_Old_City_Cesium_ACT.json"},"WFS Vector layer":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw",vector_geoserver:"http://geoserver-vector-dev.apps.j1lk3njp.eastus.aroapp.io/geoserver/core/ows"},"WFS Vector layer (Visual)":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw"},"WFS PP layer":{raster_pp_geoserver:"https://raster-serving-int-pp-geoserver-nginx-route-manual-integration.apps.j1lk3njp.eastus.aroapp.io/geoserver/wfs?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJkIjpbInJhc3RlciIsInJhc3RlcldtcyIsInJhc3RlckV4cG9ydCIsImRlbSIsInZlY3RvciIsIjNkIl0sImlhdCI6MTY3NDYzMjM0Niwic3ViIjoibWFwY29sb25pZXMtYXBwIiwiaXNzIjoibWFwY29sb25pZXMtdG9rZW4tY2xpIn0.D1u28gFlxf_Z1bzIiRHZonUgrdWwhZy8DtmQj15cIzaABRUrGV2n_OJlgWTuNfrao0SbUZb_s0_qUUW6Gz_zO3ET2bVx5xQjBu0CaIWdmUPDjEYr6tw-eZx8EjFFIyq3rs-Fo0daVY9cX1B2aGW_GeJir1oMnJUURhABYRoh60azzl_utee9UdhDpnr_QElNtzJZIKogngsxCWp7tI7wkTuNCBaQM7aLEcymk0ktxlWEAt1E0nGt1R-bx-HnPeeQyZlxx4UQ1nuYTijpz7N8poaCCExOFeafj9T7megv2BzTrKWgfM1eai8srSgNa3I5wKuW0EyYnGZxdbJe8aseZg"}},Pe=(e,t)=>Ri[e][t],eo=Pe("GLOBAL","DEFAULT_TERRAIN_PROVIDER_URL");Pe("GLOBAL","TERRAIN_SRTM100"),Pe("GLOBAL","TERRAIN_COMBINED"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-INFRARED_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-RADAR_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-WMTS_POPULATION_TILES-WMTS_LAYER");const wn=(e,t,n)=>{let r;if(e.scene.mode!==g.SceneMode.SCENE2D)r=e.scene.pickPosition(new g.Cartesian2(t,n));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new g.Cartesian2(t,n),s)}return g.Cartographic.fromCartesian(r)},to=(e,t,n)=>{const r=wn(e,t,n);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]}}},Tn=(e,t,n)=>{try{const r=wn(e,t,n);return{longitude:g.Math.toDegrees(r.longitude),latitude:g.Math.toDegrees(r.latitude)}}catch{return}},rt=3,it="hasTransparency";function Tt(e,t,n,r,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(f=>{var E,C;return((E=f._imageryProvider._resource)==null?void 0:E._url)===((C=this._resource)==null?void 0:C._url)}))==null?void 0:h.meta,d=$.get(o,it)===!0;this.tileTransparencyCheckedCounter<rt&&!d&&qi(s==null?void 0:s.url,this).then(f=>{var E;(E=this.mapViewer.layersManager)==null||E.addMetaToLayer({[it]:f},C=>C._imageryProvider._resource._url===this._resource._url)})},0),e(t,n,r,s)}class Ln extends g.UrlTemplateImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return Tt.call(this,super.requestImage.bind(this),n,r,s,o)}}class Sn extends g.WebMapServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return Tt.call(this,super.requestImage.bind(this),n,r,s,o)}}class bn extends g.WebMapTileServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return Tt.call(this,super.requestImage.bind(this),n,r,s,o)}}const no=1,ro=-1,Cn="TRANSPARENT_BASE_LAYER";class io{constructor(t,n,r,s,o){ue(this,"mapViewer");ue(this,"legendsList");ue(this,"layerUpdated");ue(this,"dataLayerUpdated");ue(this,"layers");ue(this,"dataLayers");ue(this,"legendsExtractor");ue(this,"layerManagerFootprintMetaFieldPath");ue(this,"shouldOptimizedTileRequests");this.mapViewer=t,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=n,this.layerUpdated=new g.Event,this.dataLayerUpdated=new g.Event,this.layerManagerFootprintMetaFieldPath=s,this.shouldOptimizedTileRequests=o??!1,r&&this.addLayerUpdatedListener(r),this.shouldOptimizedTileRequests&&(this.addLayerUpdatedListener(d=>{const h=Object.keys(d);h.length===1&&h[0]===it&&(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}get dataLayerList(){return this.dataLayers}isBaseMapLayer(t){return!!$.get(t,"parentBasetMapId")}addDataLayer(t){this.dataLayers.push({...t}),this.dataLayerUpdated.raiseEvent(this.dataLayers)}addMetaToLayer(t,n){const r=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(r).then(s=>{const o=this.layers.find(n);o&&(o.meta={...o.meta??{},...t},this.setLegends(),this.layerUpdated.raiseEvent(t))})}addMetaToDataLayer(t){const n=this.findDataLayerById(t.id);n&&(n.meta={...n.meta??{},...t},this.dataLayerUpdated.raiseEvent(this.dataLayers,t.id))}setBaseMapLayers(t){t.baseRasterLayers.sort((r,s)=>r.zIndex-s.zIndex).forEach((r,s)=>{this.addRasterLayer(r,s,t.id)}),this.shouldOptimizedTileRequests&&(this.removeLayer(Cn),this.addTransparentImageryProvider())}addRasterLayer(t,n,r){let s;switch(t.type){case"XYZ_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Ln(o,this.mapViewer):new g.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Sn(o,this.mapViewer):new g.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMTS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new bn(o,this.mapViewer):new g.WebMapTileServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}}s&&(s.alpha=t.opacity,s.meta={parentBasetMapId:r,...t},t.show!==void 0&&(s.show=t.show))}removeLayer(t){const n=this.findLayerById(t);n&&this.mapViewer.imageryLayers.remove(n,!0)}removeDataLayer(t){const n=this.findDataLayerById(t);if(n){const r=this.dataLayers.indexOf(n);r>-1&&this.dataLayers.splice(r,1),this.dataLayerUpdated.raiseEvent(this.dataLayers)}}removeBaseMapLayers(){this.layers.filter(n=>this.isBaseMapLayer(n.meta)).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}removeNotBaseMapLayers(){this.layers.filter(n=>!$.get(n.meta,"parentBasetMapId")).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}raise(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex;if(r)for(let o=0;o<n;o++)this.mapViewer.imageryLayers.raise(r);this.updateLayersOrder(t,s,s+n)}lower(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex,o=this.getBaseLayersCount(),d=this.mapViewer.imageryLayers.indexOf(r);if(d-n<=o&&(n=d-o),r)for(let h=0;h<n;h++)this.mapViewer.imageryLayers.lower(r);this.updateLayersOrder(t,s,s-n)}raiseToTop(t){const n=this.findLayerById(t),r=(n==null?void 0:n.meta).zIndex;n&&this.mapViewer.imageryLayers.raiseToTop(n),this.updateLayersOrder(t,r,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(t){const n=this.findLayerById(t),r=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(n);this.lower(t,s-r)}length(){return this.mapViewer.imageryLayers.length}show(t,n){const r=this.get(t);r!==void 0&&(r.show=n)}showAllNotBase(t){this.layers.filter(r=>!$.get(r.meta,"parentBasetMapId")).forEach(r=>{var s;this.show((s=r.meta)==null?void 0:s.id,t)})}get(t){const n=this.findLayerById(t),r=this.mapViewer.imageryLayers.indexOf(n);return r?this.mapViewer.imageryLayers.get(r):void 0}pickImageryLayers(t){var s;const n=this.mapViewer.camera.getPickRay(t);let r;return n&&(r=(s=this.mapViewer.imageryLayers.pickImageryLayers(n,this.mapViewer.scene))==null?void 0:s.filter(o=>!$.get(o.meta,"parentBasetMapId"))),r}findLayerByPOI(t,n,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=to(this.mapViewer,t,n);return this.layers.filter(h=>!$.get(h.meta,"parentBasetMapId")).filter(h=>{const f=$.get(h.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?gr(s.geometry,{type:"Feature",properties:{},geometry:f})&&(r?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,f)=>{var E,C;return((E=f.meta)==null?void 0:E.zIndex)-((C=h.meta)==null?void 0:C.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const t=this.mapViewer.imageryLayers.addImageryProvider(new g.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new g.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);t.meta={id:Cn,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}addLayerUpdatedListener(t){this.layerUpdated.addEventListener(t,this)}removeLayerUpdatedListener(t){this.layerUpdated.removeEventListener(t,this)}addDataLayerUpdatedListener(t){this.dataLayerUpdated.addEventListener(t,this)}removeDataLayerUpdatedListener(t){this.dataLayerUpdated.removeEventListener(t,this)}findDataLayerById(t){return this.dataLayers.find(n=>n.meta.id===t)}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(n=>!!$.get(n.meta,"parentBasetMapId")).length}findLayerById(t){return this.layers.find(n=>n.meta!==void 0?n.meta.id===t:!1)}updateLayersOrder(t,n,r){const s=n>r?no:ro,o=n<r?n:r,d=n<r?r:n;this.layers.forEach(h=>{var E;if(!$.get(h.meta,"parentBasetMapId")){const C=(E=h.meta)==null?void 0:E.zIndex;h.meta.zIndex=C>=o&&C<=d&&C!==n?C+s:C===n?r:C}})}hideNonRelevantLayers(){var t,n;for(const r of this.layers)((t=r.meta)==null?void 0:t.relevantToExtent)!==r.show&&r.imageryProvider.ready&&(r.show=((n=r.meta)==null?void 0:n.relevantToExtent)??!0)}markRelevantLayersForExtent(){var t,n;try{const r=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const o=this.layers[s],d=!$.isEmpty(r)&&!$.isEmpty(o.rectangle)&&g.Rectangle.intersection(r,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((t=o.meta)==null?void 0:t.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const f=this.layers[h],E=((n=f.meta)==null?void 0:n[it])===!0;if(o!==f)if(d instanceof g.Rectangle){if(nt(r,o.rectangle))if(nt(r,f.rectangle)&&!E){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(nt(r,f.rectangle)&&!E){o.meta={...o.meta??{},relevantToExtent:!1};break}if(nt(o.rectangle,f.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:E},!E)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:d instanceof g.Rectangle})}}}catch(r){console.error(r)}}}const _s="",oo=({legend:{legendImg:e,legendDoc:t,layer:n},docText:r,imgText:s})=>{const o=a.useCallback(()=>{window.open(e,"_blank")},[e]);a.useCallback(()=>{window.open(t,"_blank")},[t]);const d=a.useCallback(()=>{const E=i.jsx(Q,{className:"layerNameContainer",children:i.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:n})});return(n??"").length>15?i.jsx(J.Tooltip,{content:n,children:E}):E},[n]),h=a.useCallback(()=>[typeof e=="string"&&i.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof t=="string"&&i.jsx("a",{className:"legendAction",href:t,target:"_blank",rel:"noreferrer",children:r})],[e,s,t,r]);return i.jsxs(Q,{className:"mapLegend",children:[d(),i.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),i.jsx(Q,{className:"legendActionsContainer",children:h()})]})},so=({legends:e,actionsTexts:{docText:t,imgText:n},noLegendsText:r})=>{const s=a.useCallback(()=>i.jsx(Q,{className:"noLegendsContainer",children:i.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),o=a.useCallback(()=>e.length?e.map((d,h)=>i.jsx(oo,{legend:d,docText:t,imgText:n},`${d.layer}_${h}`)):s(),[e]);return i.jsx(Q,{className:"mapLegendsList",children:o()})},ao=({isOpen:e,toggleSidebar:t,title:n="Map Legends",noLegendsText:r="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?i.jsxs(J.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[i.jsx(J.DrawerHeader,{className:"sidebarHeaderContainer",children:i.jsx(J.DrawerTitle,{className:"sidebarTitle",children:n})}),i.jsxs(J.DrawerContent,{className:"sidebarContent",children:[i.jsx(J.Icon,{onClick:t,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),i.jsx(so,{noLegendsText:r,legends:o,actionsTexts:s})]})]}):null,lo=({legendToggle:e})=>i.jsx(i.Fragment,{children:i.jsx(et,{onClick:e,children:i.jsxs("svg",{height:"100%",width:"100%",viewBox:"-45 -45 650 650",children:[i.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\r
6
+ 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`}),i.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})})}),Ps="",Mn=e=>{const t=pe(),{enableCompass:n=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:o={DIRECTION:"ltr"}}=e;return a.useEffect(()=>{if(typeof $.get(t,"cesiumNavigation")>"u"){t.extend(pr,{enableCompass:n,enableZoomControls:r,enableDistanceLegend:!1}),t.cesiumNavigation.setNavigationLocked(s);const d=document.querySelector(".compass");d&&o.DIRECTION&&d.classList.add(o.DIRECTION)}},[t,n,r,o.DIRECTION,s]),null},Is="",_n=e=>{const t=pe(),n=a.useRef(null),[r,s]=a.useState({x:0,y:0});return a.useEffect(()=>{t.screenSpaceEventHandler.setInputAction(o=>{if(o!=null&&o.endPosition){const d={...o.endPosition};d.x=Math.ceil(d.x),d.y=Math.ceil(d.y),s(d)}},g.ScreenSpaceEventType.MOUSE_MOVE)},[n,t]),a.useEffect(()=>{const o=t.scene.globe.ellipsoid;if(r){const d=Tn(t,r.x,r.y);if(d){const h=new pn(d.longitude,d.latitude);if(n.current){let f="";switch(e.projection){case be.WEB_MERCATOR:{const C=new g.WebMercatorProjection(o).project(h);f=`Mercator: ${C.y.toFixed(Qe)}m, ${C.x.toFixed(Qe)}m`,n.current.style.width="220px";break}case be.WGS84:{const E=h.longitude.toFixed(Ke);f=`WGS84: ${h.latitude.toFixed(Ke)}°N ${E}°E`,n.current.style.width="200px";break}}n.current.innerHTML=f}}}},[r,n,t,e.projection]),i.jsx("div",{className:"coordinatesTracker",ref:n})},As="",Lt=[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],co=(e,t,n,r)=>{const s=$.get(r,"METERS_UNIT")??"m",o=$.get(r,"KILOMETERS_UNIT")??"km",d={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:t.lastLegendUpdate},h=new g.EllipsoidGeodesic,f=new Date().getTime();if(f<d.lastLegendUpdate+250)return;d.lastLegendUpdate=f;const E=e.scene.canvas.clientWidth,C=e.scene.canvas.clientHeight,b=e.scene.camera.getPickRay(new g.Cartesian2(E/2|0,C-1)),p=e.scene.camera.getPickRay(new g.Cartesian2(1+E/2|0,C-1)),v=e.scene.globe,I=v.pick(b,e.scene),T=v.pick(p,e.scene);if(!I||!T)return;const F=v.ellipsoid.cartesianToCartographic(I),V=v.ellipsoid.cartesianToCartographic(T);h.setEndPoints(F,V);const j=h.surfaceDistance,Y=100;let G;for(let X=Lt.length-1;!$.isNumber(G)&&X>=0;--X)Lt[X]/j<Y&&(G=Lt[X]);if($.isNumber(G)){let X="";G>=1e3?X=`${(G/1e3).toString()} ${o}`:X=`${G.toString()} ${s}`,d.barWidth=G/j|0,d.distanceLabel=X}n(d)},Pn=e=>{const t=pe(),[n,r]=a.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});a.useEffect(()=>{const o=f=>{co(t,n,r,e.locale)},d=new g.EventHelper,h=f=>{t.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),d.removeAll())};return d.add(t.scene.globe.tileLoadProgressEvent,h),t.camera.moveEnd.addEventListener(o),()=>{try{$.get(t,"_cesiumWidget")!=null&&t.camera.moveEnd.removeEventListener(o)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[t,e.locale,n]);const s=o=>5+(125-o)/2;return i.jsx("div",{className:"scaleTracker",children:$.isNumber(n.barWidth)&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"scaleTrackerLabel",children:i.jsx("bdi",{children:n.distanceLabel})}),i.jsx("div",{className:"scaleTrackerBar",style:{height:"2px",width:`${n.barWidth.toString()}px`,left:`${s(n.barWidth).toString()}px`}})]})})},Ds="",In=()=>{const e=pe(),t=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return i.jsx("div",{className:"zoomButtons",children:t.map((n,r)=>i.jsx(J.Icon,{icon:i.jsx("div",{className:"zoomButton",children:i.jsx("svg",{fill:"var(--mdc-theme-cesium-color)",width:"12px",height:"12px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:i.jsx("path",{d:n.iconPath})})}),onClick:n.onClick},r))})},Os="",An=(e,t)=>{const r=$.get(t.scene.globe,"_surface.tileProvider"),s=r._quadtree,o=t.canvas.height,d=$.get(t.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(r.getLevelMaximumGeometricError(h)*o/(e*d)<s.maximumScreenSpaceError)return h;return null},uo=(e,t)=>{e=e||10;const n=[];let r=1e5,s=0;for(let o=1e8;o>r;o=o-r){const d=An(o,t);if(d===null)break;if(d!==s){let h=o,f=o+r;for(;f-h>e;)o=h+(f-h)/2,An(o,t)===d?h=o:f=o;n.push({level:d,height:Math.round(o)}),s=d,n.length>=2&&(r=(n[n.length-2].height-o)/1e3)}}return n},Dn=({locale:e=void 0,valueBy:t="RENDERED_TILES"})=>{const n=pe(),r=Fe(),[s,o]=a.useState(1),d=uo(1,n),h=a.useCallback(()=>{const b=n.camera,p=.5;let v=0;switch(n.scene.mode){case tt.SCENE3D:v=n.scene.mapProjection.ellipsoid.cartesianToCartographic(b.positionWC).height;break;case tt.SCENE2D:v=(b.frustum.right-b.frustum.left)*p;break;case tt.COLUMBUS_VIEW:v=b.position.z;break;default:v=0;break}if(d.length>0){const I=d.reduce((T,F)=>Math.abs(F.height-v)<Math.abs(T.height-v)?F:T);o(I.level),r.setViewState&&r.setViewState(T=>({...T,currentZoomLevel:I.level}))}},[n,d]),f=a.useCallback(()=>{let b=0;n.scene.globe._surface.forEachRenderedTile(function(p){b=Math.max(b,p.level)}),o(b),r.setViewState&&r.setViewState(p=>({...p,currentZoomLevel:b}))},[n]),C=a.useMemo(()=>({CALCULATION:h,RENDERED_TILES:f}),[h,f])[t];return a.useEffect(()=>{const b=n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded&&C()});return n.camera.moveEnd.addEventListener(C),()=>{try{typeof $.get(n,"_cesiumWidget")<"u"&&(n.camera.moveEnd.removeEventListener(C),b())}catch(p){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',p)}}},[n,C]),i.jsxs("div",{className:"zoomLevel",children:[i.jsx("div",{className:"zoomLevelValue",children:s}),i.jsx("div",{className:"zoomLevelLabel",children:$.get(e,"ZOOM_LABEL")??"zoom"})]})},ks="",On=2,kn=212,xn=260,ho=0;class go extends g.Viewer{constructor(n,r){super(n,r);ue(this,"layersManager")}}const St=a.createContext(null),po=St.Provider,pe=()=>{const e=a.useContext(St);if(e===null)throw new Error("map context is null, please check the provider");return e.mapViewer},Fe=()=>{const{mapViewer:e,...t}=a.useContext(St);if(t===null)throw new Error("map context viewstate is null, please check the provider");return t},fo=e=>{var me,ye,Ie,Ge,We,jn,Yn,Zn;const t=a.useRef(null),[n,r]=a.useState(),[s,o]=a.useState(),[d,h]=a.useState(),[f,E]=a.useState(),[C,b]=a.useState(),[p,v]=a.useState(),[I,T]=a.useState(),[F,V]=a.useState(),[j,Y]=a.useState(),[G,X]=a.useState(),[W,Z]=a.useState(!1),[ee,l]=a.useState(!1),c=a.useRef(),[_,y]=a.useState([]),[S,w]=a.useState(),[P,m]=a.useState(),[L,k]=a.useState(!1),N=a.useRef(),[A,O]=a.useState(void 0),[B,te]=a.useState(!1),[ne,q]=a.useState(),[R,ie]=a.useState(),ge=J.useTheme(),ve=zt(ge),oe=a.useMemo(()=>W||ee,[W,ee]);a.useEffect(()=>{ie({currentZoomLevel:-1,shouldOptimizedTileRequests:e.useOptimizedTileRequests??!1})},[]);const fe={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:$.isNumber(e.zoom)&&$.isArray(e.center),sceneModePicker:!0,imageryProvider:!1,...e},D=(se,de,le,Ee,Ce)=>{const De=n.container,Ae=De.clientWidth,ze=De.clientHeight,Xn=Ee+Ce;return{left:`${Ae-se<le?se-(le-(Ae-se)):se}px`,top:`${ze-de<Xn?de-(Xn-(ze-de)):de}px`}},x=a.useCallback(se=>{if(t.current!==null){const de=t.current.cesiumElement,le={x:se.offsetX,y:se.offsetY};k(!1),O(le),q(Tn(de,le.x,le.y)),k(!0),N.current=se}},[t]);a.useEffect(()=>{var se;if(t.current!==null){const de=t.current.cesiumElement;e.imageryContextMenu&&(de.scene.canvas.removeEventListener("contextmenu",x),de.scene.canvas.addEventListener("contextmenu",x))}r((se=t.current)==null?void 0:se.cesiumElement)},[t,e.imageryContextMenu]);const H=a.useMemo(()=>{var se;if(n)return{mapViewer:n.layersManager?n:Object.assign(n,{layersManager:new io(n,(se=e.legends)==null?void 0:se.mapLegendsExtractor,()=>{var le;y((le=n.layersManager)==null?void 0:le.legendsList)},e.layerManagerFootprintMetaFieldPath,R==null?void 0:R.shouldOptimizedTileRequests)}),viewState:R,setViewState:ie}},[e.useOptimizedTileRequests,e.legends,e.layerManagerFootprintMetaFieldPath,n,R]);a.useEffect(()=>{var de,le;w(e.baseMaps);const se=(de=e.baseMaps)==null?void 0:de.maps.find(Ee=>Ee.isCurrent);se&&n&&((le=n.layersManager)==null||le.setBaseMapLayers(se))},[e.baseMaps,n]),a.useEffect(()=>{const se=e.terrains||(n&&n.terrainProvider?[{id:"1",url:eo,title:"Default Terrain",thumbnail:"Cesium/Widgets/Images/TerrainProviders/Ellipsoid.png",isCurrent:!0,terrainProvider:n.terrainProvider}]:void 0);m(se)},[e.terrains,n]),a.useEffect(()=>{h(e.projection??be.WGS84)},[e.projection]),a.useEffect(()=>{o(e.locale)},[e.locale]),a.useEffect(()=>{E(e.showMousePosition??!0)},[e.showMousePosition]),a.useEffect(()=>{b(e.showZoomLevel??!0)},[e.showZoomLevel]),a.useEffect(()=>{v(e.showScale??!0)},[e.showScale]),a.useEffect(()=>{T(e.showCompass??!0)},[e.showCompass]),a.useEffect(()=>{X(e.showLoadingProgress??!0)},[e.showLoadingProgress]),a.useEffect(()=>{Y(e.showActiveLayersTool??!0)},[e.showActiveLayersTool]),a.useEffect(()=>{var de;const se=()=>{if(n===void 0)return{longitude:0,latitude:0,height:0};const le=()=>{const Ee=n.camera.positionCartographic;return{longitude:Re(Ee.longitude),latitude:Re(Ee.latitude),height:Ee.height}};if(n.scene.mode===g.SceneMode.SCENE3D){const Ee=new g.Cartesian2(n.container.clientWidth/On,n.container.clientHeight/On),Ce=n.scene.camera.getPickRay(Ee),De=n.scene.globe.pick(Ce,n.scene);if(!De)return{longitude:0,latitude:0,height:0};const Ae=n.scene.globe.ellipsoid.cartesianToCartographic(De);return Ae!==void 0?{longitude:Re(Ae.longitude),latitude:Re(Ae.latitude),height:n.scene.camera.positionCartographic.height}:le()}else return le()};n&&(n.camera.moveEnd.addEventListener(()=>{if(n.scene.mode!==g.SceneMode.MORPHING){const le=n.camera,Ee={position:se(),direction:le.direction.clone(),up:le.up.clone(),right:le.right.clone(),transform:le.transform.clone(),frustum:le.frustum.clone()};c.current=Ee}}),G&&(n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded?Z(!1):Z(!0)}),(de=n.layersManager)==null||de.addDataLayerUpdatedListener(()=>{var Ee;let le=!1;(Ee=n.layersManager)==null||Ee.dataLayerList.forEach(Ce=>{if(typeof Ce.meta.items=="number"&&typeof Ce.meta.total=="number"&&Ce.meta.items>0&&Ce.meta.items<Ce.meta.total){le=!0;return}}),l(le)})))},[n]),a.useEffect(()=>{const se=()=>{if(n&&c.current){const de=c.current;n.camera.flyTo({destination:g.Cartesian3.fromDegrees(de.position.longitude,de.position.latitude,de.position.height),duration:0})}};return n&&n.scene.morphComplete.addEventListener(se),()=>{if(n)try{n.scene.morphComplete.removeEventListener(se)}catch{console.error("morphCompleteHandler event not cleaned")}}},[n]),a.useEffect(()=>{const se=e.zoom,de=e.center;if(n&&$.isNumber(se)&&$.isArray(de)){const le=de[0],Ee=de[1],Ce=gi(se);n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:0});const De=n.homeButton.viewModel.command,Ae=function(ze){n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:1}),ze.cancel=!0};return De.beforeExecute.addEventListener(Ae),()=>{De.beforeExecute.removeEventListener(Ae);try{De.beforeExecute.removeEventListener(Ae)}catch{console.error("customHomeButtonHandler event not cleaned")}}}},[e.zoom,e.center,n]),a.useEffect(()=>{V(e.showZoomButtons??!0)},[e.showZoomButtons]);const z=()=>{te(se=>!se)},U=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[G&&oe&&i.jsx(J.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),I&&i.jsx(Mn,{locale:s}),i.jsxs(Q,{className:"bottomToolsContainer",children:[f&&i.jsx(_n,{projection:d}),C&&i.jsx(Dn,{locale:s,valueBy:"RENDERED_TILES"}),p&&i.jsx(Pn,{locale:s})]}),F&&i.jsx(In,{})]}),document.querySelector(".cesium-viewer")),[n,s,d,f,p,oe]),K=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[e.geocoderPanel&&i.jsx(Qi,{options:[...e.geocoderPanel],locale:s}),i.jsx(wi,{baseMaps:S,terrains:P,locale:s}),e.showDebuggerTool&&i.jsx(Li,{locale:s}),i.jsx(lo,{legendToggle:z})]}),document.querySelector(".cesium-viewer-toolbar")),[n,s,S,P]),ce=a.useCallback(()=>n&&ut.createPortal(i.jsx(Q,{className:"cesium-viewer-cesiumInspectorContainer widgetsContainer",children:j&&i.jsx(yi,{locale:s})}),document.querySelector(".cesium-widget")),[n,s]);return i.jsx(J.ThemeProvider,{id:"cesiumTheme",options:ve,children:i.jsx(Me.Viewer,{className:"viewer",full:!0,ref:t,...fe,children:i.jsxs(po,{value:H,children:[i.jsx(ao,{title:(me=e.legends)==null?void 0:me.title,isOpen:B,toggleSidebar:z,noLegendsText:(ye=e.legends)==null?void 0:ye.emptyText,legends:((Ie=e.legends)==null?void 0:Ie.legendsList)??_,actionsTexts:(Ge=e.legends)==null?void 0:Ge.actionsTexts}),e.children,U(),K(),ce(),e.imageryContextMenu&&L&&A&&ne&&a.cloneElement(e.imageryContextMenu,{data:(We=n==null?void 0:n.layersManager)==null?void 0:We.findLayerByPOI(A.x,A.y,!1),position:{x:A.x,y:A.y},coordinates:ne,style:D(A.x,A.y,((jn=e.imageryContextMenuSize)==null?void 0:jn.width)??xn,((Yn=e.imageryContextMenuSize)==null?void 0:Yn.height)??kn,((Zn=e.imageryContextMenuSize)==null?void 0:Zn.dynamicHeightIncrement)??ho),size:e.imageryContextMenuSize??{height:kn,width:xn},handleClose:()=>{k(!L)},contextEvt:N.current})]})})})},mo=0,yo=e=>{const t=pe();return i.jsx(Me.Cesium3DTileset,{...e,onReady:n=>{e.isZoomTo===!0&&t.zoomTo(n);const r=t.scene;r.globe.depthTestAgainstTerrain=!0;const s=g.Cartographic.fromCartesian(n.boundingSphere.center),o=e.heightFromGround??mo;if(o){const d=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),f=g.Cartesian3.subtract(h,d,new g.Cartesian3);n.modelMatrix=g.Matrix4.fromTranslation(f)}}})},ot=180,Nn=.001,Bn=e=>Math.abs(e)/e,Fn=e=>{ot-Math.abs(e[0])<Nn&&(e[0]=Bn(e[0])*(ot-1)),ot/2-Math.abs(e[1])<Nn&&(e[1]=Bn(e[1])*(ot/2-1))},Gn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(t=>{Fn(t)});break;case"Polygon":e.coordinates.forEach(t=>{t.forEach(n=>{Fn(n)})});break}},vo=e=>{const{data:t,...n}=e,r=$.cloneDeep(t);return r&&(typeof r.features<"u"?r.features.forEach(s=>{Gn(s.geometry)}):Gn(r)),i.jsx(Me.GeoJsonDataSource,{data:r,...n})},He=e=>{const{meta:t,...n}=e,r=pe();return a.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(t,t.searchLayerPredicate)},[t,r]),i.jsx(Me.ImageryLayer,{...n})},Eo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Sn(t,r):new g.WebMapServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},wo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new bn(t,r):new g.WebMapTileServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},To=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Ln(t,r):new g.UrlTemplateImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},Lo=e=>{const{options:t,...n}=e;return i.jsx(He,{...n,imageryProvider:new g.OpenStreetMapImageryProvider(t)})},So=e=>{const{options:t,meta:n,visualizationHandler:r,withGeometryValidation:s=!1}=e,{url:o,featureType:d,style:h,pageSize:f,zoomLevel:E,maxCacheSize:C,keyField:b,labeling:p}=t,{color:v,hover:I}=h,T=pe(),F=Fe(),V=a.useRef(F.viewState),j=a.useRef(new Map),Y=a.useRef(new Set),G=a.useRef(0),[X,W]=a.useState(n),Z=a.useMemo(()=>g.Color.fromCssColorString(I??"#24AEE9").withAlpha(.5),[I]),ee=a.useMemo(()=>`wfs_${d}_${Bt.v4()}`,[d]),l=a.useRef(!1);a.useEffect(()=>{V.current=F.viewState},[F.viewState]);const c=new g.GeoJsonDataSource(ee),_=D=>{const x=[],H=n.featureStructure;if(H&&H.fields)for(const U of H.fields){const{fieldName:K,aliasFieldName:ce}=U,me=ce,ye=D[K]??"N/A",Ie=Math.max(100,Math.min(180,me.length*10)),Ge="260px";x.push(`
7
7
  <tr>
8
8
  <td style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${Ie}px; display: table-cell;">
9
9
  <strong>${me}:</strong>
10
10
  </td>
11
- <td style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${Ve}; display: table-cell;" title="${ye}">
11
+ <td style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${Ge}; display: table-cell;" title="${ye}">
12
12
  ${ye}
13
13
  </td>
14
14
  </tr>
@@ -18,17 +18,17 @@
18
18
  ${x.join("")}
19
19
  </tbody>
20
20
  </table>
21
- `},y=O=>O?O.polyline?"polyline":"polygon":"",S=O=>{var z,U;const x=(U=(z=O==null?void 0:O.polygon)==null?void 0:z.hierarchy)==null?void 0:U.getValue(g.JulianDate.now());if(!x)return null;const H=x.positions;return g.BoundingSphere.fromPoints(H).center},w=O=>{const H=L.scene.drillPick(O).map(U=>U.id).filter(U=>U&&U.polygon&&U.entityCollection.owner.name===te);if(H.length===0)return null;const z=H.map(U=>{const K=S(U);if(!K)return{entity:U,distance:Number.MAX_VALUE};const ce=g.SceneTransforms.wgs84ToWindowCoordinates(L.scene,K);if(!ce)return{entity:U,distance:Number.MAX_VALUE};const me=O.x-ce.x,ye=O.y-ce.y,Ie=Math.sqrt(me*me+ye*ye);return{entity:U,distance:Ie}});return z.sort((U,K)=>K.distance-U.distance),z[0].entity},P=O=>{let x=null,H=null;O.setInputAction(z=>{if(L.scene.mode===g.SceneMode.SCENE2D){const K=L.scene.pick(z.endPosition);K&&K.id&&(K.id.polygon||K.id.polyline)?$.get(x,"id")!==$.get(K.id,"id")&&(x&&(x[y(x)].material=H,L.container.style.cursor="default"),x=K.id,H=x[y(x)].material,x[y(x)].material=Z,L.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,L.container.style.cursor="default")}else{const K=w(z.endPosition);K?$.get(x,"id")!==$.get(K,"id")&&(x&&(x[y(x)].material=H,L.container.style.cursor="default"),x=K,H=x[y(x)].material,x[y(x)].material=Z,L.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,L.container.style.cursor="default")}},g.ScreenSpaceEventType.MOUSE_MOVE)},m=(O,x)=>{const H=navigator.hardwareConcurrency||4;let z=Math.ceil(H*1.5);return x==="cpu"&&(z=Math.max(2,Math.ceil(H/2))),O>=C?Math.min(200,z*4):O>1e3?Math.min(100,z*2):O>300?Math.min(50,z):Math.min(10,z)},T=(O=-1,x=-1)=>{W(H=>({...H,...n,cache:Y.current.size,items:O,total:x,currentZoomLevel:G.current.currentZoomLevel}))},k=()=>{if(c.entities&&c.entities.values.length>0){c.show=!1,V.current=0;const O=L.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0];O&&(O.show=!1,L.dataSources.remove(O))}T(0,0)},N=async(O,x="GET",H)=>{const z={method:x};H!==void 0&&(z.body=H);const U=await fetch(O,z);if(U.status===200)return await U.json()},A=document.createElement("canvas"),D=A.getContext("2d"),B=O=>{const x={fontName:"sans-serif",fontSize:14,padding:4,fillStyle:"white",strokeStyle:"black",lineWidth:3},H=O.split(`
22
- `),z=(p==null?void 0:p.fontSize)??x.fontSize,U=(p==null?void 0:p.padding)??x.padding,K=z+2;D.clearRect(0,0,A.width,A.height),D.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`;const ce=Math.max(...H.map(Ie=>D.measureText(Ie).width)),me=document.createElement("canvas");me.width=ce+U*2,me.height=K*H.length+U*2;const ye=me.getContext("2d");return ye.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`,ye.fillStyle=(p==null?void 0:p.fillStyle)??x.fillStyle,ye.strokeStyle=(p==null?void 0:p.strokeStyle)??x.strokeStyle,ye.lineWidth=(p==null?void 0:p.lineWidth)??x.lineWidth,H.forEach((Ie,Ve)=>{const We=U+(Ve+1)*K-4;ye.strokeText(Ie,U,We),ye.fillText(Ie,U,We)}),{dataURL:me.toDataURL(),width:me.width,height:me.height}},ee=O=>p==null?void 0:p.text.pattern.replace(/\$\{([^}]+)\}/g,(H,z)=>{const U=p.text.fields.find(ce=>ce.name===z);let K="";if(U)if(U.predicate)K=U.predicate(O.properties[z]);else switch(U.type){case"date":K=Te.format(new Date(O.properties[z]),U.format??"dd/MM/yyyy");break;default:K=O.properties[z];break}return K}),ne=async(O,x)=>{const H=[];return O.length>0&&await ht(O,z=>{if(z.properties){const U=z.properties[b??"id"];let K=!0;if(s)try{K=pr(z.geometry),K||console.error("Skipped invalid WFS feature with",b??"id","->",U)}catch{K=!1,console.error("Skipped invalid WFS feature with",b??"id","->",U)}if(!Y.current.has(U)&&K){Y.current.add(U),z.properties.fetch_id=x;const ce=z.properties.description;if(z.properties.description=void 0,z.properties._description=ce,p){const me=B(ee(z));z.properties.label=me}H.push(z)}}},{concurrency:m(O.length,"cpu")}),H},q=(O,x)=>Array.from(j.current.values()).filter(H=>JSON.stringify(H.parentBBox)!==JSON.stringify(O)).reduce((H,z)=>{const U=qi(x,z.bbox);return U>H.distance?{id:z.id,key:z.bbox.join(","),distance:U}:H},{id:"",key:"",distance:-1/0}),R=async O=>{const x=[];await ht(c.entities.values,H=>{if(H.properties&&H.properties.fetch_id.getValue()===O){const z=H.properties[b??"id"].getValue();Y.current.delete(z),x.push(H)}},{concurrency:m(c.entities.values.length,"cpu")}),x.length>0&&await ht(x,H=>{c.entities.remove(H)},{concurrency:m(x.length,"cpu")})},ie=async(O,x)=>{for(;Y.current.size>C;){const H=q(O,x);if(H.id==="")break;await R(H.id),H.key&&j.current.delete(H.key)}},he=async(O,x,H,z)=>{let U="",K="",ce=[];if(O.numberReturned&&O.numberReturned!==0&&(O.bbox&&(K=O.bbox.join(","),j.current.has(K)||(U=Nt.v4())),ce=await ne(O.features,U),O.bbox&&ce.length>0&&!j.current.has(K)&&j.current.set(K,{id:U,parentBBox:x,bbox:O.bbox,timestamp:O.timeStamp,items:ce.length})),T(O.numberReturned!==0?H+O.numberReturned:O.numberMatched,O.numberMatched),ce.length===0){O.numberReturned&&O.numberReturned!==0?ve(++V.current*f):(V.current=0,fe(L,c,c.entities.values.map(ye=>ye.id),x));return}await ie(x,z);const me={type:"FeatureCollection",features:ce};await c.process(me,{describe:_}),L.scene.requestRender(),fe(L,c,ce.map(ye=>ye.id),x),O.numberReturned&&O.numberReturned!==0?ve(++V.current*f):V.current=0},ve=a.useCallback(async(O=0)=>{if(!L||L.scene.mode===g.SceneMode.MORPHING)return;const x=Yi(L);if(x){if(await oe(),G.current.currentZoomLevel>0&&G.current.currentZoomLevel<v&&(c==null?void 0:c.entities.values.length)>0){k();return}if(G.current.currentZoomLevel>=v){c.show=!0;const H=mn(x),z=ji(x);try{const U=o.includes("?")?"&":"?";let K=`${o}${U}service=WFS&version=2.0.0&request=GetFeature&typeNames=${d}&outputFormat=application/json&bbox=${H.join(",")},EPSG:4326&startIndex=${O}&count=${f}`;b&&(K+=`&sortBy=${b}%20ASC`);const ce=await N(K);await he(ce,H,O,z)}catch(U){console.error("Error fetching WFS data:",U),T(-1,-1)}}}},[]),oe=()=>new Promise(O=>{const x=setInterval(()=>{L.scene.globe.tilesLoaded&&(clearInterval(x),O())},100)}),fe=(O,x,H,z)=>{r?r(O,x,H,z):vn(O,x,H,E,z,p)};return a.useEffect(()=>{const O=L.dataSources.getByName(te)[0];O&&fe(L,O,[],void 0)},[L.scene.mode]),a.useEffect(()=>{L.layersManager&&L.layersManager.dataLayerList.length>0&&L.layersManager.findDataLayerById(n.id)!==void 0&&L.layersManager.addMetaToDataLayer(X)},[X]),a.useEffect(()=>{var O;(O=L.layersManager)==null||O.addDataLayer({options:t,meta:{...X},visualizationHandler:r})},[L.layersManager]),a.useEffect(()=>{L.dataSources.add(c);const O=()=>{ve()};L.scene.camera.moveEnd.addEventListener(O);const x=new g.ScreenSpaceEventHandler(L.scene.canvas);return P(x),G.current.currentZoomLevel>0&&(ve(),l.current=!0),()=>{var H;$.get(L,"_cesiumWidget")!==void 0&&(Y.current.clear(),j.current.clear(),L.dataSources.remove(L.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0]),L.dataSources.remove(c,!0),(H=L.layersManager)==null||H.removeDataLayer(n.id),L.scene.camera.moveEnd.removeEventListener(O),x.removeInputAction(g.ScreenSpaceEventType.MOUSE_MOVE))}},[]),null},Vn=e=>i.jsx(Me.Entity,{...e}),So=e=>i.jsx(Me.EntityDescription,{...e}),Gn=e=>i.jsx(Me.EntityDescription,{...e}),Hn=e=>i.jsx(Me.PolygonGraphics,{...e}),Wn=e=>i.jsx(Me.RectangleGraphics,{...e}),zn=e=>i.jsx(Me.CustomDataSource,{...e}),bo=e=>i.jsx(Me.PolylineGraphics,{...e}),Is="";var xe=function(){var e=M.Ellipsoid.WGS84,t,n=M.Material.fromType(M.Material.ColorType);function r(l,c=new M.Color(1,1,0,.5),_=new M.Color(1,1,1,1)){this._scene=l.scene,n.uniforms.color=c,t=_,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}r.prototype.initialiseHandlers=function(){var l=this._scene,c=this,_=new M.ScreenSpaceEventHandler(l.canvas);function y(w,P){if(c._handlersMuted!=!0){var m=l.pick(P);m&&m.primitive&&m.primitive[w]&&m.primitive[w](P)}}_.setInputAction(function(w){y("leftClick",w.position)},M.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(w){y("leftDoubleClick",w.position)},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var S;_.setInputAction(function(w){if(c._handlersMuted!=!0){var P=l.pick(w.endPosition);S&&(!P||S!=P.primitive)&&(!(S.isDestroyed&&S.isDestroyed())&&S.mouseOut(w.endPosition),S=null),P&&P.primitive&&(P=P.primitive,P.mouseOut&&(S=P),P.mouseMove&&P.mouseMove(w.endPosition))}},M.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(w){y("leftUp",w.position)},M.ScreenSpaceEventType.LEFT_UP),_.setInputAction(function(w){y("leftDown",w.position)},M.ScreenSpaceEventType.LEFT_DOWN)},r.prototype.setListener=function(l,c,_){l[c]=_},r.prototype.muteHandlers=function(l){this._handlersMuted=l},r.prototype.registerEditableShape=function(l){var c=this;Z(l,"mouseMove",function(_){l.setHighlighted(!0),l._editMode||c._tooltip.showAt(_,"Click to edit this shape")}),Z(l,"mouseOut",function(_){l.setHighlighted(!1),c._tooltip.setVisible(!1)}),Z(l,"leftClick",function(_){l.setEditMode(!0)})},r.prototype.startDrawing=function(l){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=l,this.muteHandlers(!0)},r.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},r.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},r.prototype.setHighlighted=function(l){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=l&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=l},r.prototype.disableAllEditMode=function(){this.setEdited(void 0)},r.prototype.setEdited=function(l){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=l};var s={ellipsoid:M.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=W(s,{appearance:new M.EllipsoidSurfaceAppearance({aboveGround:!1}),material:n,granularity:Math.PI/180}),d=W(s,{}),h=W(s,{}),f=W(s,{}),v=W(o,{rotation:0}),C=W(s,{width:5,geodesic:!0,granularity:1e4,appearance:new M.PolylineMaterialAppearance({aboveGround:!1}),material:n}),b=function(){function l(){}return l.prototype.initialiseOptions=function(c){X(this,c),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},l.prototype.setAttribute=function(c,_){this[c]=_,this._createPrimitive=!0},l.prototype.getAttribute=function(c){return this[c]},l.prototype.update=function(c,_,y){if(!M.defined(this.ellipsoid))throw new M.DeveloperError("this.ellipsoid must be defined.");if(!M.defined(this.appearance))throw new M.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new M.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!M.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var S=this.getGeometry();if(!S)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:S,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:M.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new M.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var w=this._primitive;w.appearance.material=this.material,w.debugShowBoundingVolume=this.debugShowBoundingVolume,w.update(c,_,y),this._outlinePolygon&&this._outlinePolygon.update(c,_,y)}},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),M.destroyObject(this)},l.prototype.setStrokeStyle=function(c,_){(!this.strokeColor||!this.strokeColor.equals(c)||this.strokeWidth!=_)&&(this._createPrimitive=!0,this.strokeColor=c,this.strokeWidth=_)},l}();r.ExtentPrimitive=function(){function l(c){if(!M.defined(c.extent))throw new M.DeveloperError("Extent is required");c=W(c,o),this.initialiseOptions(c),this.setExtent(c.extent)}return l.prototype=new b,l.prototype.setExtent=function(c){this.setAttribute("extent",c)},l.prototype.getExtent=function(){return this.getAttribute("extent")},l.prototype.getGeometry=function(){if(M.defined(this.extent))return new M.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.RectangleOutlineGeometry({rectangle:this.extent})},l}(),r.PolygonPrimitive=function(){function l(c){c=W(c,o),this.initialiseOptions(c),this.isPolygon=!0}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<3))return M.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return M.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},l}(),r.CirclePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.radius)))throw new M.DeveloperError("Center and radius are required");c=W(c,o),this.initialiseOptions(c),this.setRadius(c.radius)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setRadius=function(c){this.setAttribute("radius",Math.max(.1,c))},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getRadius=function(){return this.getAttribute("radius")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.radius))return new M.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},l}(),r.EllipsePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.semiMajorAxis)&&M.defined(c.semiMinorAxis)))throw new M.DeveloperError("Center and semi major and semi minor axis are required");c=W(c,v),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setSemiMajorAxis=function(c){c<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",c)},l.prototype.setSemiMinorAxis=function(c){c>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",c)},l.prototype.setRotation=function(c){return this.setAttribute("rotation",c)},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},l.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},l.prototype.getRotation=function(){return this.getAttribute("rotation")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.semiMajorAxis)&&M.defined(this.semiMinorAxis))return new M.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},l}(),r.PolylinePrimitive=function(){function l(c){c=W(c,C),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.setWidth=function(c){this.setAttribute("width",c)},l.prototype.setGeodesic=function(c){this.setAttribute("geodesic",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getWidth=function(){return this.getAttribute("width")},l.prototype.getGeodesic=function(c){return this.getAttribute("geodesic")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<2))return new M.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},l}();var p={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},E={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},I={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};r.prototype.createBillboardGroup=function(l,c,_){var y=new r.BillboardGroup(this,c);return y.addBillboards(l,_),y},r.BillboardGroup=function(l,c){this._drawHelper=l,this._scene=l._scene,this._options=W(c,p);var _=new M.BillboardCollection;this._scene.primitives.add(_),this._billboards=_,this._orderedBillboards=[]},r.BillboardGroup.prototype.createBillboard=function(l,c){var _=this._billboards.add({show:!0,position:l,pixelOffset:new M.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new M.Cartesian3(0,0,0),horizontalOrigin:M.HorizontalOrigin.CENTER,verticalOrigin:M.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:t});if(c){let w=function(m){S.enableRotate=m},P=function(){for(var m=0,T=y._orderedBillboards.length;m<T&&y._orderedBillboards[m]!=_;++m);return m};var y=this,S=this._scene.screenSpaceCameraController;if(c.dragHandlers){var y=this;Z(_,"leftDown",function(T){function k(D){_.position=D;for(var B=0,ee=y._orderedBillboards.length;B<ee&&y._orderedBillboards[B]!=_;++B);c.dragHandlers.onDrag&&c.dragHandlers.onDrag(P(),D)}function N(D){A.destroy(),w(!0),c.dragHandlers.onDragEnd&&c.dragHandlers.onDragEnd(P(),D)}var A=new M.ScreenSpaceEventHandler(y._scene.canvas);A.setInputAction(function(D){var B=y._scene.camera.pickEllipsoid(D.endPosition,e);B?k(B):N(B)},M.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(D){N(y._scene.camera.pickEllipsoid(D.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1),c.dragHandlers.onDragStart&&c.dragHandlers.onDragStart(P(),y._scene.camera.pickEllipsoid(T,e))})}c.onDoubleClick&&Z(_,"leftDoubleClick",function(m){c.onDoubleClick(P())}),c.onClick&&Z(_,"leftClick",function(m){c.onClick(P())}),c.tooltip&&(Z(_,"mouseMove",function(m){y._drawHelper._tooltip.showAt(m,c.tooltip())}),Z(_,"mouseOut",function(m){y._drawHelper._tooltip.setVisible(!1)}))}return _},r.BillboardGroup.prototype.insertBillboard=function(l,c,_){this._orderedBillboards.splice(l,0,this.createBillboard(c,_))},r.BillboardGroup.prototype.addBillboard=function(l,c){this._orderedBillboards.push(this.createBillboard(l,c))},r.BillboardGroup.prototype.addBillboards=function(l,c){for(var _=0;_<l.length;_++)this.addBillboard(l[_],c)},r.BillboardGroup.prototype.updateBillboardsPositions=function(l){for(var c=0;c<l.length;c++)this.getBillboard(c).position=l[c]},r.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},r.BillboardGroup.prototype.getBillboard=function(l){return this._orderedBillboards[l]},r.BillboardGroup.prototype.removeBillboard=function(l){this._billboards.remove(this.getBillboard(l)),this._orderedBillboards.splice(l,1)},r.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},r.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},r.prototype.startDrawingMarker=function(c){var c=W(c,p);this.startDrawing(function(){w.remove(),P.destroy(),S.setVisible(!1)});var _=this,y=this._scene;y.primitives;var S=this._tooltip,w=new r.BillboardGroup(this,c),P=new M.ScreenSpaceEventHandler(y.canvas);P.setInputAction(function(m){if(m.position!=null){var T=y.camera.pickEllipsoid(m.position,e);T&&(w.addBillboard(T),_.stopDrawing(),c.callback(T))}},M.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(m){var T=m.endPosition;if(T!=null){var k=y.camera.pickEllipsoid(T,e);k?S.showAt(T,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(k))):S.showAt(T,"<p>Click on the globe to add your marker.</p>")}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingPolygon=function(c){var c=W(c,o);this.startDrawingPolyshape(!0,c)},r.prototype.startDrawingPolyline=function(c){var c=W(c,C);this.startDrawingPolyshape(!1,c)},r.prototype.startDrawingPolyshape=function(l,c){this.startDrawing(function(){S.remove(m),k.remove(),N.destroy(),w.setVisible(!1),G(y)});var _=this,y=this._scene,S=y.primitives,w=this._tooltip,P=l?3:2,m;l?m=new xe.PolygonPrimitive(c):m=new xe.PolylinePrimitive(c),m.asynchronous=!1,S.add(m);var T=[],k=new r.BillboardGroup(this,p),N=new M.ScreenSpaceEventHandler(y.canvas);F(y),N.setInputAction(function(A){if(A.position!=null){var D=y.camera.pickEllipsoid(A.position,e);D&&(T.length==0&&(T.push(D.clone()),k.addBillboard(T[0])),T.length>=P&&(m.positions=T,m._createPrimitive=!0),T.push(D),k.addBillboard(D))}},M.ScreenSpaceEventType.LEFT_CLICK),N.setInputAction(function(A){var D=A.endPosition;if(D!=null)if(T.length==0)w.showAt(D,"<p>Click to add first point</p>");else{var B=y.camera.pickEllipsoid(D,e);B&&(T.pop(),B.y+=1+Math.random(),T.push(B),T.length>=P&&(m.positions=T,m._createPrimitive=!0),k.getBillboard(T.length-1).position=B,w.showAt(D,"<p>Click to add new point ("+T.length+")</p>"+(T.length>P?"<p>Double click to finish drawing</p>":"")))}},M.ScreenSpaceEventType.MOUSE_MOVE),N.setInputAction(function(A){var D=A.position;if(D!=null){if(T.length<P+2)return;var B=y.camera.pickEllipsoid(D,e);B&&(G(y),_.stopDrawing(),typeof c.callback=="function"&&(T.length-1,c.callback(T)))}},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function L(l){return e.cartographicArrayToCartesianArray([M.Rectangle.northwest(l),M.Rectangle.northeast(l),M.Rectangle.southeast(l),M.Rectangle.southwest(l)])}function F(l){l&&(l.canvas.style.cursor="crosshair")}function G(l){l&&(l.canvas.style.cursor="")}r.prototype.startDrawingExtent=function(c){var c=W(c,o);this.startDrawing(function(){m!=null&&S.remove(m),T!=null&&T.remove(),k.destroy(),w.setVisible(!1),G(y)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,T=null,k=new M.ScreenSpaceEventHandler(y.canvas);F(y);function N(A){m==null&&(m=new xe.ExtentPrimitive({extent:A,material:c.material}),m.asynchronous=!1,S.add(m)),m.setExtent(A);var D=L(A);T==null?(T=new r.BillboardGroup(_,p),T.addBillboards(D)):T.updateBillboardsPositions(D)}k.setInputAction(function(A){if(A.position!=null){var D=y.camera.pickEllipsoid(A.position,e);if(D)if(m==null){P=e.cartesianToCartographic(D);var B=j(P,P);N(B)}else _.stopDrawing(),typeof c.callback=="function"&&c.callback(j(P,e.cartesianToCartographic(D)))}},M.ScreenSpaceEventType.LEFT_DOWN),k.setInputAction(function(A){var D=A.endPosition;if(D!=null)if(m==null)w.showAt(D,"<p>Click to start drawing rectangle</p>");else{var B=y.camera.pickEllipsoid(D,e);if(B){var ee=j(P,e.cartesianToCartographic(B));N(ee),w.showAt(D,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingCircle=function(c){var c=W(c,o);this.startDrawing(function(){P!=null&&S.remove(P),m.remove(),T.destroy(),w.setVisible(!1)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,T=new M.ScreenSpaceEventHandler(y.canvas);T.setInputAction(function(k){if(k.position!=null){var N=y.camera.pickEllipsoid(k.position,e);N&&(P==null?(P=new r.CirclePrimitive({center:N,radius:0,asynchronous:!1,material:c.material}),S.add(P),m=new r.BillboardGroup(_,p),m.addBillboards([N])):(typeof c.callback=="function"&&c.callback(P.getCenter(),P.getRadius()),_.stopDrawing()))}},M.ScreenSpaceEventType.LEFT_DOWN),T.setInputAction(function(k){var N=k.endPosition;if(N!=null)if(P==null)w.showAt(N,"<p>Click to start drawing the circle</p>");else{var A=y.camera.pickEllipsoid(N,e);A&&(P.setRadius(M.Cartesian3.distance(P.getCenter(),A)),m.updateBillboardsPositions(A),w.showAt(N,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.enhancePrimitives=function(){var l=this;M.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var y=this,S=this;function w(P){l._scene.screenSpaceCameraController.enableRotate=P}Z(y,"leftDown",function(P){function m(N){y.position=N,S.executeListeners({name:"drag",positions:N})}function T(N){k.destroy(),w(!0),S.executeListeners({name:"dragEnd",positions:N})}var k=new M.ScreenSpaceEventHandler(l._scene.canvas);k.setInputAction(function(N){var A=l._scene.camera.pickEllipsoid(N.endPosition,e);A?m(A):T(A)},M.ScreenSpaceEventType.MOUSE_MOVE),k.setInputAction(function(N){T(l._scene.camera.pickEllipsoid(N.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1)}),te(y)};function c(y){l._scene,!(this._highlighted&&this._highlighted==y)&&this._editMode!==!0&&(this._highlighted=y,y?(l.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(M.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function _(y){if(this._editMode!=y)if(l.disableAllHighlights(),y){l.setEdited(this);var S=l._scene,w=this;if(this._markers==null){let B=function(q,R){var ie=q-1<0?R.length-1:q-1;ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie)),ie=q,ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie))},ee=function(){w.executeListeners({name:"onEdited",positions:w.positions})},ne=function(q){var R=w.positions;return e.cartographicToCartesian(new M.EllipsoidGeodesic(e.cartesianToCartographic(R[q]),e.cartesianToCartographic(R[q<R.length-1?q+1:0])).interpolateUsingFraction(.5))};var P=new r.BillboardGroup(l,E),m=new r.BillboardGroup(l,I),T={dragHandlers:{onDrag:function(q,R){w.positions[q]=R,B(q,w.positions),w._createPrimitive=!0},onDragEnd:function(q,R){w._createPrimitive=!0,ee()}},onDoubleClick:function(q){w.positions.length<4||(w.positions.splice(q,1),w._createPrimitive=!0,P.removeBillboard(q),m.removeBillboard(q),B(q,w.positions),ee())},tooltip:function(){if(w.positions.length>3)return"Double click to remove this point"}};P.addBillboards(w.positions,T),this._markers=P;for(var k=[],N=0,A=w.positions.length+(this.isPolygon?0:-1);N<A;N++)k.push(ne(N));var D={dragHandlers:{onDragStart:function(q,R){this.index=q+1,w.positions.splice(this.index,0,R),w._createPrimitive=!0},onDrag:function(q,R){w.positions[this.index]=R,w._createPrimitive=!0},onDragEnd:function(q,R){P.insertBillboard(this.index,R,T),m.getBillboard(this.index-1).position=ne(this.index-1),m.insertBillboard(this.index,ne(this.index),D),w._createPrimitive=!0,ee()}},tooltip:function(){return"Drag to create a new point"}};m.addBillboards(k,D),this._editMarkers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(q){var R=S.pick(q.position);R&&R.primitive||w.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.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}xe.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this;y.isPolygon=!1,y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=_;var S=this.width;y.setHighlighted=function(w){this._editMode!==!0&&(w?(l.setHighlighted(this),this.setWidth(S*2)):this.setWidth(S))},y.getExtent=function(){return M.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},te(y),y.setEditMode(!1)}},xe.PolygonPrimitive.prototype.setEditable=function(){var y=this;y.asynchronous=!1,l._scene,l.registerEditableShape(y),y.setEditMode=_,y.setHighlighted=c,te(y),y.setEditMode(!1)},xe.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;l.registerEditableShape(y),y.asynchronous=!1,y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){if(l.setEdited(this),this._markers==null){let T=function(){y.executeListeners({name:"onEdited",extent:y.extent})};var P=new r.BillboardGroup(l,E),m={dragHandlers:{onDrag:function(k,N){var A=P.getBillboard((k+2)%4).position;y.setExtent(j(e.cartesianToCartographic(A),e.cartesianToCartographic(N))),P.updateBillboardsPositions(L(y.extent))},onDragEnd:function(k,N){T()}},tooltip:function(){return"Drag to change the corners of this extent"}};P.addBillboards(L(y.extent),m),this._markers=P,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(k){var N=S.pick(k.position);N&&!N.isDestroyed()&&N.primitive||y.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}},r.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return M.EllipseOutlineGeometry(e,y.getCenter(),y.getSemiMajorAxis(),y.getSemiMinorAxis(),y.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),semiMajorAxis:y.getSemiMajorAxis(),semiMinorAxis:y.getSemiMinorAxis(),rotation:0})};var m=new r.BillboardGroup(l,E),T={dragHandlers:{onDrag:function(A,D){var B=M.Cartesian3.distance(y.getCenter(),D);A%2==0?y.setSemiMajorAxis(B):y.setSemiMinorAxis(B),m.updateBillboardsPositions(k())},onDragEnd:function(A,D){N()}},tooltip:function(){return"Drag to change the excentricity and radius"}};m.addBillboards(k(),T),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var D=S.pick(A.position);D&&D.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}},r.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(y){for(var S=M.CircleOutlineGeometry.createGeometry(new M.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:y})),w=0,P,m=[];w<S.attributes.position.values.length;w+=3)P=S.attributes.position.values,m.push(new M.Cartesian3(P[w],P[w+1],P[w+2]));return m},r.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return P.getCircleCartesianCoordinates(M.Math.PI_OVER_TWO)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),radius:y.getRadius()})};var m=new r.BillboardGroup(l,E),T={dragHandlers:{onDrag:function(A,D){y.setRadius(M.Cartesian3.distance(y.getCenter(),D)),m.updateBillboardsPositions(k())},onDragEnd:function(A,D){N()}},tooltip:function(){return"Drag to change the radius"}};m.addBillboards(k(),T),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var D=S.pick(A.position);D&&D.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}}},r.DrawHelperWidget=function(){function l(c,_){if(!M.defined(_.container))throw new M.DeveloperError("Container is required");var y={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:C,polygonDrawingOptions:d,extentDrawingOptions:h,circleDrawingOptions:f};X(_,y);var S=this,w=document.createElement("DIV");w.className="toolbar",_.container.appendChild(w);function P(k,N,A,D){var B=document.createElement("DIV");B.className="button",B.title=A,w.appendChild(B),B.onclick=D;var ee=document.createElement("SPAN");B.appendChild(ee);var ne=document.createElement("IMG");return ne.src=N,ee.appendChild(ne),B}var m=c._scene;P("marker",_.markerIcon,"Click to start drawing a 2D marker",function(){c.startDrawingMarker({callback:function(k){S.executeListeners({name:"markerCreated",position:k})}})}),P("polyline",_.polylineIcon,"Click to start drawing a 2D polyline",function(){c.startDrawingPolyline({callback:function(k){S.executeListeners({name:"polylineCreated",positions:k})}})}),P("polygon",_.polygonIcon,"Click to start drawing a 2D polygon",function(){c.startDrawingPolygon({callback:function(k){S.executeListeners({name:"polygonCreated",positions:k})}})}),P("extent",_.extentIcon,"Click to start drawing an Extent",function(){c.startDrawingExtent({callback:function(k){S.executeListeners({name:"extentCreated",extent:k})}})}),P("circle",_.circleIcon,"Click to start drawing a Circle",function(){c.startDrawingCircle({callback:function(k,N){S.executeListeners({name:"circleCreated",center:k,radius:N})}})});var T=document.createElement("DIV");T.className="divider",w.appendChild(T),P("clear",_.clearIcon,"Remove all primitives",function(){m.primitives.removeAll()}),te(this)}return l}(),r.prototype.addToolbar=function(l,c){return c=W(c,{container:l}),new r.DrawHelperWidget(this,c)};function j(l,c){var _=new M.Rectangle;_.west=Math.min(l.longitude,c.longitude),_.east=Math.max(l.longitude,c.longitude),_.south=Math.min(l.latitude,c.latitude),_.north=Math.max(l.latitude,c.latitude);var y=M.Math.EPSILON7;return _.east-_.west<y&&(_.east+=y*2),_.north-_.south<y&&(_.north+=y*2),_}function Y(l,c){return l.longitude.toFixed(c||3)+", "+l.latitude.toFixed(c||3)}function V(l,c){if(l==null||typeof l!="object"||l.constructor!=Object&&l.constructor!=Array)return l;if(l.constructor==Date||l.constructor==RegExp||l.constructor==Function||l.constructor==String||l.constructor==Number||l.constructor==Boolean)return new l.constructor(l);c=c||new l.constructor;for(var _ in l)c[_]=typeof c[_]>"u"?V(l[_],null):c[_];return c}function X(l,c){l=l||{};var _;for(_ in c)l[_]===void 0&&(l[_]=V(c[_]))}function W(l,c){var _=V(l),y;for(y in c)_[y]===void 0&&(_[y]=V(c[y]));return _}function Z(l,c,_){l[c]=_}function te(l){l._listeners={},l.addListener=function(c,_){return this._listeners[c]=this._listeners[c]||[],this._listeners[c].push(_),this._listeners[c].length},l.executeListeners=function(c,_){if(this._listeners[c.name]&&this._listeners[c.name].length>0)for(var y=0;y<this._listeners[c.name].length;y++)this._listeners[c.name][y](c);else _&&_(c)}}return r}();const Co=e=>{const t=e.map(n=>{const r=g.Cartographic.fromCartesian(n);return[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]});return t.push(t[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[t]}}},Mo=e=>{const t=Gt.lineString([[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south)],[g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)]]);return je(qe(t))},_o=2,Po=(e,t)=>{switch(e){case we.BOX:{if(t.features.length!==_o)throw new Error(`${e} must have 2 points`);const n=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.BOTTOM_LEFT}),r=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.TOP_RIGHT});if(r&&n){if(n.geometry.coordinates[0]===r.geometry.coordinates[0]&&n.geometry.coordinates[1]===r.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return g.Rectangle.fromDegrees(n.geometry.coordinates[0],n.geometry.coordinates[1],r.geometry.coordinates[0],r.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`)}},Io=e=>{const t=Gt.lineString([[e.west,e.south],[e.east,e.north]]);return je(qe(t)).geometry.coordinates[0].map(r=>g.Cartesian3.fromRadiansArray(r)[0])},Ao=e=>{const{drawState:t,drawingMaterial:n,drawingVertexColor:r,material:s,hollow:o,outlineWidth:d}=e,h=pe(),[f,v]=a.useState();a.useEffect(()=>{v(new xe(h,n,r))},[]),a.useEffect(()=>{if(f){const b=f;if(t.drawing)switch(t.type){case we.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingPolygon({callback:p=>{t.handler({primitive:p,type:we.POLYGON,geojson:Co(p)})}});break;case we.BOX:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingExtent({callback:p=>{t.handler({primitive:p,type:we.BOX,geojson:Mo(p)})}});break;default:throw new Error(`[CESIUM DRAW]: ${t.type} unrecognized primitive to draw.`)}else b.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[t,f]);const C=b=>{try{let p=b.coordinates!==void 0?b.coordinates:Po(b.type,b.geojson);if(o!==!0)switch(b.type){case we.BOX:return i.jsx(Wn,{coordinates:p,material:s??n});case we.POLYGON:return i.jsx(Hn,{hierarchy:new g.PolygonHierarchy(p),material:s??n});default:return i.jsx(i.Fragment,{})}else{switch(b.type){case we.BOX:p=Io(p);break;case we.POLYGON:p=[...p,p[0]];break;default:return i.jsx(i.Fragment,{})}return i.jsx(bo,{clampToGround:!0,positions:p,width:d??1,material:s??n})}}catch(p){return console.error(p),i.jsx(i.Fragment,{})}};return i.jsx(zn,{...e,children:e.drawings.map((b,p)=>i.jsxs(Vn,{name:b.name,children:[i.jsxs(Gn,{children:[i.jsxs("h1",{children:["Drawed Entity ",b.name]}),i.jsx("p",{children:"This is description of drawed entity"})]}),C(b)]},b.id))})},Oo=()=>{const e=pe();return a.useEffect(()=>{e.extend(g.viewerCesiumInspectorMixin)},[e]),null},Do=-25,Un=2,ko=e=>{const t=pe(),n=(o,d=",")=>o.slice(o.indexOf(`
21
+ `},y=D=>D?D.polyline?"polyline":"polygon":"",S=D=>{var z,U;const x=(U=(z=D==null?void 0:D.polygon)==null?void 0:z.hierarchy)==null?void 0:U.getValue(g.JulianDate.now());if(!x)return null;const H=x.positions;return g.BoundingSphere.fromPoints(H).center},w=D=>{const H=T.scene.drillPick(D).map(U=>U.id).filter(U=>U&&U.polygon&&U.entityCollection.owner.name===ee);if(H.length===0)return null;const z=H.map(U=>{const K=S(U);if(!K)return{entity:U,distance:Number.MAX_VALUE};const ce=g.SceneTransforms.wgs84ToWindowCoordinates(T.scene,K);if(!ce)return{entity:U,distance:Number.MAX_VALUE};const me=D.x-ce.x,ye=D.y-ce.y,Ie=Math.sqrt(me*me+ye*ye);return{entity:U,distance:Ie}});return z.sort((U,K)=>K.distance-U.distance),z[0].entity},P=D=>{let x=null,H=null;D.setInputAction(z=>{if(T.scene.mode===g.SceneMode.SCENE2D){const K=T.scene.pick(z.endPosition);K&&K.id&&(K.id.polygon||K.id.polyline)?$.get(x,"id")!==$.get(K.id,"id")&&(x&&(x[y(x)].material=H,T.container.style.cursor="default"),x=K.id,H=x[y(x)].material,x[y(x)].material=Z,T.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,T.container.style.cursor="default")}else{const K=w(z.endPosition);K?$.get(x,"id")!==$.get(K,"id")&&(x&&(x[y(x)].material=H,T.container.style.cursor="default"),x=K,H=x[y(x)].material,x[y(x)].material=Z,T.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,T.container.style.cursor="default")}},g.ScreenSpaceEventType.MOUSE_MOVE)},m=(D,x)=>{const H=navigator.hardwareConcurrency||4;let z=Math.ceil(H*1.5);return x==="cpu"&&(z=Math.max(2,Math.ceil(H/2))),D>=C?Math.min(200,z*4):D>1e3?Math.min(100,z*2):D>300?Math.min(50,z):Math.min(10,z)},L=(D=-1,x=-1)=>{W(H=>({...H,...n,cache:Y.current.size,items:D,total:x,currentZoomLevel:V.current.currentZoomLevel}))},k=()=>{if(c.entities&&c.entities.values.length>0){c.show=!1,G.current=0;const D=T.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0];D&&(D.show=!1,T.dataSources.remove(D))}L(0,0)},N=async(D,x="GET",H)=>{const z={method:x};H!==void 0&&(z.body=H);const U=await fetch(D,z);if(U.status===200)return await U.json()},A=document.createElement("canvas"),O=A.getContext("2d"),B=D=>{const x={fontName:"sans-serif",fontSize:14,padding:4,fillStyle:"white",strokeStyle:"black",lineWidth:3},H=D.split(`
22
+ `),z=(p==null?void 0:p.fontSize)??x.fontSize,U=(p==null?void 0:p.padding)??x.padding,K=z+2;O.clearRect(0,0,A.width,A.height),O.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`;const ce=Math.max(...H.map(Ie=>O.measureText(Ie).width)),me=document.createElement("canvas");me.width=ce+U*2,me.height=K*H.length+U*2;const ye=me.getContext("2d");return ye.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`,ye.fillStyle=(p==null?void 0:p.fillStyle)??x.fillStyle,ye.strokeStyle=(p==null?void 0:p.strokeStyle)??x.strokeStyle,ye.lineWidth=(p==null?void 0:p.lineWidth)??x.lineWidth,H.forEach((Ie,Ge)=>{const We=U+(Ge+1)*K-4;ye.strokeText(Ie,U,We),ye.fillText(Ie,U,We)}),{dataURL:me.toDataURL(),width:me.width,height:me.height}},te=D=>p==null?void 0:p.text.pattern.replace(/\$\{([^}]+)\}/g,(H,z)=>{const U=p.text.fields.find(ce=>ce.name===z);let K="";if(U)if(U.predicate)K=U.predicate(D.properties[z]);else switch(U.type){case"date":K=Le.format(new Date(D.properties[z]),U.format??"dd/MM/yyyy");break;default:K=D.properties[z];break}return K}),ne=async(D,x)=>{const H=[];return D.length>0&&await ht(D,z=>{if(z.properties){const U=z.properties[b??"id"];let K=!0;if(s)try{K=fr(z.geometry),K||console.error("Skipped invalid WFS feature with",b??"id","->",U)}catch{K=!1,console.error("Skipped invalid WFS feature with",b??"id","->",U)}if(!Y.current.has(U)&&K){Y.current.add(U),z.properties.fetch_id=x;const ce=z.properties.description;if(z.properties.description=void 0,z.properties._description=ce,p){const me=B(te(z));z.properties.label=me}H.push(z)}}},{concurrency:m(D.length,"cpu")}),H},q=(D,x)=>Array.from(j.current.values()).filter(H=>JSON.stringify(H.parentBBox)!==JSON.stringify(D)).reduce((H,z)=>{const U=ji(x,z.bbox);return U>H.distance?{id:z.id,key:z.bbox.join(","),distance:U}:H},{id:"",key:"",distance:-1/0}),R=async D=>{const x=[];await ht(c.entities.values,H=>{if(H.properties&&H.properties.fetch_id.getValue()===D){const z=H.properties[b??"id"].getValue();Y.current.delete(z),x.push(H)}},{concurrency:m(c.entities.values.length,"cpu")}),x.length>0&&await ht(x,H=>{c.entities.remove(H)},{concurrency:m(x.length,"cpu")})},ie=async(D,x)=>{for(;Y.current.size>C;){const H=q(D,x);if(H.id==="")break;await R(H.id),H.key&&j.current.delete(H.key)}},ge=async(D,x,H,z)=>{let U="",K="",ce=[];if(D.numberReturned&&D.numberReturned!==0&&(D.bbox&&(K=D.bbox.join(","),j.current.has(K)||(U=Bt.v4())),ce=await ne(D.features,U),D.bbox&&ce.length>0&&!j.current.has(K)&&j.current.set(K,{id:U,parentBBox:x,bbox:D.bbox,timestamp:D.timeStamp,items:ce.length})),L(D.numberReturned!==0?H+D.numberReturned:D.numberMatched,D.numberMatched),ce.length===0){D.numberReturned&&D.numberReturned!==0?ve(++G.current*f):(G.current=0,fe(T,c,c.entities.values.map(ye=>ye.id),x));return}await ie(x,z);const me={type:"FeatureCollection",features:ce};await c.process(me,{describe:_}),T.scene.requestRender(),fe(T,c,ce.map(ye=>ye.id),x),D.numberReturned&&D.numberReturned!==0?ve(++G.current*f):G.current=0},ve=a.useCallback(async(D=0)=>{if(!T||T.scene.mode===g.SceneMode.MORPHING)return;const x=Zi(T);if(x){if(await oe(),V.current.currentZoomLevel>0&&V.current.currentZoomLevel<E&&(c==null?void 0:c.entities.values.length)>0){k();return}if(V.current.currentZoomLevel>=E){c.show=!0;const H=yn(x),z=Yi(x);try{const U=o.includes("?")?"&":"?";let K=`${o}${U}service=WFS&version=2.0.0&request=GetFeature&typeNames=${d}&outputFormat=application/json&bbox=${H.join(",")},EPSG:4326&startIndex=${D}&count=${f}`;b&&(K+=`&sortBy=${b}%20ASC`);const ce=await N(K);await ge(ce,H,D,z)}catch(U){console.error("Error fetching WFS data:",U),L(-1,-1)}}}},[]),oe=()=>new Promise(D=>{const x=setInterval(()=>{T.scene.globe.tilesLoaded&&(clearInterval(x),D())},100)}),fe=(D,x,H,z)=>{r?r(D,x,H,z):En(D,x,H,v,z,p)};return a.useEffect(()=>{const D=T.dataSources.getByName(ee)[0];D&&fe(T,D,[],void 0)},[T.scene.mode]),a.useEffect(()=>{T.layersManager&&T.layersManager.dataLayerList.length>0&&T.layersManager.findDataLayerById(n.id)!==void 0&&T.layersManager.addMetaToDataLayer(X)},[X]),a.useEffect(()=>{var D;(D=T.layersManager)==null||D.addDataLayer({options:t,meta:{...X},visualizationHandler:r})},[T.layersManager]),a.useEffect(()=>{T.dataSources.add(c);const D=()=>{ve()};T.scene.camera.moveEnd.addEventListener(D);const x=new g.ScreenSpaceEventHandler(T.scene.canvas);return P(x),V.current.currentZoomLevel>0&&(ve(),l.current=!0),()=>{var H;$.get(T,"_cesiumWidget")!==void 0&&(Y.current.clear(),j.current.clear(),T.dataSources.remove(T.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0]),T.dataSources.remove(c,!0),(H=T.layersManager)==null||H.removeDataLayer(n.id),T.scene.camera.moveEnd.removeEventListener(D),x.removeInputAction(g.ScreenSpaceEventType.MOUSE_MOVE))}},[]),null},Vn=e=>i.jsx(Me.Entity,{...e}),bo=e=>i.jsx(Me.EntityDescription,{...e}),Hn=e=>i.jsx(Me.EntityDescription,{...e}),Wn=e=>i.jsx(Me.PolygonGraphics,{...e}),zn=e=>i.jsx(Me.RectangleGraphics,{...e}),Un=e=>i.jsx(Me.CustomDataSource,{...e}),Co=e=>i.jsx(Me.PolylineGraphics,{...e}),xs="";var xe=function(){var e=M.Ellipsoid.WGS84,t,n=M.Material.fromType(M.Material.ColorType);function r(l,c=new M.Color(1,1,0,.5),_=new M.Color(1,1,1,1)){this._scene=l.scene,n.uniforms.color=c,t=_,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}r.prototype.initialiseHandlers=function(){var l=this._scene,c=this,_=new M.ScreenSpaceEventHandler(l.canvas);function y(w,P){if(c._handlersMuted!=!0){var m=l.pick(P);m&&m.primitive&&m.primitive[w]&&m.primitive[w](P)}}_.setInputAction(function(w){y("leftClick",w.position)},M.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(w){y("leftDoubleClick",w.position)},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var S;_.setInputAction(function(w){if(c._handlersMuted!=!0){var P=l.pick(w.endPosition);S&&(!P||S!=P.primitive)&&(!(S.isDestroyed&&S.isDestroyed())&&S.mouseOut(w.endPosition),S=null),P&&P.primitive&&(P=P.primitive,P.mouseOut&&(S=P),P.mouseMove&&P.mouseMove(w.endPosition))}},M.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(w){y("leftUp",w.position)},M.ScreenSpaceEventType.LEFT_UP),_.setInputAction(function(w){y("leftDown",w.position)},M.ScreenSpaceEventType.LEFT_DOWN)},r.prototype.setListener=function(l,c,_){l[c]=_},r.prototype.muteHandlers=function(l){this._handlersMuted=l},r.prototype.registerEditableShape=function(l){var c=this;Z(l,"mouseMove",function(_){l.setHighlighted(!0),l._editMode||c._tooltip.showAt(_,"Click to edit this shape")}),Z(l,"mouseOut",function(_){l.setHighlighted(!1),c._tooltip.setVisible(!1)}),Z(l,"leftClick",function(_){l.setEditMode(!0)})},r.prototype.startDrawing=function(l){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=l,this.muteHandlers(!0)},r.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},r.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},r.prototype.setHighlighted=function(l){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=l&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=l},r.prototype.disableAllEditMode=function(){this.setEdited(void 0)},r.prototype.setEdited=function(l){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=l};var s={ellipsoid:M.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=W(s,{appearance:new M.EllipsoidSurfaceAppearance({aboveGround:!1}),material:n,granularity:Math.PI/180}),d=W(s,{}),h=W(s,{}),f=W(s,{}),E=W(o,{rotation:0}),C=W(s,{width:5,geodesic:!0,granularity:1e4,appearance:new M.PolylineMaterialAppearance({aboveGround:!1}),material:n}),b=function(){function l(){}return l.prototype.initialiseOptions=function(c){X(this,c),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},l.prototype.setAttribute=function(c,_){this[c]=_,this._createPrimitive=!0},l.prototype.getAttribute=function(c){return this[c]},l.prototype.update=function(c,_,y){if(!M.defined(this.ellipsoid))throw new M.DeveloperError("this.ellipsoid must be defined.");if(!M.defined(this.appearance))throw new M.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new M.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!M.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var S=this.getGeometry();if(!S)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:S,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:M.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new M.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var w=this._primitive;w.appearance.material=this.material,w.debugShowBoundingVolume=this.debugShowBoundingVolume,w.update(c,_,y),this._outlinePolygon&&this._outlinePolygon.update(c,_,y)}},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),M.destroyObject(this)},l.prototype.setStrokeStyle=function(c,_){(!this.strokeColor||!this.strokeColor.equals(c)||this.strokeWidth!=_)&&(this._createPrimitive=!0,this.strokeColor=c,this.strokeWidth=_)},l}();r.ExtentPrimitive=function(){function l(c){if(!M.defined(c.extent))throw new M.DeveloperError("Extent is required");c=W(c,o),this.initialiseOptions(c),this.setExtent(c.extent)}return l.prototype=new b,l.prototype.setExtent=function(c){this.setAttribute("extent",c)},l.prototype.getExtent=function(){return this.getAttribute("extent")},l.prototype.getGeometry=function(){if(M.defined(this.extent))return new M.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.RectangleOutlineGeometry({rectangle:this.extent})},l}(),r.PolygonPrimitive=function(){function l(c){c=W(c,o),this.initialiseOptions(c),this.isPolygon=!0}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<3))return M.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return M.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},l}(),r.CirclePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.radius)))throw new M.DeveloperError("Center and radius are required");c=W(c,o),this.initialiseOptions(c),this.setRadius(c.radius)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setRadius=function(c){this.setAttribute("radius",Math.max(.1,c))},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getRadius=function(){return this.getAttribute("radius")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.radius))return new M.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},l}(),r.EllipsePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.semiMajorAxis)&&M.defined(c.semiMinorAxis)))throw new M.DeveloperError("Center and semi major and semi minor axis are required");c=W(c,E),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setSemiMajorAxis=function(c){c<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",c)},l.prototype.setSemiMinorAxis=function(c){c>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",c)},l.prototype.setRotation=function(c){return this.setAttribute("rotation",c)},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},l.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},l.prototype.getRotation=function(){return this.getAttribute("rotation")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.semiMajorAxis)&&M.defined(this.semiMinorAxis))return new M.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},l}(),r.PolylinePrimitive=function(){function l(c){c=W(c,C),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.setWidth=function(c){this.setAttribute("width",c)},l.prototype.setGeodesic=function(c){this.setAttribute("geodesic",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getWidth=function(){return this.getAttribute("width")},l.prototype.getGeodesic=function(c){return this.getAttribute("geodesic")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<2))return new M.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},l}();var p={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},v={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},I={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};r.prototype.createBillboardGroup=function(l,c,_){var y=new r.BillboardGroup(this,c);return y.addBillboards(l,_),y},r.BillboardGroup=function(l,c){this._drawHelper=l,this._scene=l._scene,this._options=W(c,p);var _=new M.BillboardCollection;this._scene.primitives.add(_),this._billboards=_,this._orderedBillboards=[]},r.BillboardGroup.prototype.createBillboard=function(l,c){var _=this._billboards.add({show:!0,position:l,pixelOffset:new M.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new M.Cartesian3(0,0,0),horizontalOrigin:M.HorizontalOrigin.CENTER,verticalOrigin:M.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:t});if(c){let w=function(m){S.enableRotate=m},P=function(){for(var m=0,L=y._orderedBillboards.length;m<L&&y._orderedBillboards[m]!=_;++m);return m};var y=this,S=this._scene.screenSpaceCameraController;if(c.dragHandlers){var y=this;Z(_,"leftDown",function(L){function k(O){_.position=O;for(var B=0,te=y._orderedBillboards.length;B<te&&y._orderedBillboards[B]!=_;++B);c.dragHandlers.onDrag&&c.dragHandlers.onDrag(P(),O)}function N(O){A.destroy(),w(!0),c.dragHandlers.onDragEnd&&c.dragHandlers.onDragEnd(P(),O)}var A=new M.ScreenSpaceEventHandler(y._scene.canvas);A.setInputAction(function(O){var B=y._scene.camera.pickEllipsoid(O.endPosition,e);B?k(B):N(B)},M.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(O){N(y._scene.camera.pickEllipsoid(O.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1),c.dragHandlers.onDragStart&&c.dragHandlers.onDragStart(P(),y._scene.camera.pickEllipsoid(L,e))})}c.onDoubleClick&&Z(_,"leftDoubleClick",function(m){c.onDoubleClick(P())}),c.onClick&&Z(_,"leftClick",function(m){c.onClick(P())}),c.tooltip&&(Z(_,"mouseMove",function(m){y._drawHelper._tooltip.showAt(m,c.tooltip())}),Z(_,"mouseOut",function(m){y._drawHelper._tooltip.setVisible(!1)}))}return _},r.BillboardGroup.prototype.insertBillboard=function(l,c,_){this._orderedBillboards.splice(l,0,this.createBillboard(c,_))},r.BillboardGroup.prototype.addBillboard=function(l,c){this._orderedBillboards.push(this.createBillboard(l,c))},r.BillboardGroup.prototype.addBillboards=function(l,c){for(var _=0;_<l.length;_++)this.addBillboard(l[_],c)},r.BillboardGroup.prototype.updateBillboardsPositions=function(l){for(var c=0;c<l.length;c++)this.getBillboard(c).position=l[c]},r.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},r.BillboardGroup.prototype.getBillboard=function(l){return this._orderedBillboards[l]},r.BillboardGroup.prototype.removeBillboard=function(l){this._billboards.remove(this.getBillboard(l)),this._orderedBillboards.splice(l,1)},r.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},r.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},r.prototype.startDrawingMarker=function(c){var c=W(c,p);this.startDrawing(function(){w.remove(),P.destroy(),S.setVisible(!1)});var _=this,y=this._scene;y.primitives;var S=this._tooltip,w=new r.BillboardGroup(this,c),P=new M.ScreenSpaceEventHandler(y.canvas);P.setInputAction(function(m){if(m.position!=null){var L=y.camera.pickEllipsoid(m.position,e);L&&(w.addBillboard(L),_.stopDrawing(),c.callback(L))}},M.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(m){var L=m.endPosition;if(L!=null){var k=y.camera.pickEllipsoid(L,e);k?S.showAt(L,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(k))):S.showAt(L,"<p>Click on the globe to add your marker.</p>")}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingPolygon=function(c){var c=W(c,o);this.startDrawingPolyshape(!0,c)},r.prototype.startDrawingPolyline=function(c){var c=W(c,C);this.startDrawingPolyshape(!1,c)},r.prototype.startDrawingPolyshape=function(l,c){this.startDrawing(function(){S.remove(m),k.remove(),N.destroy(),w.setVisible(!1),V(y)});var _=this,y=this._scene,S=y.primitives,w=this._tooltip,P=l?3:2,m;l?m=new xe.PolygonPrimitive(c):m=new xe.PolylinePrimitive(c),m.asynchronous=!1,S.add(m);var L=[],k=new r.BillboardGroup(this,p),N=new M.ScreenSpaceEventHandler(y.canvas);F(y),N.setInputAction(function(A){if(A.position!=null){var O=y.camera.pickEllipsoid(A.position,e);O&&(L.length==0&&(L.push(O.clone()),k.addBillboard(L[0])),L.length>=P&&(m.positions=L,m._createPrimitive=!0),L.push(O),k.addBillboard(O))}},M.ScreenSpaceEventType.LEFT_CLICK),N.setInputAction(function(A){var O=A.endPosition;if(O!=null)if(L.length==0)w.showAt(O,"<p>Click to add first point</p>");else{var B=y.camera.pickEllipsoid(O,e);B&&(L.pop(),B.y+=1+Math.random(),L.push(B),L.length>=P&&(m.positions=L,m._createPrimitive=!0),k.getBillboard(L.length-1).position=B,w.showAt(O,"<p>Click to add new point ("+L.length+")</p>"+(L.length>P?"<p>Double click to finish drawing</p>":"")))}},M.ScreenSpaceEventType.MOUSE_MOVE),N.setInputAction(function(A){var O=A.position;if(O!=null){if(L.length<P+2)return;var B=y.camera.pickEllipsoid(O,e);B&&(V(y),_.stopDrawing(),typeof c.callback=="function"&&(L.length-1,c.callback(L)))}},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function T(l){return e.cartographicArrayToCartesianArray([M.Rectangle.northwest(l),M.Rectangle.northeast(l),M.Rectangle.southeast(l),M.Rectangle.southwest(l)])}function F(l){l&&(l.canvas.style.cursor="crosshair")}function V(l){l&&(l.canvas.style.cursor="")}r.prototype.startDrawingExtent=function(c){var c=W(c,o);this.startDrawing(function(){m!=null&&S.remove(m),L!=null&&L.remove(),k.destroy(),w.setVisible(!1),V(y)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,L=null,k=new M.ScreenSpaceEventHandler(y.canvas);F(y);function N(A){m==null&&(m=new xe.ExtentPrimitive({extent:A,material:c.material}),m.asynchronous=!1,S.add(m)),m.setExtent(A);var O=T(A);L==null?(L=new r.BillboardGroup(_,p),L.addBillboards(O)):L.updateBillboardsPositions(O)}k.setInputAction(function(A){if(A.position!=null){var O=y.camera.pickEllipsoid(A.position,e);if(O)if(m==null){P=e.cartesianToCartographic(O);var B=j(P,P);N(B)}else _.stopDrawing(),typeof c.callback=="function"&&c.callback(j(P,e.cartesianToCartographic(O)))}},M.ScreenSpaceEventType.LEFT_DOWN),k.setInputAction(function(A){var O=A.endPosition;if(O!=null)if(m==null)w.showAt(O,"<p>Click to start drawing rectangle</p>");else{var B=y.camera.pickEllipsoid(O,e);if(B){var te=j(P,e.cartesianToCartographic(B));N(te),w.showAt(O,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingCircle=function(c){var c=W(c,o);this.startDrawing(function(){P!=null&&S.remove(P),m.remove(),L.destroy(),w.setVisible(!1)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,L=new M.ScreenSpaceEventHandler(y.canvas);L.setInputAction(function(k){if(k.position!=null){var N=y.camera.pickEllipsoid(k.position,e);N&&(P==null?(P=new r.CirclePrimitive({center:N,radius:0,asynchronous:!1,material:c.material}),S.add(P),m=new r.BillboardGroup(_,p),m.addBillboards([N])):(typeof c.callback=="function"&&c.callback(P.getCenter(),P.getRadius()),_.stopDrawing()))}},M.ScreenSpaceEventType.LEFT_DOWN),L.setInputAction(function(k){var N=k.endPosition;if(N!=null)if(P==null)w.showAt(N,"<p>Click to start drawing the circle</p>");else{var A=y.camera.pickEllipsoid(N,e);A&&(P.setRadius(M.Cartesian3.distance(P.getCenter(),A)),m.updateBillboardsPositions(A),w.showAt(N,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.enhancePrimitives=function(){var l=this;M.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var y=this,S=this;function w(P){l._scene.screenSpaceCameraController.enableRotate=P}Z(y,"leftDown",function(P){function m(N){y.position=N,S.executeListeners({name:"drag",positions:N})}function L(N){k.destroy(),w(!0),S.executeListeners({name:"dragEnd",positions:N})}var k=new M.ScreenSpaceEventHandler(l._scene.canvas);k.setInputAction(function(N){var A=l._scene.camera.pickEllipsoid(N.endPosition,e);A?m(A):L(A)},M.ScreenSpaceEventType.MOUSE_MOVE),k.setInputAction(function(N){L(l._scene.camera.pickEllipsoid(N.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1)}),ee(y)};function c(y){l._scene,!(this._highlighted&&this._highlighted==y)&&this._editMode!==!0&&(this._highlighted=y,y?(l.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(M.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function _(y){if(this._editMode!=y)if(l.disableAllHighlights(),y){l.setEdited(this);var S=l._scene,w=this;if(this._markers==null){let B=function(q,R){var ie=q-1<0?R.length-1:q-1;ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie)),ie=q,ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie))},te=function(){w.executeListeners({name:"onEdited",positions:w.positions})},ne=function(q){var R=w.positions;return e.cartographicToCartesian(new M.EllipsoidGeodesic(e.cartesianToCartographic(R[q]),e.cartesianToCartographic(R[q<R.length-1?q+1:0])).interpolateUsingFraction(.5))};var P=new r.BillboardGroup(l,v),m=new r.BillboardGroup(l,I),L={dragHandlers:{onDrag:function(q,R){w.positions[q]=R,B(q,w.positions),w._createPrimitive=!0},onDragEnd:function(q,R){w._createPrimitive=!0,te()}},onDoubleClick:function(q){w.positions.length<4||(w.positions.splice(q,1),w._createPrimitive=!0,P.removeBillboard(q),m.removeBillboard(q),B(q,w.positions),te())},tooltip:function(){if(w.positions.length>3)return"Double click to remove this point"}};P.addBillboards(w.positions,L),this._markers=P;for(var k=[],N=0,A=w.positions.length+(this.isPolygon?0:-1);N<A;N++)k.push(ne(N));var O={dragHandlers:{onDragStart:function(q,R){this.index=q+1,w.positions.splice(this.index,0,R),w._createPrimitive=!0},onDrag:function(q,R){w.positions[this.index]=R,w._createPrimitive=!0},onDragEnd:function(q,R){P.insertBillboard(this.index,R,L),m.getBillboard(this.index-1).position=ne(this.index-1),m.insertBillboard(this.index,ne(this.index),O),w._createPrimitive=!0,te()}},tooltip:function(){return"Drag to create a new point"}};m.addBillboards(k,O),this._editMarkers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(q){var R=S.pick(q.position);R&&R.primitive||w.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.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}xe.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this;y.isPolygon=!1,y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=_;var S=this.width;y.setHighlighted=function(w){this._editMode!==!0&&(w?(l.setHighlighted(this),this.setWidth(S*2)):this.setWidth(S))},y.getExtent=function(){return M.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},ee(y),y.setEditMode(!1)}},xe.PolygonPrimitive.prototype.setEditable=function(){var y=this;y.asynchronous=!1,l._scene,l.registerEditableShape(y),y.setEditMode=_,y.setHighlighted=c,ee(y),y.setEditMode(!1)},xe.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;l.registerEditableShape(y),y.asynchronous=!1,y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){if(l.setEdited(this),this._markers==null){let L=function(){y.executeListeners({name:"onEdited",extent:y.extent})};var P=new r.BillboardGroup(l,v),m={dragHandlers:{onDrag:function(k,N){var A=P.getBillboard((k+2)%4).position;y.setExtent(j(e.cartesianToCartographic(A),e.cartesianToCartographic(N))),P.updateBillboardsPositions(T(y.extent))},onDragEnd:function(k,N){L()}},tooltip:function(){return"Drag to change the corners of this extent"}};P.addBillboards(T(y.extent),m),this._markers=P,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(k){var N=S.pick(k.position);N&&!N.isDestroyed()&&N.primitive||y.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,ee(y),y.setEditMode(!1)}},r.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return M.EllipseOutlineGeometry(e,y.getCenter(),y.getSemiMajorAxis(),y.getSemiMinorAxis(),y.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),semiMajorAxis:y.getSemiMajorAxis(),semiMinorAxis:y.getSemiMinorAxis(),rotation:0})};var m=new r.BillboardGroup(l,v),L={dragHandlers:{onDrag:function(A,O){var B=M.Cartesian3.distance(y.getCenter(),O);A%2==0?y.setSemiMajorAxis(B):y.setSemiMinorAxis(B),m.updateBillboardsPositions(k())},onDragEnd:function(A,O){N()}},tooltip:function(){return"Drag to change the excentricity and radius"}};m.addBillboards(k(),L),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var O=S.pick(A.position);O&&O.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,ee(y),y.setEditMode(!1)}},r.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(y){for(var S=M.CircleOutlineGeometry.createGeometry(new M.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:y})),w=0,P,m=[];w<S.attributes.position.values.length;w+=3)P=S.attributes.position.values,m.push(new M.Cartesian3(P[w],P[w+1],P[w+2]));return m},r.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return P.getCircleCartesianCoordinates(M.Math.PI_OVER_TWO)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),radius:y.getRadius()})};var m=new r.BillboardGroup(l,v),L={dragHandlers:{onDrag:function(A,O){y.setRadius(M.Cartesian3.distance(y.getCenter(),O)),m.updateBillboardsPositions(k())},onDragEnd:function(A,O){N()}},tooltip:function(){return"Drag to change the radius"}};m.addBillboards(k(),L),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var O=S.pick(A.position);O&&O.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,ee(y),y.setEditMode(!1)}}},r.DrawHelperWidget=function(){function l(c,_){if(!M.defined(_.container))throw new M.DeveloperError("Container is required");var y={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:C,polygonDrawingOptions:d,extentDrawingOptions:h,circleDrawingOptions:f};X(_,y);var S=this,w=document.createElement("DIV");w.className="toolbar",_.container.appendChild(w);function P(k,N,A,O){var B=document.createElement("DIV");B.className="button",B.title=A,w.appendChild(B),B.onclick=O;var te=document.createElement("SPAN");B.appendChild(te);var ne=document.createElement("IMG");return ne.src=N,te.appendChild(ne),B}var m=c._scene;P("marker",_.markerIcon,"Click to start drawing a 2D marker",function(){c.startDrawingMarker({callback:function(k){S.executeListeners({name:"markerCreated",position:k})}})}),P("polyline",_.polylineIcon,"Click to start drawing a 2D polyline",function(){c.startDrawingPolyline({callback:function(k){S.executeListeners({name:"polylineCreated",positions:k})}})}),P("polygon",_.polygonIcon,"Click to start drawing a 2D polygon",function(){c.startDrawingPolygon({callback:function(k){S.executeListeners({name:"polygonCreated",positions:k})}})}),P("extent",_.extentIcon,"Click to start drawing an Extent",function(){c.startDrawingExtent({callback:function(k){S.executeListeners({name:"extentCreated",extent:k})}})}),P("circle",_.circleIcon,"Click to start drawing a Circle",function(){c.startDrawingCircle({callback:function(k,N){S.executeListeners({name:"circleCreated",center:k,radius:N})}})});var L=document.createElement("DIV");L.className="divider",w.appendChild(L),P("clear",_.clearIcon,"Remove all primitives",function(){m.primitives.removeAll()}),ee(this)}return l}(),r.prototype.addToolbar=function(l,c){return c=W(c,{container:l}),new r.DrawHelperWidget(this,c)};function j(l,c){var _=new M.Rectangle;_.west=Math.min(l.longitude,c.longitude),_.east=Math.max(l.longitude,c.longitude),_.south=Math.min(l.latitude,c.latitude),_.north=Math.max(l.latitude,c.latitude);var y=M.Math.EPSILON7;return _.east-_.west<y&&(_.east+=y*2),_.north-_.south<y&&(_.north+=y*2),_}function Y(l,c){return l.longitude.toFixed(c||3)+", "+l.latitude.toFixed(c||3)}function G(l,c){if(l==null||typeof l!="object"||l.constructor!=Object&&l.constructor!=Array)return l;if(l.constructor==Date||l.constructor==RegExp||l.constructor==Function||l.constructor==String||l.constructor==Number||l.constructor==Boolean)return new l.constructor(l);c=c||new l.constructor;for(var _ in l)c[_]=typeof c[_]>"u"?G(l[_],null):c[_];return c}function X(l,c){l=l||{};var _;for(_ in c)l[_]===void 0&&(l[_]=G(c[_]))}function W(l,c){var _=G(l),y;for(y in c)_[y]===void 0&&(_[y]=G(c[y]));return _}function Z(l,c,_){l[c]=_}function ee(l){l._listeners={},l.addListener=function(c,_){return this._listeners[c]=this._listeners[c]||[],this._listeners[c].push(_),this._listeners[c].length},l.executeListeners=function(c,_){if(this._listeners[c.name]&&this._listeners[c.name].length>0)for(var y=0;y<this._listeners[c.name].length;y++)this._listeners[c.name][y](c);else _&&_(c)}}return r}();const Mo=e=>{const t=e.map(n=>{const r=g.Cartographic.fromCartesian(n);return[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]});return t.push(t[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[t]}}},_o=e=>{const t=Ht.lineString([[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south)],[g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)]]);return je(qe(t))},Po=2,Io=(e,t)=>{switch(e){case we.BOX:{if(t.features.length!==Po)throw new Error(`${e} must have 2 points`);const n=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.BOTTOM_LEFT}),r=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.TOP_RIGHT});if(r&&n){if(n.geometry.coordinates[0]===r.geometry.coordinates[0]&&n.geometry.coordinates[1]===r.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return g.Rectangle.fromDegrees(n.geometry.coordinates[0],n.geometry.coordinates[1],r.geometry.coordinates[0],r.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`)}},Ao=e=>{const t=Ht.lineString([[e.west,e.south],[e.east,e.north]]);return je(qe(t)).geometry.coordinates[0].map(r=>g.Cartesian3.fromRadiansArray(r)[0])},Do=e=>{const{drawState:t,drawingMaterial:n,drawingVertexColor:r,material:s,hollow:o,outlineWidth:d}=e,h=pe(),[f,E]=a.useState();a.useEffect(()=>{E(new xe(h,n,r))},[]),a.useEffect(()=>{if(f){const b=f;if(t.drawing)switch(t.type){case we.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingPolygon({callback:p=>{t.handler({primitive:p,type:we.POLYGON,geojson:Mo(p)})}});break;case we.BOX:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingExtent({callback:p=>{t.handler({primitive:p,type:we.BOX,geojson:_o(p)})}});break;default:throw new Error(`[CESIUM DRAW]: ${t.type} unrecognized primitive to draw.`)}else b.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[t,f]);const C=b=>{try{let p=b.coordinates!==void 0?b.coordinates:Io(b.type,b.geojson);if(o!==!0)switch(b.type){case we.BOX:return i.jsx(zn,{coordinates:p,material:s??n});case we.POLYGON:return i.jsx(Wn,{hierarchy:new g.PolygonHierarchy(p),material:s??n});default:return i.jsx(i.Fragment,{})}else{switch(b.type){case we.BOX:p=Ao(p);break;case we.POLYGON:p=[...p,p[0]];break;default:return i.jsx(i.Fragment,{})}return i.jsx(Co,{clampToGround:!0,positions:p,width:d??1,material:s??n})}}catch(p){return console.error(p),i.jsx(i.Fragment,{})}};return i.jsx(Un,{...e,children:e.drawings.map((b,p)=>i.jsxs(Vn,{name:b.name,children:[i.jsxs(Hn,{children:[i.jsxs("h1",{children:["Drawed Entity ",b.name]}),i.jsx("p",{children:"This is description of drawed entity"})]}),C(b)]},b.id))})},Oo=()=>{const e=pe();return a.useEffect(()=>{e.extend(g.viewerCesiumInspectorMixin)},[e]),null},ko=-25,$n=2,xo=e=>{const t=pe(),n=(o,d=",")=>o.slice(o.indexOf(`
23
23
  `)+1).split(`
24
- `).map(v=>{const C=v.split(d);return{cartographic:g.Cartographic.fromDegrees(parseFloat(C[0]),parseFloat(C[1])),cartesian:new g.Cartesian2(parseFloat(C[0]),parseFloat(C[1]))}}),r=o=>{var h;o.preventDefault(),o.persist();const d=new FileReader;d.onload=f=>{var p;const v=(p=f.target)==null?void 0:p.result,C=n(v),b=g.Ellipsoid.WGS84;console.log(`Loaded CSV content:
25
- `,v),g.sampleTerrainMostDetailed(t.terrainProvider,C.map(E=>E.cartographic)).then(E=>{console.log(E),E=E.slice(0,E.length-1),t.scene.globe.depthTestAgainstTerrain=!0,t.entities.suspendEvents(),t.entities.removeAll(),E.forEach((I,L)=>{t.entities.add({name:(L+Un).toString(),position:b.cartographicToCartesian(I),billboard:{verticalOrigin:g.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(L+Un).toString(),font:"14pt monospace",fillColor:g.Color.BLACK,style:g.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:g.Color.BLACK,verticalOrigin:g.VerticalOrigin.BOTTOM,pixelOffset:new g.Cartesian2(0,Do)},description:`
26
- Long: ${C[L].cartesian.x} </br>
27
- Lat: ${C[L].cartesian.y} </br>
24
+ `).map(E=>{const C=E.split(d);return{cartographic:g.Cartographic.fromDegrees(parseFloat(C[0]),parseFloat(C[1])),cartesian:new g.Cartesian2(parseFloat(C[0]),parseFloat(C[1]))}}),r=o=>{var h;o.preventDefault(),o.persist();const d=new FileReader;d.onload=f=>{var p;const E=(p=f.target)==null?void 0:p.result,C=n(E),b=g.Ellipsoid.WGS84;console.log(`Loaded CSV content:
25
+ `,E),g.sampleTerrainMostDetailed(t.terrainProvider,C.map(v=>v.cartographic)).then(v=>{console.log(v),v=v.slice(0,v.length-1),t.scene.globe.depthTestAgainstTerrain=!0,t.entities.suspendEvents(),t.entities.removeAll(),v.forEach((I,T)=>{t.entities.add({name:(T+$n).toString(),position:b.cartographicToCartesian(I),billboard:{verticalOrigin:g.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(T+$n).toString(),font:"14pt monospace",fillColor:g.Color.BLACK,style:g.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:g.Color.BLACK,verticalOrigin:g.VerticalOrigin.BOTTOM,pixelOffset:new g.Cartesian2(0,ko)},description:`
26
+ Long: ${C[T].cartesian.x} </br>
27
+ Lat: ${C[T].cartesian.y} </br>
28
28
  Height(m): <span style="font-weight: 500">${I.height}</span>
29
- `})}),t.entities.resumeEvents(),o.target.files!==null&&(s(`terranian_heights_${o.target.files[0].name}`,C),o.target.value=""),console.log("Pinned point count is ",t.entities.values.length)},E=>{console.error("ERROR while sampleTerrainMostDetailed:",E)})},(h=o.target.files)!=null&&h[0]&&d.readAsText(o.target.files[0])},s=(o,d)=>{const h=p=>{let E="";return E+=p.cartesian.x.toString()+",",E+=p.cartesian.y.toString()+",",E+=p.cartographic.height.toString(),E+`
29
+ `})}),t.entities.resumeEvents(),o.target.files!==null&&(s(`terranian_heights_${o.target.files[0].name}`,C),o.target.value=""),console.log("Pinned point count is ",t.entities.values.length)},v=>{console.error("ERROR while sampleTerrainMostDetailed:",v)})},(h=o.target.files)!=null&&h[0]&&d.readAsText(o.target.files[0])},s=(o,d)=>{const h=p=>{let v="";return v+=p.cartesian.x.toString()+",",v+=p.cartesian.y.toString()+",",v+=p.cartographic.height.toString(),v+`
30
30
  `};let f=`long,lat,height
31
- `;d.forEach(p=>{f+=h(p)});const v=new Blob([f],{type:"text/csv;charset=utf-8;"}),C=document.createElement("a"),b=URL.createObjectURL(v);C.setAttribute("href",b),C.setAttribute("download",o),C.style.visibility="hidden",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return i.jsx(i.Fragment,{children:i.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:o=>{r(o)}})})},As="",xo=38,No=40,Bo=13,Fo=14,Vo=27,Go=9,Ho=10,Wo=100,zo=e=>{const[t,n]=a.useState(e.defaultValue??""),[r,s]=a.useState(!1),[o,d]=a.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=a.useRef(null);a.useEffect(()=>(window.addEventListener("resize",I),()=>{try{window.removeEventListener("resize",I)}catch(S){console.log('WINDOW "resize" remove listener failed',S)}}),[]),a.useEffect(()=>{typeof e.value<"u"&&n(e.value),typeof e.defaultValue<"u"&&n(e.defaultValue)},[e.value,e.defaultValue]),a.useEffect(()=>{const{options:S}=e,{caret:w}=o;j(t,w,S)},[e]);const f=(S,w,P)=>{const{trigger:m,matchAny:T,regex:k}=e,N=new RegExp(k);let A=m;Array.isArray(A)||(A=new Array(m)),A.sort();const D={};Array.isArray(P)&&A.forEach(ne=>{D[ne]=P});const B=v(A,N);let ee={};for(let ne=0;ne<B.length;ne++){const{triggerStr:q,triggerMatch:R,triggerLength:ie}=B[ne];for(let he=w-1;he>=0;--he){const oe=S.substring(he,w).match(N);let fe=-1;if(ie>0){const O=R?he:he-ie+1;if(O<0||(C(q,S,O)&&(fe=O+ie),!oe&&fe<0))break}else{if(oe&&he>0)continue;if(fe=he===0&&oe?0:he+1,w-fe===0)break}if(fe>=0){const O=D[q];if(!Array.isArray(O))continue;const x=S.substring(fe,w),H=O.filter(K=>{const ce=K.toLowerCase().indexOf(x.toLowerCase());return ce!==-1&&(T||ce===0)}),z=q,U=x.length;ee={...ee,trigger:z,matchStart:fe,matchLength:U,options:H}}}}return ee},v=(S,w)=>S.map(m=>({triggerStr:m,triggerMatch:m.match(w),triggerLength:m.length})),C=(S,w,P)=>!S||!S.length||w.substr(P,S.length)===S,b=S=>{const{onChange:w,options:P,spaceRemovers:m,spacer:T,value:k}=e,N=t,A=S.target.value,D=Bt(p(S.target)).end;if(A.length||G({...o,helperVisible:!1}),n(A),G({...o,caret:D,value:S.target.value}),!A.length||!D)return w(S.target.value);if(r&&m.length&&A.length>2&&T.length){for(let B=0;B<Math.max(N.length,A.length);++B)if(N[B]!==A[B]){if(B>=2&&A[B-1]===T&&m.indexOf(A[B-2])===-1&&m.indexOf(A[B])!==-1&&!$.isEmpty(f(A.substring(0,B-2),D-3,P))){const ee=`${A.slice(0,B-1)}${A.slice(B,B+1)}${A.slice(B-1,B)}${A.slice(B+1)}`;return F(B+1),h.current!==null&&(h.current.value=ee),k||G({...o,value:ee}),w(ee)}break}s(!1)}return j(A,D,P),w(S.target.value)},p=S=>{if(S!==void 0)if(S.children.length>0){const w=S.getElementsByTagName("textarea");if(w.length>0)return w[0];const P=S.getElementsByTagName("input");if(P.length>0)return P[0]}else return S},E=S=>{const{helperVisible:w,options:P,selection:m}=o,{onKeyDown:T,passThroughEnter:k}=e;if(w)switch(S.keyCode){case Vo:S.preventDefault(),Y();break;case xo:S.preventDefault(),G({...o,selection:(P.length+m-1)%P.length});break;case No:S.preventDefault(),G({...o,selection:(m+1)%P.length});break;case Fo:case Bo:k||S.preventDefault(),L(m);break;case Go:L(m);break;default:T(S);break}else T(S)},I=()=>{G({...o,helperVisible:!1})},L=S=>{const{spacer:w,onSelect:P,changeOnSelect:m}=e,{matchStart:T,matchLength:k,options:N,trigger:A}=o,D=N[S],B=t,ee=B.substring(0,T-A.length),ne=B.substring(T+k),q={target:h.current},R=m(A,D);q.target!==null&&(q.target.value=`${ee}${R}${w}${ne}`),b(q),q.target!==null&&P(q.target.value),Y(),F(ee.length+R.length+1),s(!0)},F=S=>{G({...o,caret:S});const w=p(h.current);Bt.setCaretPosition(w,S)},G=S=>{setTimeout(()=>{d({...S})},0)},j=(S,w,P)=>{const m=h.current;if(h.current===null)return;const T=p(m);if(T===void 0)return;const k=m.getBoundingClientRect(),N=f(S,w,P);if(Object.keys(N).length>0&&T!==null){const A=fr(T,w),D=T.getBoundingClientRect(),{minChars:B,onRequestOptions:ee,requestOnlyIfNoOptions:ne,mode:q}=e;let R,ie,he,ve="unset";q==="assist"?(R=m===T?A.top+T.offsetTop:A.top+k.top,ie=Math.min(A.left+T.offsetLeft-Ho,T.offsetLeft+D.width-Wo)):(R=k.top+m.offsetHeight,ie=m.offsetLeft,he=m.offsetLeft-m.offsetWidth,ve=`${k.width}px`),N.matchLength>=B&&(N.options.length>1||N.options.length===1&&N.options[0].length!==N.matchLength)?G({...o,value:S,helperVisible:!0,top:R,left:ie,right:he,width:ve,...N}):((!ne||!N.options.length)&&ee(S.substr(N.matchStart,N.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{G({...o,helperVisible:!1,selection:0})},100)},V=()=>{const{helperVisible:S,left:w,right:P,matchStart:m,matchLength:T,options:k,selection:N,top:A,value:D,width:B}=o;if(!S)return null;const{maxOptions:ee,offsetX:ne,offsetY:q,direction:R}=e;if(k.length===0)return null;if(N>=k.length)return G({...o,selection:0}),null;const ie=ee===0?k.length:ee,he=k.slice(0,ie).map((oe,fe)=>{const O=oe.toLowerCase().indexOf(D.substr(m,T).toLowerCase());return i.jsxs("li",{className:fe===N?"active":void 0,onClick:()=>{L(fe)},onMouseEnter:()=>{G({...o,selection:fe})},children:[oe.slice(0,O),i.jsx("strong",{children:oe.substr(O,T)}),oe.slice(O+T)]},oe)}),ve=R==="ltr"?{left:w+ne}:{right:P+ne};return i.jsx("ul",{className:"react-autocomplete-input",style:{...ve,top:A+q,width:B},children:he})},{Component:X,ComponentProps:W,defaultValue:Z,disabled:te,onBlur:l,value:c,..._}=e,y=Object.assign({},_);return Object.keys(e).forEach(S=>{delete y[S]}),i.jsxs(i.Fragment,{children:[a.cloneElement(X,{disabled:te,onBlur:l,onChange:b,onKeyDown:E,ref:h,value:t,...y,...W}),V()]})},Uo={Component:i.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,t)=>`${e}${t}`,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"},$o=e=>{let t={...Uo,...e};return e.mode==="autocomplete"&&(t={...t,trigger:"",regex:".",spacer:""}),i.jsx(zo,{...t})},st={formatFileModDate:(e,t)=>{const n=re.FileHelper.getModDate(t);return n?e.formatDate(n,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,t)=>{if(!t||typeof t.size!="number")return null;const n=t.size,r=yr(n,{bits:!1,output:"object"});return r.symbol==="B"?`${Math.round(r.value/10)/100} KB`:r.symbol==="KB"?`${Math.round(r.value)} ${r.symbol}`:`${r.value} ${r.symbol.toUpperCase()}`}},qo={locale:Se.EN,formatters:{...st}},jo={locale:Se.RU,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
31
+ `;d.forEach(p=>{f+=h(p)});const E=new Blob([f],{type:"text/csv;charset=utf-8;"}),C=document.createElement("a"),b=URL.createObjectURL(E);C.setAttribute("href",b),C.setAttribute("download",o),C.style.visibility="hidden",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return i.jsx(i.Fragment,{children:i.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:o=>{r(o)}})})},Ns="",No=38,Bo=40,Fo=13,Go=14,Vo=27,Ho=9,Wo=10,zo=100,Uo=e=>{const[t,n]=a.useState(e.defaultValue??""),[r,s]=a.useState(!1),[o,d]=a.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=a.useRef(null);a.useEffect(()=>(window.addEventListener("resize",I),()=>{try{window.removeEventListener("resize",I)}catch(S){console.log('WINDOW "resize" remove listener failed',S)}}),[]),a.useEffect(()=>{typeof e.value<"u"&&n(e.value),typeof e.defaultValue<"u"&&n(e.defaultValue)},[e.value,e.defaultValue]),a.useEffect(()=>{const{options:S}=e,{caret:w}=o;j(t,w,S)},[e]);const f=(S,w,P)=>{const{trigger:m,matchAny:L,regex:k}=e,N=new RegExp(k);let A=m;Array.isArray(A)||(A=new Array(m)),A.sort();const O={};Array.isArray(P)&&A.forEach(ne=>{O[ne]=P});const B=E(A,N);let te={};for(let ne=0;ne<B.length;ne++){const{triggerStr:q,triggerMatch:R,triggerLength:ie}=B[ne];for(let ge=w-1;ge>=0;--ge){const oe=S.substring(ge,w).match(N);let fe=-1;if(ie>0){const D=R?ge:ge-ie+1;if(D<0||(C(q,S,D)&&(fe=D+ie),!oe&&fe<0))break}else{if(oe&&ge>0)continue;if(fe=ge===0&&oe?0:ge+1,w-fe===0)break}if(fe>=0){const D=O[q];if(!Array.isArray(D))continue;const x=S.substring(fe,w),H=D.filter(K=>{const ce=K.toLowerCase().indexOf(x.toLowerCase());return ce!==-1&&(L||ce===0)}),z=q,U=x.length;te={...te,trigger:z,matchStart:fe,matchLength:U,options:H}}}}return te},E=(S,w)=>S.map(m=>({triggerStr:m,triggerMatch:m.match(w),triggerLength:m.length})),C=(S,w,P)=>!S||!S.length||w.substr(P,S.length)===S,b=S=>{const{onChange:w,options:P,spaceRemovers:m,spacer:L,value:k}=e,N=t,A=S.target.value,O=Ft(p(S.target)).end;if(A.length||V({...o,helperVisible:!1}),n(A),V({...o,caret:O,value:S.target.value}),!A.length||!O)return w(S.target.value);if(r&&m.length&&A.length>2&&L.length){for(let B=0;B<Math.max(N.length,A.length);++B)if(N[B]!==A[B]){if(B>=2&&A[B-1]===L&&m.indexOf(A[B-2])===-1&&m.indexOf(A[B])!==-1&&!$.isEmpty(f(A.substring(0,B-2),O-3,P))){const te=`${A.slice(0,B-1)}${A.slice(B,B+1)}${A.slice(B-1,B)}${A.slice(B+1)}`;return F(B+1),h.current!==null&&(h.current.value=te),k||V({...o,value:te}),w(te)}break}s(!1)}return j(A,O,P),w(S.target.value)},p=S=>{if(S!==void 0)if(S.children.length>0){const w=S.getElementsByTagName("textarea");if(w.length>0)return w[0];const P=S.getElementsByTagName("input");if(P.length>0)return P[0]}else return S},v=S=>{const{helperVisible:w,options:P,selection:m}=o,{onKeyDown:L,passThroughEnter:k}=e;if(w)switch(S.keyCode){case Vo:S.preventDefault(),Y();break;case No:S.preventDefault(),V({...o,selection:(P.length+m-1)%P.length});break;case Bo:S.preventDefault(),V({...o,selection:(m+1)%P.length});break;case Go:case Fo:k||S.preventDefault(),T(m);break;case Ho:T(m);break;default:L(S);break}else L(S)},I=()=>{V({...o,helperVisible:!1})},T=S=>{const{spacer:w,onSelect:P,changeOnSelect:m}=e,{matchStart:L,matchLength:k,options:N,trigger:A}=o,O=N[S],B=t,te=B.substring(0,L-A.length),ne=B.substring(L+k),q={target:h.current},R=m(A,O);q.target!==null&&(q.target.value=`${te}${R}${w}${ne}`),b(q),q.target!==null&&P(q.target.value),Y(),F(te.length+R.length+1),s(!0)},F=S=>{V({...o,caret:S});const w=p(h.current);Ft.setCaretPosition(w,S)},V=S=>{setTimeout(()=>{d({...S})},0)},j=(S,w,P)=>{const m=h.current;if(h.current===null)return;const L=p(m);if(L===void 0)return;const k=m.getBoundingClientRect(),N=f(S,w,P);if(Object.keys(N).length>0&&L!==null){const A=mr(L,w),O=L.getBoundingClientRect(),{minChars:B,onRequestOptions:te,requestOnlyIfNoOptions:ne,mode:q}=e;let R,ie,ge,ve="unset";q==="assist"?(R=m===L?A.top+L.offsetTop:A.top+k.top,ie=Math.min(A.left+L.offsetLeft-Wo,L.offsetLeft+O.width-zo)):(R=k.top+m.offsetHeight,ie=m.offsetLeft,ge=m.offsetLeft-m.offsetWidth,ve=`${k.width}px`),N.matchLength>=B&&(N.options.length>1||N.options.length===1&&N.options[0].length!==N.matchLength)?V({...o,value:S,helperVisible:!0,top:R,left:ie,right:ge,width:ve,...N}):((!ne||!N.options.length)&&te(S.substr(N.matchStart,N.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{V({...o,helperVisible:!1,selection:0})},100)},G=()=>{const{helperVisible:S,left:w,right:P,matchStart:m,matchLength:L,options:k,selection:N,top:A,value:O,width:B}=o;if(!S)return null;const{maxOptions:te,offsetX:ne,offsetY:q,direction:R}=e;if(k.length===0)return null;if(N>=k.length)return V({...o,selection:0}),null;const ie=te===0?k.length:te,ge=k.slice(0,ie).map((oe,fe)=>{const D=oe.toLowerCase().indexOf(O.substr(m,L).toLowerCase());return i.jsxs("li",{className:fe===N?"active":void 0,onClick:()=>{T(fe)},onMouseEnter:()=>{V({...o,selection:fe})},children:[oe.slice(0,D),i.jsx("strong",{children:oe.substr(D,L)}),oe.slice(D+L)]},oe)}),ve=R==="ltr"?{left:w+ne}:{right:P+ne};return i.jsx("ul",{className:"react-autocomplete-input",style:{...ve,top:A+q,width:B},children:ge})},{Component:X,ComponentProps:W,defaultValue:Z,disabled:ee,onBlur:l,value:c,..._}=e,y=Object.assign({},_);return Object.keys(e).forEach(S=>{delete y[S]}),i.jsxs(i.Fragment,{children:[a.cloneElement(X,{disabled:ee,onBlur:l,onChange:b,onKeyDown:v,ref:h,value:t,...y,...W}),G()]})},$o={Component:i.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,t)=>`${e}${t}`,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"},qo=e=>{let t={...$o,...e};return e.mode==="autocomplete"&&(t={...t,trigger:"",regex:".",spacer:""}),i.jsx(Uo,{...t})},st={formatFileModDate:(e,t)=>{const n=re.FileHelper.getModDate(t);return n?e.formatDate(n,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,t)=>{if(!t||typeof t.size!="number")return null;const n=t.size,r=vr(n,{bits:!1,output:"object"});return r.symbol==="B"?`${Math.round(r.value/10)/100} KB`:r.symbol==="KB"?`${Math.round(r.value)} ${r.symbol}`:`${r.value} ${r.symbol.toUpperCase()}`}},jo={locale:Se.EN,formatters:{...st}},Yo={locale:Se.RU,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
32
32
  one {# файл}
33
33
  few {# файла}
34
34
  other {# файлов}
@@ -40,7 +40,7 @@
40
40
  =0 {}
41
41
  one {# скрыт}
42
42
  other {# скрыто}
43
- }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Yo={locale:Se.HE,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
43
+ }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Zo={locale:Se.HE,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
44
44
  one {פריט #}
45
45
  other {# פריטים}
46
46
  }`,"chonky.toolbar.selectedFileCount":`{fileCount, plural,
@@ -51,4 +51,4 @@
51
51
  =0 {}
52
52
  one {# נסתר}
53
53
  other {# נסתרים}
54
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Zo={[Se.EN]:qo,[Se.RU]:jo,[Se.HE]:Yo},Os="";class Xo extends re.FileHelper{}const Jo=re.ChonkyActions,$n={listView:re.ChonkyActions.EnableListView.id,gridView:re.ChonkyActions.EnableGridView.id};re.setChonkyDefaults({iconComponent:mr.ChonkyIconFA});const Ko=a.memo(a.forwardRef(({theme:e,styles:t={height:"100%",minWidth:"600px"},defaultView:n=$n.listView,readOnlyMode:r=!1,locale:s,files:o,folderChain:d,onFileAction:h,...f},v)=>{const C=a.useCallback(Z=>null,[]);De.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 b=Z=>Z.replace(/([A-Z])/g,te=>"-"+te.toLowerCase()),p=a.useMemo(()=>e!==void 0?Object.keys(e).reduce((te,l)=>{const c=e[l];return l=l.startsWith("--")?l:`--fp-theme-${b(l)}`,te[l]=c,te},{}):{},[e]),[E,I]=a.useState(!1),[L,F]=a.useState(),[G,j]=a.useState(!1),[Y,V]=a.useState(),[X,W]=a.useState();return a.useEffect(()=>{e&&I(!0),F(n),r?j(!0):V([re.ChonkyActions.CreateFolder,re.ChonkyActions.DeleteFiles]),s!==void 0&&W(Zo[s])},[e,n,r,s]),i.jsx(Q,{style:{...t,...p},children:i.jsx(re.FullFileBrowser,{ref:v,files:o??[],folderChain:d,onFileAction:Z=>{typeof h=="function"&&h(Z)},thumbnailGenerator:C,defaultFileViewActionId:L,disableDragAndDrop:G,fileActions:Y,darkMode:E,i18n:X,...f})})})),Qo=e=>i.jsx(Ft.components.Option,{...e,children:i.jsx(J.Checkbox,{label:e.label,checked:e.isSelected})}),Ro=e=>{const{styles:t}=e;return i.jsx(Ft,{isMulti:!0,components:{Option:Qo},styles:t,isClearable:!0,hideSelectedOptions:!1,closeMenuOnSelect:!1,...e})},es=e=>{const{values:t,options:n,onChange:r,placeholder:s,styles:o}=e,d=J.useTheme(),h=Xe(d),[f,v]=a.useState(t);a.useEffect(()=>{v(t??[])},[t]);const C=b=>{v(b),r&&r(b)};return i.jsx(ae.ThemeProvider,{theme:h,children:i.jsx(ae.Input,{multiline:!0,fullWidth:!0,disableUnderline:!0,inputComponent:Ro,value:f,onChange:C,placeholder:s,id:"react-select-single",inputProps:{styles:o,options:n}})})},ts=({value:e,text:t,children:n,strokeWidth:r=8,styles:s,background:o=!1,backgroundPadding:d=0,counterClockwise:h=!1,circleRatio:f=1})=>{const v={value:e,strokeWidth:r,background:o,backgroundPadding:d,counterClockwise:h,circleRatio:f,styles:Ye.buildStyles({...s})};return n?i.jsx(Ye.CircularProgressbarWithChildren,{...v,children:n}):i.jsx(Ye.CircularProgressbar,{...v,text:t})},ns=({values:e,valueStart:t=0,valueEnd:n,duration:r,interval:s=1e3,easingFunction:o,repeat:d,children:h})=>{const[f,v]=a.useState(0),[C,b]=a.useState(t),p=a.useRef(void 0),E=e===void 0&&n!==void 0;return a.useEffect(()=>{if(E)return d?p.current=window.setInterval(()=>{b(I=>I===t?n:t)},r?r*1e3:1e3):b(n||t),()=>{window.clearInterval(p.current)};if(e)return p.current=window.setInterval(()=>{v(I=>(I+1)%e.length),b(e[f])},s),()=>clearInterval(p.current)},[e,n,r,s,d,f]),E?i.jsx(vr.Animate,{start:()=>({value:t}),update:()=>({value:[C],timing:{duration:r?r*1e3:1e3,ease:o}}),children:({value:I})=>i.jsx(i.Fragment,{children:h(I)})}):i.jsx(i.Fragment,{children:h(C)})};u.useMediaQuery=Xn,Object.defineProperty(u,"CesiumCesiumEntity",{enumerable:!0,get:()=>g.Entity}),Object.defineProperty(u,"CesiumCesiumPolygonGraphics",{enumerable:!0,get:()=>g.PolygonGraphics}),Object.defineProperty(u,"CesiumGeoJsonDataSource",{enumerable:!0,get:()=>g.GeoJsonDataSource}),Object.defineProperty(u,"CesiumMath",{enumerable:!0,get:()=>g.Math}),Object.defineProperty(u,"CesiumSceneTransforms",{enumerable:!0,get:()=>g.SceneTransforms}),Object.defineProperty(u,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>g.sampleTerrainMostDetailed}),Object.defineProperty(u,"buildStyles",{enumerable:!0,get:()=>Ye.buildStyles}),u.AnimatedValuesProvider=ns,u.Autocomplete=$o,u.BboxCorner=Ze,u.Box=Q,u.COORDINATES_MERCATOR_FRACTION_DIGITS=Qe,u.COORDINATES_WGS_FRACTION_DIGITS=Ke,u.Cesium3DTileset=mo,u.CesiumBoundingSphere=_i,u.CesiumCartesian2=Ci,u.CesiumCartesian3=Mi,u.CesiumCartographic=gn,u.CesiumCesiumBillboardGraphics=Bi,u.CesiumCesiumPolylineGraphics=ki,u.CesiumCesiumTerrainProvider=Di,u.CesiumColor=Fi,u.CesiumCompassTool=Cn,u.CesiumConstantPositionProperty=bi,u.CesiumConstantProperty=Si,u.CesiumCustomDataSource=zn,u.CesiumDrawingsDataSource=Ao,u.CesiumEllipsoid=Pi,u.CesiumEllipsoidTerrainProvider=Oi,u.CesiumEntity=Vn,u.CesiumEntityDescription=So,u.CesiumEntityStaticDescription=Gn,u.CesiumGeographicTilingScheme=Ii,u.CesiumGeojsonLayer=yo,u.CesiumHeightReference=Ui,u.CesiumHorizontalOrigin=Wi,u.CesiumImageryLayer=He,u.CesiumJulianDate=xi,u.CesiumLabelStyle=zi,u.CesiumMap=po,u.CesiumOSMLayer=Lo,u.CesiumPolygonGraphics=Hn,u.CesiumPolygonHierarchy=Vi,u.CesiumPolylineDashMaterialProperty=Ti,u.CesiumPositionProperty=Ni,u.CesiumRectangle=pn,u.CesiumRectangleGraphics=Wn,u.CesiumResource=Ai,u.CesiumScene=Gi,u.CesiumSceneMode=tt,u.CesiumVerticalOrigin=Hi,u.CesiumViewer=ho,u.CesiumWFSLayer=To,u.CesiumWMSLayer=vo,u.CesiumWMTSLayer=Eo,u.CesiumXYZLayer=wo,u.CircularProgressBar=ts,u.CoordinatesTrackerTool=Mn,u.CssBaseline=di,u.DateRangePicker=Mr,u.DateTimePicker=_r,u.DateTimeRangePicker=zt,u.DateTimeRangePickerFormControl=Tr,u.DrawInteraction=on,u.DrawType=we,u.FileHelper=Xo,u.FilePicker=Ko,u.FilePickerActions=Jo,u.FilePickerViewObj=$n,u.GeoJSONFeature=nn,u.InspectorTool=Oo,u.Legend=ii,u.MVTSource=ri,u.Map=Yt,u.MapFilterContainer=Wr,u.MultiSelection=es,u.Popover=Ut,u.Proj=be,u.ScaleTrackerTool=_n,u.ScopedCssBaseline=ui,u.SmartTable=ci,u.SupportedLocales=Se,u.TerrainianHeightTool=ko,u.TileLayer=Xt,u.TileOsm=rn,u.TileWMS=Kr,u.TileWMTS=Xr,u.TileXYZ=Rr,u.TimeRangeInput=Sr,u.VectorLayer=Qt,u.VectorSource=tn,u.VectorTileLayer=Ur,u.ZoomButtons=Pn,u.ZoomLevelTrackerTool=An,u.defaultFormatters=st,u.getMVTOptions=ni,u.getWMSOptions=Jr,u.getWMTSOptions=Zr,u.getXYZOptions=Qr,u.isDateRange=Je,u.mapMcToMuiTheme=Ht,u.useCesiumMap=pe,u.useCesiumMapViewstate=Fe,u.useMap=ke,u.useMappedCesiumTheme=Wt,u.useMappedMuiTheme=Xe,u.useTileLayer=Ge,u.useVectorLayer=Kt,u.useVectorSource=en,u.useVectorTileLayer=dn,u.useVectorTileSource=ti,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
54
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Xo={[Se.EN]:jo,[Se.RU]:Yo,[Se.HE]:Zo},Bs="";class Jo extends re.FileHelper{}const Ko=re.ChonkyActions,qn={listView:re.ChonkyActions.EnableListView.id,gridView:re.ChonkyActions.EnableGridView.id};re.setChonkyDefaults({iconComponent:yr.ChonkyIconFA});const Qo=a.memo(a.forwardRef(({theme:e,styles:t={height:"100%",minWidth:"600px"},defaultView:n=qn.listView,readOnlyMode:r=!1,locale:s,files:o,folderChain:d,onFileAction:h,...f},E)=>{const C=a.useCallback(Z=>null,[]);Oe.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 b=Z=>Z.replace(/([A-Z])/g,ee=>"-"+ee.toLowerCase()),p=a.useMemo(()=>e!==void 0?Object.keys(e).reduce((ee,l)=>{const c=e[l];return l=l.startsWith("--")?l:`--fp-theme-${b(l)}`,ee[l]=c,ee},{}):{},[e]),[v,I]=a.useState(!1),[T,F]=a.useState(),[V,j]=a.useState(!1),[Y,G]=a.useState(),[X,W]=a.useState();return a.useEffect(()=>{e&&I(!0),F(n),r?j(!0):G([re.ChonkyActions.CreateFolder,re.ChonkyActions.DeleteFiles]),s!==void 0&&W(Xo[s])},[e,n,r,s]),i.jsx(Q,{style:{...t,...p},children:i.jsx(re.FullFileBrowser,{ref:E,files:o??[],folderChain:d,onFileAction:Z=>{typeof h=="function"&&h(Z)},thumbnailGenerator:C,defaultFileViewActionId:T,disableDragAndDrop:V,fileActions:Y,darkMode:v,i18n:X,...f})})})),Ro=e=>i.jsx(Gt.components.Option,{...e,children:i.jsx(J.Checkbox,{label:e.label,checked:e.isSelected})}),es=e=>{const{styles:t}=e;return i.jsx(Gt,{isMulti:!0,components:{Option:Ro},styles:t,isClearable:!0,hideSelectedOptions:!1,closeMenuOnSelect:!1,...e})},ts=e=>{const{values:t,options:n,onChange:r,placeholder:s,styles:o}=e,d=J.useTheme(),h=Xe(d),[f,E]=a.useState(t);a.useEffect(()=>{E(t??[])},[t]);const C=b=>{E(b),r&&r(b)};return i.jsx(ae.ThemeProvider,{theme:h,children:i.jsx(ae.Input,{multiline:!0,fullWidth:!0,disableUnderline:!0,inputComponent:es,value:f,onChange:C,placeholder:s,id:"react-select-single",inputProps:{styles:o,options:n}})})},ns=({value:e,text:t,children:n,strokeWidth:r=8,styles:s,background:o=!1,backgroundPadding:d=0,counterClockwise:h=!1,circleRatio:f=1})=>{const E={value:e,strokeWidth:r,background:o,backgroundPadding:d,counterClockwise:h,circleRatio:f,styles:Ye.buildStyles({...s})};return n?i.jsx(Ye.CircularProgressbarWithChildren,{...E,children:n}):i.jsx(Ye.CircularProgressbar,{...E,text:t})},rs=({values:e,valueStart:t=0,valueEnd:n,duration:r,interval:s=1e3,easingFunction:o,repeat:d,children:h})=>{const[f,E]=a.useState(0),[C,b]=a.useState(t),p=a.useRef(void 0),v=e===void 0&&n!==void 0;return a.useEffect(()=>{if(v)return d?p.current=window.setInterval(()=>{b(I=>I===t?n:t)},r?r*1e3:1e3):b(n||t),()=>{window.clearInterval(p.current)};if(e)return p.current=window.setInterval(()=>{E(I=>(I+1)%e.length),b(e[f])},s),()=>clearInterval(p.current)},[e,n,r,s,d,f]),v?i.jsx(Er.Animate,{start:()=>({value:t}),update:()=>({value:[C],timing:{duration:r?r*1e3:1e3,ease:o}}),children:({value:I})=>i.jsx(i.Fragment,{children:h(I)})}):i.jsx(i.Fragment,{children:h(C)})};u.useMediaQuery=Jn,Object.defineProperty(u,"CesiumCesiumEntity",{enumerable:!0,get:()=>g.Entity}),Object.defineProperty(u,"CesiumCesiumPolygonGraphics",{enumerable:!0,get:()=>g.PolygonGraphics}),Object.defineProperty(u,"CesiumGeoJsonDataSource",{enumerable:!0,get:()=>g.GeoJsonDataSource}),Object.defineProperty(u,"CesiumMath",{enumerable:!0,get:()=>g.Math}),Object.defineProperty(u,"CesiumSceneTransforms",{enumerable:!0,get:()=>g.SceneTransforms}),Object.defineProperty(u,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>g.sampleTerrainMostDetailed}),Object.defineProperty(u,"buildStyles",{enumerable:!0,get:()=>Ye.buildStyles}),u.AnimatedValuesProvider=rs,u.Autocomplete=qo,u.BboxCorner=Ze,u.Box=Q,u.COORDINATES_MERCATOR_FRACTION_DIGITS=Qe,u.COORDINATES_WGS_FRACTION_DIGITS=Ke,u.Cesium3DTileset=yo,u.CesiumBoundingSphere=Pi,u.CesiumCartesian2=Mi,u.CesiumCartesian3=_i,u.CesiumCartographic=pn,u.CesiumCesiumBillboardGraphics=Fi,u.CesiumCesiumPolylineGraphics=xi,u.CesiumCesiumTerrainProvider=ki,u.CesiumColor=Gi,u.CesiumCompassTool=Mn,u.CesiumConstantPositionProperty=Ci,u.CesiumConstantProperty=bi,u.CesiumCustomDataSource=Un,u.CesiumDrawingsDataSource=Do,u.CesiumEllipsoid=Ii,u.CesiumEllipsoidTerrainProvider=Oi,u.CesiumEntity=Vn,u.CesiumEntityDescription=bo,u.CesiumEntityStaticDescription=Hn,u.CesiumGeographicTilingScheme=Ai,u.CesiumGeojsonLayer=vo,u.CesiumHeightReference=$i,u.CesiumHorizontalOrigin=zi,u.CesiumImageryLayer=He,u.CesiumJulianDate=Ni,u.CesiumLabelStyle=Ui,u.CesiumMap=fo,u.CesiumOSMLayer=Lo,u.CesiumPolygonGraphics=Wn,u.CesiumPolygonHierarchy=Vi,u.CesiumPolylineDashMaterialProperty=Si,u.CesiumPositionProperty=Bi,u.CesiumRectangle=fn,u.CesiumRectangleGraphics=zn,u.CesiumResource=Di,u.CesiumScene=Hi,u.CesiumSceneMode=tt,u.CesiumVerticalOrigin=Wi,u.CesiumViewer=go,u.CesiumWFSLayer=So,u.CesiumWMSLayer=Eo,u.CesiumWMTSLayer=wo,u.CesiumXYZLayer=To,u.CircularProgressBar=ns,u.CoordinatesTrackerTool=_n,u.CssBaseline=ui,u.DateRangePicker=_r,u.DateTimePicker=Pr,u.DateTimeRangePicker=Ut,u.DateTimeRangePickerFormControl=Sr,u.DrawInteraction=sn,u.DrawType=we,u.FileHelper=Jo,u.FilePicker=Qo,u.FilePickerActions=Ko,u.FilePickerViewObj=qn,u.GeoJSONFeature=rn,u.InspectorTool=Oo,u.Legend=oi,u.MVTSource=ii,u.Map=Zt,u.MapFilterContainer=zr,u.MultiSelection=ts,u.Popover=$t,u.Proj=be,u.ScaleTrackerTool=Pn,u.ScopedCssBaseline=hi,u.SmartTable=di,u.SupportedLocales=Se,u.TerrainianHeightTool=xo,u.TileLayer=Jt,u.TileOsm=on,u.TileWMS=Qr,u.TileWMTS=Jr,u.TileXYZ=ei,u.TimeRangeInput=br,u.VectorLayer=Rt,u.VectorSource=nn,u.VectorTileLayer=$r,u.ZoomButtons=In,u.ZoomLevelTrackerTool=Dn,u.defaultFormatters=st,u.getMVTOptions=ri,u.getWMSOptions=Kr,u.getWMTSOptions=Xr,u.getXYZOptions=Rr,u.isDateRange=Je,u.mapMcToMuiTheme=Wt,u.useCesiumMap=pe,u.useCesiumMapViewstate=Fe,u.useMap=ke,u.useMappedCesiumTheme=zt,u.useMappedMuiTheme=Xe,u.useTileLayer=Ve,u.useVectorLayer=Qt,u.useVectorSource=tn,u.useVectorTileLayer=un,u.useVectorTileSource=ni,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});