@evergis/react
Advanced tools
Comparing version 1.3.5 to 1.3.6
export { Symbol } from './Symbol'; | ||
export * from './styled'; | ||
export * from './StyleSymbol'; |
import { ClassificationAttribute } from '../types/classification'; | ||
import { LayerAttributes } from '../types/service'; | ||
import { LayerAttributes } from '../types/layer'; | ||
export declare const getClassificationAttribute: (attributeName: string, attributes: LayerAttributes) => ClassificationAttribute; |
import { CompositeSymbolType, StyleSymbolType } from './symbol'; | ||
import { ClassificationAttribute, ClassificationClass, ClassificationParameterExtended } from './classification'; | ||
import { LayerAttributes } from './service'; | ||
import { LayerAttributes } from './layer'; | ||
import { ParameterValueWithSymbol } from './parameterValue'; | ||
@@ -5,0 +5,0 @@ import { Unclassify } from './utils'; |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("@evergis/api"),o=require("@evergis/sgis/es/Map"),i=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),s=require("@evergis/sgis/es/layers/FeatureLayer"),l=require("@evergis/sgis/es/features/Polyline"),a=require("@evergis/sgis/es/features/Polygon"),u=e(require("react-dom")),c=require("@evergis/sgis/es/symbols/Symbol"),f=require("@evergis/sgis/es/renders/Arc"),d=require("@evergis/sgis/es/symbols/point/Point"),h=require("@evergis/sgis/es/features/PointFeature"),p=require("@evergis/sgis/es/symbols/PolylineSymbol"),m=require("@evergis/sgis/es/features/Poly"),y=require("@evergis/sgis/es/renders/Poly"),g=require("@evergis/sgis/es/controls/PolylineControl"),v=require("@evergis/sgis/es/features/Label"),b=require("@evergis/sgis/es/geotools"),k=require("@evergis/sgis/es/Crs"),x=require("@evergis/sgis/es/controls/Control"),w=require("@evergis/sgis/es/utils/math"),C=require("@evergis/sgis/es/controls/PolyEditor"),S=require("styled-components"),L=e(S),M=require("@evergis/icons"),P=require("@evergis/sgis/es/symbols/polygon/BrushFill"),E=require("@evergis/sgis/es/symbols/polygon/ImageFill"),F=require("@evergis/sgis/es/symbols/point/StaticImageSymbol"),z=require("@evergis/sgis/es/symbols/point/Square"),R=require("@evergis/sgis/es/symbols/polygon/Simple"),q=require("@evergis/sgis/es/symbols/point/MaskedImage"),A=require("@evergis/condition"),T=require("@evergis/sgis/es/commonEvents"),_=require("@evergis/sgis/es/Bbox"),O=require("@evergis/sgis/es/utils/domEvent"),D=require("@evergis/sgis/es/layers/ClusterLayer"),I=require("@evergis/sgis/es/layers/clusterProviders/GridClusterProvider"),W=require("@evergis/color"),B=require("@evergis/sgis/es/painters/DomPainter/Canvas"),V=require("@evergis/sgis/es/layers/TileLayer");const j=new r.Api({url:"/"}),N=t.createContext(j),U=()=>t.useContext(N),G=new o.Map,Z=new i.DomPainter(G),X=t.createContext({map:G,painter:Z}),H=()=>t.useContext(X),J=new s.FeatureLayer,Y=new s.FeatureLayer,K=t.createContext({layer:J,popupLayer:Y}),Q=()=>t.useContext(K);function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),e}function ne(){return(ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function se(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe(e);if(t){var o=oe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return se(this,n)}}function ae(e,t,n){return(ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=oe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function ue(e,t){return t||(t=e.slice(0)),e.raw=t,e}let ce=function(e){re(r,c.DynamicPointSymbol);var t=le(r);function r(e){var n;let{component:o,offset:i}=void 0===e?{}:e;return $(this,r),(n=t.call(this,{offset:i})).component=o,n}return te(r,[{key:"_getFeatureNode",value:function(e){const t=document.createElement("div");return this.renderDom(e.content,t),t}},{key:"_updateFeatureNode",value:function(e){this.renderDom(e.content,this.getNode(e))}},{key:"renderDom",value:function(e,t){if(!t)return;const r=this.component;r?u.render(n.createElement(r,{content:e}),t):t.innerText=e}}]),r}();const fe=[8,-16],de=e=>{const{offset:t=fe,renderLabel:r=(e=>{let{content:t}=e;return n.createElement("div",null,t)}),onClose:o}=e||{};return new ce({offset:t,component:e=>{let{content:t}=e;return r({content:t,onClose:o})}})};function he(e,t){let{strokeWidth:n=2,shadowColor:r,shadowSize:o,size:i=6}=t;return new f.Arc(e,{fillColor:"transparent",strokeColor:r,strokeWidth:o,radius:(i+n+o)/2})}function pe(e,t){let{strokeColor:n,strokeWidth:r,shadowColor:o,fillColor:i,shadowSize:s,size:l=0}=t;const a=l/2;return[he(e,{strokeWidth:r,strokeColor:n,shadowSize:s,shadowColor:o,size:l}),new f.Arc(e,{fillColor:i,strokeColor:n,strokeWidth:r,radius:a})]}let me=function(e){re(n,d.PointSymbol);var t=le(n);function n(e){return $(this,n),t.call(this,e)}return te(n,[{key:"renderFunction",value:function(e,t,n){if(!(e instanceof h.PointFeature))return[];const{position:r}=e.projectTo(n),o=[r[0]/t+(this.offset[0]||0),-r[1]/t+(this.offset[1]||0)],i=this.getShadow(o),s=this.getPoint(o);return i?[i,s]:[s]}},{key:"getShadow",value:function(e){return n.getShadowArc(e,this)}},{key:"getPoint",value:function(e){return n.getPointArc(e,this)}}],[{key:"getShadowArc",value:function(e,t){let{strokeWidth:n=2,shadowColor:r,shadowSize:o,size:i=6}=t;return new f.Arc(e,{fillColor:"transparent",strokeColor:r,strokeWidth:o,radius:(i+n+o)/2})}},{key:"getPointArc",value:function(e,t){let{strokeWidth:n,fillColor:r,strokeColor:o,size:i=6}=t;return new f.Arc(e,{fillColor:r,strokeColor:o,strokeWidth:n,radius:i/2})}},{key:"getArcs",value:function(e,t){const r=n.getShadowArc(e,t),o=n.getPointArc(e,t);return r?[r,o]:[o]}}]),n}(),ye=function(e){re(n,p.PolylineSymbol);var t=le(n);function n(e){return $(this,n),t.call(this,e)}return te(n,[{key:"renderFunction",value:function(e,t,n){if(!(e instanceof m.Poly))return[];const r=p.PolylineSymbol.getRenderedCoordinates(e,t,n),o=this.getPolyRender(r),i=this.getShadow(r),s=this.getVertexRenders(r);let l=[o];return i&&(l=[i,o]),s&&(l=l.concat(s)),l}},{key:"getShadow",value:function(e){return new y.PolyRender(e,{fillStyle:y.FillStyle.None,enclosed:this.enclose,strokeColor:this.shadowColor,strokeWidth:this.shadowSize,lineDash:this.lineDash})}},{key:"getPolyRender",value:function(e){return new y.PolyRender(e,{fillStyle:this.enclose?y.FillStyle.Color:y.FillStyle.None,enclosed:this.enclose,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,lineDash:this.lineDash})}},{key:"getVertexRenders",value:function(e){if(this.showVertex)return e.reduce((e,t)=>e.concat(t),[]).map(e=>pe(e,{size:6,strokeWidth:2,shadowColor:this.shadowColor,strokeColor:this.strokeColor,shadowSize:void 0!==this.vertexShadowSize?this.vertexShadowSize:2,fillColor:"#ffffff"})).reduce((e,t)=>e.concat(t),[])}}]),n}();const ge={strokeWidth:2,strokeColor:"#e33600",shadowSize:8,shadowColor:"rgba(227, 54, 0, 0.3)"},ve={strokeColor:"#ff6933",shadowSize:0,vertexShadowSize:0},be=new ye(ne({},ge,ve,{enclose:!1,showVertex:!0})),ke=new ye(ne({},ge,ve,{fillColor:"rgba(255, 105, 51, 0.25)",enclose:!0,showVertex:!0})),xe=new me(ne({},{size:10,strokeWidth:2,strokeColor:"#e33600",fillColor:"#ffffff",shadowColor:"rgba(227, 54, 0, 0.3)",shadowSize:3},{strokeColor:"#ff6933",shadowSize:0}));function we(e,t){if(e[0].length<=3)return!1;const n=e[0],r=n[0],o=n[n.length-1],i=2*t;return w.softEquals(r[0],o[0],i)&&w.softEquals(r[1],o[1],i)}function Ce(e,t,n){void 0===t&&(t=2),void 0===n&&(n=",");const[r,o]=e.toFixed(t).split(".");return[r.replace(/\B(?=(\d{3})+(?!\d))/g," "),o].join(n)}function Se(e){let t=e,n="м²";return e>=1e7?(t=e/1e6,n="км²"):e>=1e4&&(t=e/1e4,n="га"),Ce(t)+" "+n}function Le(e){let t=e,n="м";return e>1e4&&(t=e/1e3,n="км"),Ce(t)+" "+n}function Me(e,t){return"S : "+Se(e)+" P : "+Le(t)}const Pe=[Infinity,Infinity];let Ee=function(e){re(n,g.PolylineControl);var t=le(n);function n(e,r,o){var i;return $(this,n),(i=t.call(this,e,o)).cancel=()=>{i.fire("cancel")},i.painter=r,i.renderLabelSymbol=o.renderLabelSymbol,i.on("pointAdd",i.handlePointAdd),i.on("change",i.updateDistance),i}return te(n,[{key:"_handleMousemove",value:function(e){ae(oe(n.prototype),"_handleMousemove",this).call(this,e),this.drawPointOnMouseMove(e)}},{key:"_activate",value:function(){ae(oe(n.prototype),"_activate",this).call(this),this.addTempLabel(),this.setCursor("pointer")}},{key:"_deactivate",value:function(){ae(oe(n.prototype),"_deactivate",this).call(this),this.removeCoordLabel(),this.removeTempLabel(),this.removeMeasureLabel(),this.removeTempPolygon(),this.setCursor("default")}},{key:"handlePointAdd",value:function(){const e=this.activeFeature;if(!e)return;const{rings:t,crs:n}=e;if(we(t,this.map.resolution))return this.finishDrawing(),void this.fire(new x.DrawingFinishEvent(e,new MouseEvent("mouseup")));if(2===t[0].length){const e=n.projectionTo(k.geo),r=t[0][0];if(!e)return;const[o,i]=e(r);this.removeTempLabel(),this.addMeasureResultLabel(),this.addCoordLabel(o.toFixed(6)+", "+i.toFixed(6),r)}else this.removeCoordLabel()}},{key:"polygonPreview",value:function(){this.tempPolygon&&this._tempLayer&&this._tempLayer.remove(this.tempPolygon);const e=this.activeFeature;if(!e)return;const{rings:t,crs:n}=e,r=[...t[0]];r.shift(),this.tempPolygon=new a.Polygon(r,{crs:n}),this.tempPolygon.symbol=ke,this.activeFeature&&this.activeFeature.hide(),this._tempLayer&&this._tempLayer.add(this.tempPolygon)}},{key:"removeTempPolygon",value:function(){this.tempPolygon&&(this._tempLayer&&this._tempLayer.remove(this.tempPolygon),delete this.tempPolygon)}},{key:"updateDistance",value:function(e){const t=this.activeFeature,{ringIndex:n,pointIndex:r}=e;if(!t||null===n||null===r)return;const{rings:o,crs:i}=t,s=o[n][r],l=b.length(o,i);let a=Le(l);we(o,this.map.resolution)?(this.polygonPreview(),a=Me(b.area(o,i),l)):this.tempPolygon&&(t.show(),this.removeTempPolygon()),this.measureResultLabel&&(this.measureResultLabel.position=s,this.measureResultLabel.content=a)}},{key:"addTempLabel",value:function(){this.tempLabel=new v.LabelFeature(Pe,{content:"Нажмите на карту, чтобы начать измерение",crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this._tempLayer.add(this.tempLabel)}},{key:"addCoordLabel",value:function(e,t){this.coordLabel=new v.LabelFeature(t,{content:e,crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol,onClose:this.cancel})}),this._tempLayer&&this.coordLabel&&this._tempLayer.add(this.coordLabel)}},{key:"addMeasureResultLabel",value:function(){this.measureResultLabel=new v.LabelFeature(Pe,{crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this.measureResultLabel&&this._tempLayer.add(this.measureResultLabel)}},{key:"removeTempLabel",value:function(){this.tempLabel&&(this._tempLayer&&this._tempLayer.remove(this.tempLabel),delete this.tempLabel)}},{key:"removeCoordLabel",value:function(){this.coordLabel&&(this._tempLayer&&this._tempLayer.remove(this.coordLabel),delete this.coordLabel)}},{key:"removeMeasureLabel",value:function(){this.measureResultLabel&&(this._tempLayer&&this._tempLayer.remove(this.measureResultLabel),delete this.measureResultLabel)}},{key:"drawPointOnMouseMove",value:function(e){this.tempLabel&&(this.tempLabel.position=e.point.position)}},{key:"setCursor",value:function(e){const{wrapper:t}=this.painter;t&&"string"!=typeof t&&(t.style.cursor=e)}}]),n}(),Fe=function(e){re(n,C.PolyEditor);var t=le(n);function n(e,r,o){var i;return $(this,n),(i=t.call(this,e,o)).measureResult=()=>{const e=i.activeFeature;if(!e)return null;const{rings:t,isEnclosed:n,crs:r}=e,o=t[0][t[0].length-1],s=b.area(t,r),l=b.length(t,r,n);return{content:n?Me(s,l):Le(l),position:o}},i.removeFeature=()=>{i.fire("remove")},i.painter=r,i.renderLabelSymbol=o.renderLabelSymbol,i.on("change",i.updateMeasureResult),i.on("edit",i.updateMeasureResult),i}return te(n,[{key:"_activate",value:function(){ae(oe(n.prototype),"_activate",this).call(this),this.addMeasureResultLabel()}},{key:"addMeasureResultLabel",value:function(){const e=this.measureResult();if(null===e)return;const{content:t,position:n}=e;this.measureResultLabel=new v.LabelFeature(n,{content:t,crs:this.map.crs,symbol:de({onClose:this.removeFeature,renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this._tempLayer.add(this.measureResultLabel)}},{key:"updateMeasureResult",value:function(){if(this.measureResultLabel){const e=this.measureResult();if(null===e)return;const{content:t,position:n}=e;this.measureResultLabel.content=t,this.measureResultLabel.position=n}}}]),n}(),ze=function(e){re(r,n.Component);var t=le(r);function r(){var e;return $(this,r),(e=t.apply(this,arguments)).createFeature=t=>{const n=e.getFeature([...t.feature.rings]);e.layer&&e.layer.add(n),e.editorControl&&(e.editorControl.activeFeature=n),e.switchMode(!1,!0)},e.removeFeature=()=>{e.editorControl&&e.editorControl.activeFeature&&e.layer&&e.layer.remove(e.editorControl.activeFeature),e.switchMode(!0,!1)},e.cancelFeatureCreation=()=>{setTimeout(()=>{e.switchMode(!1,!1),e.switchMode(!0,!1)},10)},e}return te(r,[{key:"componentDidMount",value:function(){const{map:e,painter:t,renderLabelSymbol:n}=this.props;this.layer=new s.FeatureLayer,this.initCreateMode(e,t,n),this.initEditMode(e,t,n),this.props.map.addLayer(this.layer),this.switchMode(!0,!1)}},{key:"componentWillUnmount",value:function(){this.layer&&this.props.map.removeLayer(this.layer),this.switchMode(!1,!1),this.offEvents(),this.clearProperties()}},{key:"initCreateMode",value:function(e,t,n){this.createControl=new Ee(e,t,{isActive:!1,useTempLayer:!0,symbol:be,dblClickMinTime:300,renderLabelSymbol:n}),this.createControl.on("drawingFinish",this.createFeature),this.createControl.on("cancel",this.cancelFeatureCreation)}},{key:"initEditMode",value:function(e,t,n){this.editorControl=new Fe(e,t,{isActive:!1,activeLayer:this.layer,snappingSymbol:xe,symbol:be,renderLabelSymbol:n}),this.editorControl.featureDragAllowed=!1,this.editorControl.on("remove",this.removeFeature)}},{key:"offEvents",value:function(){this.createControl&&this.createControl.off("drawingFinish",this.createFeature),this.editorControl&&this.editorControl.off("remove",this.removeFeature),this.createControl&&this.createControl.off("cancel",this.cancelFeatureCreation)}},{key:"clearProperties",value:function(){delete this.createControl,delete this.editorControl,delete this.layer}},{key:"switchMode",value:function(e,t){this.createControl&&(this.createControl.isActive=e),this.editorControl&&(this.editorControl.isActive=t)}},{key:"getFeature",value:function(e){let t;return we(e,this.props.map.resolution)?(e[0].shift(),t=new a.Polygon(e,{crs:this.props.map.crs}),t.symbol=ke):(t=new l.Polyline(e,{crs:this.props.map.crs}),t.symbol=be),t}},{key:"render",value:function(){return n.createElement("div",{style:{display:"none"}})}}]),r}();function Re(){const e=ue(["\n ","\n ","\n ","\n ","\n"]);return Re=function(){return e},e}function qe(){const e=ue(["\n bottom: ",";\n right: ",";\n"]);return qe=function(){return e},e}function Ae(){const e=ue(["\n bottom: ",";\n left: ",";\n"]);return Ae=function(){return e},e}function Te(){const e=ue(["\n top: ",";\n right: ",";\n"]);return Te=function(){return e},e}function _e(){const e=ue(["\n top: ",";\n left: ",";\n"]);return _e=function(){return e},e}const Oe=function(e,t){return void 0===e&&(e="bottom-left"),void 0===t&&(t="1rem"),S.css(Re(),"top-left"===e&&(e=>S.css(_e(),e,e))(t),"top-right"===e&&(e=>S.css(Te(),e,e))(t),"bottom-left"===e&&(e=>S.css(Ae(),e,e))(t),"bottom-right"===e&&(e=>S.css(qe(),e,e))(t))};function De(){const e=ue(["\n position: absolute;\n display: flex;\n flex-direction: ",";\n\n ","\n\n "," {\n margin-bottom: ",";\n margin-right: ",";\n flex-direction: ",";\n }\n"]);return De=function(){return e},e}function Ie(){const e=ue(["\n border-radius: 0.15rem;\n background: rgba(28, 33, 48, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n font-size: 1.5rem;\n cursor: pointer;\n height: auto;\n width: auto;\n padding: 0.25rem;\n"]);return Ie=function(){return e},e}function We(){const e=ue(["\n ","\n"]);return We=function(){return e},e}function Be(){const e=ue(["\n ","\n"]);return Be=function(){return e},e}function Ve(){const e=ue(["\n ","\n"]);return Ve=function(){return e},e}function je(){const e=ue(["\n ","\n"]);return je=function(){return e},e}function Ne(){const e=ue(["\n ","\n"]);return Ne=function(){return e},e}function Ue(){const e=ue(["\n width: 2rem;\n height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]);return Ue=function(){return e},e}const Ge=S.css(Ue()),Ze=L(M.EverCloudPlusIcon)(Ne(),Ge),Xe=L(M.EverCloudMinusIcon)(je(),Ge),He=L(M.EverCloudSearchIcon)(Ve(),Ge),Je=L(M.EverCloudMaximizeIcon)(Be(),Ge),Ye=L(M.EverCloudMeasureLenghtIcon)(We(),Ge),Ke=L.div(Ie()),Qe=L.div(De(),e=>{let{vertical:t}=e;return t?"column":"row"},e=>{let{placement:t}=e;return Oe(t)},Ke,e=>{let{vertical:t}=e;return t?"0.5rem":"0"},e=>{let{vertical:t}=e;return t?"0":"0.5rem"},e=>{let{vertical:t}=e;return t?"column":"row"});function $e(){const e=ue(["\n height: 2rem;\n display: flex;\n justify-content: center;\n align-items: ",";\n width: ",";\n color: #fff;\n font-size: 1rem;\n cursor: default;\n padding: 0 0.5rem;\n"]);return $e=function(){return e},e}function et(){const e=ue(["\n display: flex;\n align-items: flex-end;\n justify-content: center;\n width: ",";\n height: 0.25rem;\n border: 0.0625rem solid white;\n border-top: 0;\n"]);return et=function(){return e},e}function tt(){const e=ue(["\n height: 2rem;\n cursor: default;\n display: flex;\n align-items: flex-end;\n padding: 0 0.5rem 0.5rem;\n box-sizing: border-box;\n"]);return tt=function(){return e},e}const nt=L.div(tt()),rt=L.div(et(),e=>{let{width:t}=e;return t+"px"}),ot=L.div($e(),e=>{let{alignEnd:t}=e;return t?"flex-end":"center"},e=>{let{width:t}=e;return t||"auto"});function it(e){const t=[1,2,5];for(let n=0;n<21;n++)for(let r=0;r<t.length;r++){const o=Math.pow(10,n)*t[r];if(o>e)return o}return 1}function st(e){let{onMount:n,onUnmount:r}=e;t.useEffect(()=>(n&&n(),r),[])}function lt(e,n){let{factory:r,destructor:o,update:i}=e;void 0===n&&(n=[]);const s=t.useRef();return st({onUnmount(){s.current&&o&&o(s.current)}}),t.useMemo(()=>{if(s.current)if(i){const e=i(s.current,n,{factory:r,destructor:o});e&&(s.current=e)}else o&&o(s.current);else i&&s.current||(s.current=r(n));return s.current},n)}function at(e){let{onUpdate:n,shouldUpdate:r,deps:o}=e;t.useEffect(()=>{r&&!r()||n()},o)}function ut(e,t){const{map:n}=H();at({onUpdate:()=>n.insertLayer(e,t),deps:[t,e]})}function ct(e,t){void 0===t&&(t=!0),at({shouldUpdate:()=>e.isDisplayed!==t,onUpdate:()=>e.isDisplayed=t,deps:[t,e]})}function ft(e){let{name:t,zIndex:n,style:o,condition:i,isDisplayed:s}=e;const l=U(),{map:a}=H(),u=lt({factory:()=>new r.EvergisDynamicLayer({name:t,condition:i,style:o},l),destructor:e=>-1!==a.indexOf(e)&&a.removeLayer(e),update:(e,t)=>{let[n,r,o]=t;e.name=n,e.style=r,e.condition=o}},[t,o,i]);return ut(u,n),ct(u,s),u}function dt(e){let{name:t,subDomains:n,zIndex:o,isDisplayed:i}=e;const s=U(),{map:l}=H(),a=lt({factory:()=>new r.EvergisTileLayer({name:t,subDomains:n},s),update:(e,t)=>{let[n,r]=t;e.name=n,e.subDomains=r,"function"==typeof e.clearCache&&e.clearCache(),"function"==typeof e.redraw&&e.redraw()},destructor:e=>-1!==l.indexOf(e)&&l.removeLayer(e)},[t,n]);return ut(a,o),ct(a,i),a}function ht(e){let{zIndex:t,isDisplayed:n=!0,features:r}=e;const{map:o}=H(),i=lt({factory:()=>new s.FeatureLayer({features:r}),destructor:e=>-1!==o.indexOf(e)&&o.removeLayer(e),update:(e,t)=>{let[n]=t;e.features=n}},[r]);return ut(i,t),ct(i,n),i}function pt(e){return e instanceof R.PolygonSymbol||e instanceof P.BrushFill||e instanceof E.ImageFill}function mt(e){return e instanceof p.PolylineSymbol}const yt=new h.PointFeature([50,-50],{crs:k.plain}),gt=new l.Polyline([[0,-57],[26,-57],[40,-35],[60,-65],[74,-43],[100,-43]],{crs:k.plain}),vt=new a.Polygon([[50,-15],[80,-33],[80,-67],[50,-85],[20,-67],[20,-33],[50,-15]],{crs:k.plain}),bt=new l.Polyline([[0,-50],[100,-50]],{crs:k.plain}),kt=new a.Polygon([[0,0],[100,0],[100,-100],[0,-100]],{crs:k.plain}),xt={polygon:new a.Polygon([[50,0],[100,-25],[100,-75],[50,-100],[0,-75],[0,-25]],{crs:k.plain})},wt={polyline:bt,polygon:kt},Ct={point:yt,polyline:gt,polygon:vt},St=function(e,t){return void 0===t&&(t=100),Mt(e,t,xt)},Lt=function(e,t){return void 0===t&&(t=100),Mt(e,t,wt)};function Mt(e,t,n){void 0===t&&(t=100),void 0===n&&(n={});const r=100/t,o=ne({},Ct,n);return pt(e)?e.renderFunctionAsync(o.polygon,r,k.plain):mt(e)?e.renderFunctionAsync(o.polyline,r,k.plain):e.renderFunctionAsync(o.point,r,k.plain)}function Pt(e,t){e.forEach(e=>{t.draw(e)})}const Et=e=>t=>t&&t.type===e,Ft=Et("labelPointSymbol"),zt=Et("polygonLabelSymbol"),Rt=Et("polylineLabelSymbol"),qt=e=>Boolean(e&&(Ft(e)||zt(e)||Rt(e))),At=Et("polygonSymbol"),Tt=Et("simplePolylineSymbol"),_t=Et("compositeSymbol"),Ot=Et("rasterSymbol"),Dt=e=>Boolean(e&&!qt(e)&&!_t(e)&&!Ot(e)),It=e=>({type:"compositeSymbol",childSymbols:e}),Wt=e=>_t(e.symbol)?ne({},e,(e=>{const t=(e=>e&&_t(e)&&e.childSymbols||[])(e);return{symbol:t.find(Dt),label:t.find(qt)||null,raster:t.find(Ot)||null}})(e.symbol),{children:e.children&&e.children.map(Wt)}):e||{},Bt=e=>{const{ignoreLabel:t,label:n,symbol:r,raster:o,children:i}=e,s=ie(e,["ignoreLabel","label","symbol","raster","children"]),l=[!t&&n,o].filter(Boolean);return ne({},s,{symbol:l.length?It([r,...l]):r,children:i?i.map(e=>Bt(ne({},e,{ignoreLabel:t,label:n}))):i})};function Vt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const jt=e=>Boolean(Vt(e)&&e.type&&"byAttribute"===e.type),Nt=e=>jt(e)||(e=>Boolean(Vt(e)&&e.type&&"calculated"===e.type))(e)?e.defaultValue:e,Ut={attribute:null,operation:null,value:null};let Gt=function(){function e(t){$(this,e),this.expressions=[],this.condition=t;const n=new A.ConditionInterpreter(t).value;this.expressions=n instanceof Error?[]:n.expressions}return te(e,[{key:"isUnique",value:function(){return this.leftExpression.operation===A.TokenType.ArEq}},{key:"isRange",value:function(){return[A.TokenType.ArGr,A.TokenType.ArGre,A.TokenType.ArLs,A.TokenType.ArLse].includes(this.leftExpression.operation)}},{key:"toString",value:function(){return this.condition}},{key:"attributeName",get:function(){return this.leftExpression.attribute}},{key:"uniqueValue",get:function(){if(this.isUnique()){const{value:e}=this.leftExpression;return"string"==typeof e?e:""}return console.warn("Trying to get unique from range condition "+this.condition),""}},{key:"range",get:function(){if(!this.isRange())return console.warn("Trying to get range from unique condition "+this.condition),[0,0];if(2===this.expressions.length){const{value:e}=this.leftExpression,{value:t}=this.rightExpression;return[e,t]}if(1===this.expressions.length){const{operation:e,value:t}=this.leftExpression,n=e===A.TokenType.ArGr;return[n?t:null,n?null:t]}return[0,0]}},{key:"type",get:function(){return this.isUnique()?1:0}},{key:"leftExpression",get:function(){return this.expressions.length>0?this.expressions[0]:Ut}},{key:"rightExpression",get:function(){return this.expressions.length>1?this.expressions[1]:Ut}}]),e}();const Zt={defaultTitle:"",defaultValue:null},Xt=function(e,t,n){return void 0===n&&(n=Zt),e.reduce((e,t)=>{const n=new Gt(t.condition||""),r=((e,t,n)=>ne({parameterValue:e,title:t},n.isUnique()?{uniqueValue:n.uniqueValue}:{from:n.range[0],to:n.range[1]}))((e=>"symbol"in e)(t)?t.symbol:t.value,t.title,n);return e.values.push(r),ne({},e,{type:e.type||n.type,attribute:e.attribute||n.attributeName})},ne({},n,{attribute:null,parameter:t,type:null,values:[]}))};let Ht=function(){function e(t){$(this,e),this.style=t,this.classifications=[],this.collectClassifications()}return te(e,[{key:"find",value:function(e){for(const t of this.classifications)if(e(t))return t;return null}},{key:"filter",value:function(e){return this.classifications.filter(e)}},{key:"map",value:function(e){return this.classifications.map(e)}},{key:"reduce",value:function(e,t){return this.classifications.reduce(e,t)}},{key:"hasClassifications",value:function(){return this.classifications.length>0}},{key:"collectClassifications",value:function(){this.style.children&&this.style.children.length&&this.classifications.push(Xt(this.style.children,"symbol")),this.style.symbol&&this.classifications.push(...function e(t,n){return void 0===n&&(n=[]),Object.entries(t).reduce((r,o)=>{let[i,s]=o;const l=(e=>Boolean(e&&"width"in e))(t)&&"height"===i;if(!Vt(s)||l)return r;if(!jt(s))return[...r,...e(t[i],[...n,i])];const a=Xt(s.values,[...n,i].join("."),{defaultTitle:s.title,defaultValue:s.defaultValue});return[...r,a]},[])}(this.style.symbol))}},{key:"values",get:function(){return this.classifications}}]),e}(),Jt=function(){function e(t){$(this,e),this.style=Wt(t),this.classificationManager=new Ht(this.style)}return te(e,[{key:"serialize",value:function(){return Bt(this.style)}},{key:"hasRasters",value:function(){return!(!this.style.raster&&!(this.style.children||[]).some(e=>e.raster))}},{key:"symbol",get:function(){return this.style.symbol}},{key:"raster",get:function(){return this.style.raster}},{key:"label",get:function(){return this.style.label}},{key:"children",get:function(){return this.style.children}},{key:"title",get:function(){return this.style.title}},{key:"condition",get:function(){return this.style.condition}},{key:"ignoreLabel",get:function(){return this.style.ignoreLabel}},{key:"resolution",get:function(){const{minResolution:e,maxResolution:t}=this.style;return void 0===e||void 0===t?null:[e,t]}}]),e}();const Yt=e=>Object.entries(e).reduce((e,t)=>{let[n,r]=t,o=Array.isArray(r)?r.map(Nt):Nt(r);return Vt(o)?ne({},e,{[n]:Yt(r)}):ne({},e,{[n]:o})},{}),Kt=e=>{let{attributes:t,renderTitle:n,skipDefaultValue:r,reverse:o}=e;return e=>{const{defaultTitle:i,defaultValue:s,values:l,attribute:a,parameter:u}=e,c=a&&t?((e,t)=>{const n=t[e],r={name:e};return n?ne({},r,n):r})(a,t):void 0,f={title:i||"Другое",parameterValue:s},d=l.map((e,t)=>({title:n&&n(ne({},e,{attribute:c}),t),parameterValue:e.parameterValue})),h=r?d:[...d,f],p=o?[...h].reverse():h;return{title:c&&c.alias||a,attribute:c,parameter:u,values:p}}},Qt={renderTitle:function(e,t){return e.title?e.title:function(e){return Boolean(e&&"from"in e)}(e)?((e,t)=>{const n=Boolean(e.attribute&&"Double"===e.attribute.type),{from:r,to:o}=function(e,t,n){let{from:r,to:o}=e;return{from:null!==r&&0!==n?t?+r:+r+1:r,to:o}}(e,n,t);return null===r?o+" и менее":null===o?"более "+r:r===o?""+r:r+" - "+o})(e,t):function(e){return Boolean(e&&"uniqueValue"in e)}(e)?e.uniqueValue:""}},$t=(e,n)=>{const{style:r,layerDefinition:o}=e||{},{attributes:i}=o||{};return((e,n)=>t.useMemo(()=>e&&n&&n.attributes?function(e,t){const{classificationManager:n,symbol:r}=e,o=n.filter(e=>{let{parameter:n}=e;return!t.parameters||!n||t.parameters.includes(n)});return 0===o.length?null:{symbol:Yt(r),items:o.map(Kt(t))}}(e,n):null,[e,n]))(r&&new Jt(r),ne({attributes:i},Qt,n))};function en(e,n){const{map:r}=H(),i=n?o.BboxChangeEvent:o.BboxChangeEndEvent,s=t.useCallback(()=>{e&&e(tn(r))},[e,r,i]);t.useEffect(()=>(r.on(i.type,s),()=>{r.off(i.type,s)}),[s,i])}function tn(e){return{position:e.position.slice(0),resolution:e.resolution}}function nn(e){return e._currentRender&&e._currentRender.bbox&&e._currentRender.bbox.coordinates}function rn(e){let t={};for(const n of e)r.isEvergisDynamicLayer(n)&&(t[n.name]=nn(n));return t}function on(e){const{map:n}=H(),[,r]=t.useReducer(sn,void 0,()=>tn(n));return en(t.useCallback(r,[]),e),tn(n)}function sn(e,t){return t}function ln(){const{map:e,painter:n}=H(),{position:r,resolution:o}=on(),i=t.useMemo(()=>{const t=e.tileScheme.getLevel(o);if(void 0!==t||null!==t)return e.tileScheme.levels[t].zIndex},[o]),s=t.useMemo(()=>n.bbox,[r,o]);return{position:r,resolution:o,level:i,bbox:s}}function an(){const{map:e}=H(),{resolution:n}=on(!0);return t.useMemo(()=>{const t=e.tileScheme.getLevel(n);if(void 0!==t||null!==t)return e.tileScheme.levels[t].zIndex},[n])}const un=()=>{const{painter:e}=H();return t.useCallback(t=>{if("point"in t)return t.point;const n="browserEvent"in t?t.browserEvent:t,r=e.wrapper,{x:o,y:i}=O.getMouseOffset(r,"touches"in n?{pageX:n.touches[0].pageX,pageY:n.touches[0].pageY}:n);return e.getPointFromPxPosition(o,i)},[e])};function cn(){const{map:e,painter:n}=H(),r=un(),o=t.useCallback(t=>{e.zoom(t,e.position)},[e]),i=t.useCallback(()=>o(1),[o]),s=t.useCallback(()=>o(-1),[o]),l=t.useCallback(t=>{let{position:r,resolution:o,extent:i}=t;if(r||o){const t=r?r.slice(0):e.position;e.animateTo(t,o||e.resolution)}if(i){const{xMax:t,xMin:r,yMax:o,yMin:s}=i,l=new _.Bbox([r,o],[t,s],e.crs);n&&n.show(l,!0)}},[e,n]),a=t.useCallback(t=>{e.zoom(1,r(t))},[r,e]);return{zoomTo:o,zoomIn:i,zoomOut:s,zoomAround:a,animateTo:l}}function fn(){const{painter:e}=H(),n=t.useRef(null);return st({onMount:()=>e.wrapper=n.current,onUnmount:()=>e.wrapper=null}),n}const dn=e=>t=>{let{zIndex:n}=t;return n===e},hn=(e,n,r,o)=>{const{map:i}=H();t.useEffect(()=>{const t=i.tileScheme.levels;if(void 0!==n){const{resolution:e}=t.find(dn(n))||{resolution:-1};i.minResolution=e}if(void 0!==e){const{resolution:n}=t.find(dn(e))||{resolution:-1};i.maxResolution=n}void 0===e&&void 0===n||pn(i,r,o)},[i,e,n])},pn=(e,t,n)=>{if(t&&n){const r=Math.min(Math.max(n,e.minResolution||0),e.maxResolution||Number.MAX_VALUE);e.animateTo(t,r)}};function mn(e){const t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}function yn(e,n){let{position:r,resolution:o}=e;const{map:i}=H(),{animateTo:s}=cn();t.useEffect(()=>{gn(i,{position:r,resolution:o})&&s({position:r,resolution:o})},[r,o,n])}function gn(e,t){let{position:n,resolution:r}=t;return function(e,t){return t&&(!w.softEquals(e.position[0],t[0])||!w.softEquals(e.position[1],t[1]))}(e,n)||function(e,t){return t&&!w.softEquals(e.resolution,t)}(e,r)}const vn=function(e){void 0===e&&(e=1);const{layer:n,popupLayer:r}=Q(),{map:i}=H(),s=un(),l=t.useRef([]),a=t.useRef(null),u=t.useRef([]),c=t.useCallback(()=>r.remove(r.features),[r]),f=t.useCallback(()=>{l.current.forEach((e,t)=>{const n=u.current[t];if(n){const{onMouseOver:t,onMouseMove:r,onMouseOut:o,onClick:i}=n;e.hasListener("mouseover",t)&&e.off("mouseover",t),e.hasListener("mousemove",r)&&e.off("mousemove",r),e.hasListener("mouseout",o)&&e.off("mouseout",o),e.hasListener("click",i)&&e.off("click",i)}}),i.off("click",c),l.current=[],a.current=null,n.remove(n.features),u.current=[],-1!==i.indexOf(r)&&i.removeLayer(r)},[c,r,n,i]);t.useEffect(()=>(-1===i.indexOf(n)&&i.insertLayer(n,e),f),[f,i,n,e]);const d=t.useCallback(t=>{let{point:o,position:s,component:l,clickMode:u}=t;const c=new v.LabelFeature(s||o.position,{symbol:new ce({component:l}),crs:i.crs});u?(-1===i.indexOf(r)&&i.insertLayer(r,e),r.remove(r.features),r.add(c)):(a.current=c,n.add(c))},[r,n,i,e]),h=t.useCallback(e=>{e.node&&(e.node.doNotBubbleToMap=!0),e.stopPropagation(),a.current&&n.has(a.current)&&n.remove(a.current),a.current=null,n.remove(n.features)},[n]);return t.useCallback(e=>{const{feature:t,position:r,component:f,clickMode:p}=e,m=t||i;l.current.push(m);const y=m instanceof o.Map,g={onMouseOver:e=>{e.stopPropagation(),h(e),d({point:s(e),position:r,component:f})},onMouseMove:e=>{y||e.stopPropagation(),e.node&&(e.node.doNotBubbleToMap=!0);const t=s(e);a.current?(y&&!n.has(a.current)&&n.add(a.current),a.current.position=r||t.position):d({point:t,position:r,component:f})}};p&&(g.onClick=e=>{e.stopPropagation(),d({point:s(e),position:r,component:f,clickMode:p})}),g.onMouseOut=h,u.current.push(g);const{onMouseOver:v,onMouseMove:b,onMouseOut:k,onClick:x}=g;p&&!y?(m.on("mouseover",k),m.on("mousemove",k),m.on("click",x),i.hasListener("click",c)||i.on("click",c)):(y||m.on("mouseover",v),m.on("mousemove",b),m.on("mouseout",k))},[h,c,i,d,s,n])};function bn(e){let{zIndex:n,isDisplayed:r=!0,features:o,onChangeGrid:i,size:s,distance:l,clusterSymbol:a}=e;const{map:u}=H(),c=t.useRef(o),f=lt({factory:()=>{const e=new I.GridClusterProvider({size:s,distance:l,onChangeGrid:i?e=>i(e,f):void 0}),t=new D.ClusterLayer({gridClusterProvider:e,clusterSymbol:a});return c.current=o,t.add(o),t},destructor:e=>-1!==u.indexOf(e)&&u.removeLayer(e),update:(e,t)=>{let[n]=t;e.remove(c.current),e.add(n),c.current=n}},[o]);return ut(f,n),ct(f,r),f}const kn=t.createContext(null),xn=e=>{let{symbol:t,children:r}=e;return n.createElement(kn.Provider,{value:t||null},r)};function wn(){const e=ue(["\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"]);return wn=function(){return e},e}function Cn(){const e=ue(["\n display: flex;\n align-items: center;\n font-size: 0.625rem;\n padding: 0.125rem 0;\n\n "," {\n padding-left: 0.5rem;\n }\n"]);return Cn=function(){return e},e}function Sn(){const e=ue(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n"]);return Sn=function(){return e},e}function Ln(){const e=ue([""]);return Ln=function(){return e},e}function Mn(){const e=ue(["\n background-color: #fff;\n\n canvas {\n border-radius: 0.125rem;\n }\n"]);return Mn=function(){return e},e}const Pn=L.div(Mn()),En=L.div(Ln()),Fn=L.p(Sn()),zn=L.div(Cn(),Fn),Rn=L.div(wn()),qn=e=>{let{item:t,children:r}=e;return n.createElement(En,null,n.createElement(Rn,null,t.title),t.values.map(r))},An=e=>(t,n)=>{const r=Array.isArray(n)?n:(e=>e.split("."))(n),[o,...i]=r,s=t[o];return ne({},t,i.length?{[o]:An(e)(s,i)||s}:{[o]:e(s)||s})},Tn=(e,t,n)=>An(()=>n)(e,t),_n=e=>e?new W.Color(e).toString("hex"):void 0;function On(e,t,n){return Math.min(Math.max(e,t),n)}const Dn=e=>e&&"solid"!==e.type?((e,t,n)=>{if(!e||!e.length)return[];const r=[];for(let o=0;o<e.length;o++)o%2&&r.push(...n([e[o-1],e[o]],t));return r})(e.intervals,On(Nt(e.width),.25,6.5),(e,t)=>{let[n,r]=e;return[Math.round(n/Math.max(1,Math.min(t,16)/4)),Math.round(r+1+Math.max(1,Math.min(t,16)/2))]}):[],In=Et("hatch"),Wn=Et("pattern"),Bn=Et("dashed"),Vn=e=>{if("hatch"===e.type)return((e,t,n)=>{const r=Math.max(Math.round([Math.max(...n),t].reduce((e,t)=>e+t,0)),t),o=(i=r,Array(i).fill(null).map(()=>Array(i)));var i;return((e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t(r,o,n)})(o,(t,n,r)=>((e,t,n,r)=>{const o=Math.round(e/2);return(0===t||t===Math.PI)&&n===o||t===Math.PI/4&&r===n||t===Math.PI/2&&r===o||t===3*Math.PI/4&&e-1-r===n})(r,e,t,n)?255:0),o})(Nt(e.hatchAngle),Math.round(e.hatchWidth),e.scalingFactor)};let jn=function(e){re(n,P.BrushFill);var t=le(n);function n(e){var r,o,i,s,l;return $(this,n),(l=t.call(this,{strokeColor:_n(Nt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Nt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Dn(e.stroke),fillBackground:_n(Nt(null===(i=e.fill)||void 0===i?void 0:i.color)),fillForeground:In(e.fill)?_n(Nt(null===(s=e.fill)||void 0===s?void 0:s.hatchColor)):void 0,fillBrush:Vn(e.fill),lineCap:"square"})).originalSymbol=e,l}return te(n,[{key:"_updateBrush",value:function(){if(!this._initialized)return;const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=this.fillBrush,r=n.length,o=new W.Color(this.fillForeground),i=new W.Color(this.fillBackground);e.height=r,e.width=r;for(let e=0;e<r;e++)for(let r=0;r<n[e].length;r++){const s=n[e][r]*o.a/65025,l=i.a/255*(1-s),a=+Math.min(1,s+l).toFixed(2),u=Math.round(Math.min(255,i.r*l+o.r*s)),c=Math.round(Math.min(255,i.g*l+o.g*s)),f=Math.round(Math.min(255,i.b*l+o.b*s));t.fillStyle="rgba("+u+","+c+","+f+","+a+")",t.fillRect(r,e,1,1)}this._brush=new Image,this._brush.src=e.toDataURL()}},{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}(),Nn=function(e){re(n,E.ImageFill);var t=le(n);function n(e){var r,o,i;return $(this,n),(i=t.call(this,{strokeColor:_n(Nt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Nt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Dn(e.stroke),src:"data:image/png;base64,"+e.fill.pattern,lineCap:Bn(e.stroke)?"square":"round"})).originalSymbol=e,i}return te(n,[{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}();const Un={small:e=>3*(e+1)+1,large:e=>5*(e+1)-1};let Gn=function(){function e(t){$(this,e),this.getAnchor=e=>{if("right"===this.position){const t=e[e.length-1];return t&&t[t.length-1]||null}const t=e[0];return t&&t[0]||null},Object.assign(this,t)}return te(e,[{key:"getRender",value:function(e,t,n,r){const o="right"===this.position?1:-1,i=this.getAnchor(e),s=((e,t,n,r)=>{const o=b.projectRings(e,n,r);return w.simplifyCoordinates(o.map(e=>e.map(e=>{let[n,r]=e;return[n/t,r/-t]})),1)})(this.createRings(i,o),n,t,r);return this.createRender(s)}},{key:"miterSize",get:function(){const e=Un[this.size];return e?e(this.strokeWidth):1}}]),e}();var Zn;!function(e){e.None="none",e.Arrow="arrow",e.FilledArrow="filledArrow",e.Square="square",e.FilledSquare="filledSquare",e.Circle="circle",e.FilledCircle="filledCircle"}(Zn||(Zn={}));let Xn=function(e){re(n,Gn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n,r+this.miterSize/2],[n+this.miterSize*t,r],[n,r-this.miterSize/2]]]}},{key:"createRender",value:function(e){const t=this.kind===Zn.FilledArrow;return new y.PolyRender(e,{enclosed:t,fillColor:t?this.color:void 0,fillStyle:t?y.FillStyle.Color:y.FillStyle.None,lineCap:"square",lineJoin:"miter",strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+this.strokeWidth}}]),n}(),Hn=function(e){re(n,Gn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n+(this.miterSize/2+this.strokeWidth)*t,r]]]}},{key:"createRender",value:function(e){return new f.Arc(e[0][0],{fillColor:this.kind===Zn.FilledCircle?this.color:"transparent",radius:this.miterSize/2,strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+3*this.strokeWidth}}]),n}(),Jn=function(e){re(n,Gn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n,r+this.miterSize/2],[n,r-this.miterSize/2],[n+this.miterSize*t,r-this.miterSize/2],[n+this.miterSize*t,r+this.miterSize/2]]]}},{key:"createRender",value:function(e){const t=this.kind===Zn.FilledSquare;return new y.PolyRender(e,{enclosed:!0,fillColor:t?this.color:void 0,fillStyle:t?y.FillStyle.Color:y.FillStyle.None,lineCap:"square",lineJoin:"miter",strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+this.strokeWidth}}]),n}();const Yn=e=>{switch(e.kind){case Zn.Arrow:case Zn.FilledArrow:return new Xn(e);case Zn.Square:case Zn.FilledSquare:return new Jn(e);case Zn.Circle:case Zn.FilledCircle:return new Hn(e);default:return null}},Kn=(e,t,n)=>e.map((r,o)=>{switch(t){case"right":return((e,t,n)=>{const r=e.slice().reverse();for(let e=0;e<r.length;e++){const o=r[e];n&&0===e&&(r[e]=[o[0]-t,o[1]]);const i=r[e-1];i&&i[0]<o[0]&&(r[e]=[i[0]-Math.abs(i[0]-o[0]),o[1]])}return r.reverse()})(r,n,o===e.length-1);default:return((e,t,n)=>{const r=e.slice();for(let e=0;e<r.length;e++){const o=r[e];0===e&&n&&(r[e]=[o[0]+t,o[1]]);const i=r[e-1];i&&i[0]>o[0]&&(r[e]=[i[0]+Math.abs(o[0]-i[0]),o[1]])}return r})(r,n,0===o)}});let Qn=function(e){re(n,p.PolylineSymbol);var t=le(n);function n(e){var r,o,i;return $(this,n),(i=t.call(this,{strokeColor:_n(Nt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:On(Nt(null===(o=e.stroke)||void 0===o?void 0:o.width),.25,6.5),lineDash:Dn(e.stroke),lineCap:Bn(e.stroke)?"square":"round"})).originalSymbol=e,i}return te(n,[{key:"renderFunction",value:function(e,t,r){if(!Tt(this.originalSymbol))return ae(oe(n.prototype),"renderFunction",this).call(this,e,t,r);const{ending:o,beginningSize:i,beginning:s,endingSize:l}=this.originalSymbol,a=[],u=e.clone(),c=Yn({color:this.strokeColor,kind:s,position:"left",size:i,strokeWidth:this.strokeWidth}),f=Yn({color:this.strokeColor,kind:o,position:"right",size:l,strokeWidth:this.strokeWidth});if(c){const n=Kn(u.rings,"left",c.usageSize),o=c.getRender(n,e.crs,t,r);u.rings=n,a.push(o)}if(f){const n=Kn(u.rings,"right",f.usageSize),o=f.getRender(n,e.crs,t,r);u.rings=n,a.push(o)}return a.unshift(...ae(oe(n.prototype),"renderFunction",this).call(this,u,t,r)),a}},{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}(),$n=function(e){re(n,R.PolygonSymbol);var t=le(n);function n(e){var r,o,i,s;return $(this,n),(s=t.call(this,{strokeColor:_n(Nt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Nt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Dn(e.stroke),fillColor:_n(Nt(null===(i=e.fill)||void 0===i?void 0:i.color)),lineCap:Bn(e.stroke)?"square":"round"})).originalSymbol=e,s}return te(n,[{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}();function er(e){let{size:t,offset:n,strokeColor:r,strokeWidth:o,fillColor:i}=e;return{size:Nt(t),offset:nr(n),strokeWidth:Nt(o),strokeColor:rr(Nt(r)),fillColor:rr(Nt(i))}}function tr(e){return"data:image/png;base64,"+e}function nr(e){return e.map(Nt)}function rr(e){return e?new W.Color(e).toString():null}const or=e=>{let{parameter:r,parameterValue:o,children:i}=e;const s=(e=>{let{parameter:n,parameterValue:r}=e;const o=t.useContext(kn),i=o&&function(e,t,n){return"symbol"===t?n:Tn(e,t,n)}(o,n,r);return i&&function(e){switch(e.type){case"circlePointSymbol":return function(e){return new d.PointSymbol(er(e))}(e);case"squarePointSymbol":return function(e){return new z.SquareSymbol(ne({},er(e),{angle:Nt(e.angle)}))}(e);case"maskedImagePointSymbol":return function(e){return new q.MaskedImage(ne({},e,{angle:Nt(e.angle),width:Nt(e.width),height:Nt(e.height),anchorPoint:nr(e.offset),imageSource:tr(e.image),maskSource:tr(e.imageMask),maskColor:rr(Nt(e.maskedColor))}))}(e);case"imagePointSymbol":return function(e){return new F.StaticImageSymbol(ne({},e,{angle:Nt(e.angle),width:Nt(e.width),height:Nt(e.height),anchorPoint:nr(e.offset),source:tr(e.image)}))}(e);case"polygonSymbol":return function(e){return(e=>Boolean(e&&At(e)&&Wn(e.fill)))(e)?new Nn(e):(e=>Boolean(e&&At(e)&&In(e.fill)))(e)?new jn(e):new $n(e)}(e);case"simplePolylineSymbol":case"polylineSymbol":return function(e){return new Qn(e)}(e);default:return null}}(i)})({parameterValue:o,parameter:r});return s?n.createElement(n.Fragment,null,i(s)):null},ir=16,sr=e=>{let{symbol:r,size:o,render:i}=e;const{canvas:s,ref:l}=function(){const e=t.useRef(null),n=t.useCallback(t=>{e.current=null!==t?new B.Canvas(t):null},[]);return{canvas:e,ref:n}}();return function(e,n){let{symbol:r,size:o=ir,render:i=Mt,maxWidth:s}=e;t.useEffect(()=>{if(null!==n.current){const e=n.current;!function(e,t,n){e.node.height=t,e.node.width=n?Math.min(t,n):t}(e,o,s),i(r,o).then(t=>{Pt(t,e)})}},[r,o,s])}({symbol:r,size:o,render:i},s),n.createElement("canvas",{ref:l})},lr=e=>{let{value:t,parameter:r}=e;return n.createElement(zn,null,n.createElement(or,{parameter:r,parameterValue:t.parameterValue},e=>n.createElement(sr,{render:Lt,symbol:e,size:16})),n.createElement(Fn,null,t.title))};function ar(){const e=ue(["\n margin: 0.5rem;\n font-size: 0.625rem;\n opacity: 0.65;\n"]);return ar=function(){return e},e}function ur(){const e=ue(["\n display: flex;\n align-items: center;\n"]);return ur=function(){return e},e}function cr(){const e=ue(["\n margin: 0;\n"]);return cr=function(){return e},e}function fr(){const e=ue(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 16.5rem;\n height: 3.875rem;\n align-items: center;\n padding: 0.5rem;\n box-sizing: border-box;\n\n canvas {\n height: 1rem;\n width: 0.835rem;\n }\n"]);return fr=function(){return e},e}function dr(){const e=ue(["\n cursor: default;\n"]);return dr=function(){return e},e}const hr=L(Ke)(dr()),pr=L.div(fr()),mr=L(Rn)(cr()),yr=L.div(ur()),gr=L.div(ar()),vr=e=>{let{value:t,parameter:r}=e;return n.createElement(or,{key:t.title,parameter:r,parameterValue:t.parameterValue},e=>n.createElement(sr,{render:St,symbol:e,size:100}))},br=["Выше","Ниже"];function kr(){const e=ue(["\n position: absolute;\n z-index: 999;\n display: flex;\n font-size: 0.625rem;\n color: #fff;\n background-color: rgba(28, 33, 48, 0.8);\n padding: 0.4em 0.6em;\n border-radius: 2px;\n user-select: none;\n box-sizing: border-box;\n white-space: pre;\n ","\n ","\n"]);return kr=function(){return e},e}function xr(){const e=ue(["\n &:before {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n }\n"]);return xr=function(){return e},e}function wr(){const e=ue(["\n ","\n ","\n ","\n ","\n"]);return wr=function(){return e},e}function Cr(){const e=ue(["\n transform: translate(-50%, 0);\n left: -50%;\n top: ",";\n ","\n"]);return Cr=function(){return e},e}function Sr(){const e=ue(["\n transform: translate(0, -50%);\n top: -50%;\n right: ",";\n ","\n"]);return Sr=function(){return e},e}function Lr(){const e=ue(["\n transform: translate(0, -50%);\n top: -50%;\n left: ",";\n ","\n"]);return Lr=function(){return e},e}function Mr(){const e=ue(["\n transform: translate(-50%, 0);\n left: -50%;\n bottom: ",";\n ","\n"]);return Mr=function(){return e},e}function Pr(){const e=ue(["\n &:before {\n transform: translate(-50%, -100%);\n left: 50%;\n top: 0;\n border-left: "," solid transparent;\n border-right: "," solid transparent;\n border-bottom: "," solid rgba(28, 33, 48, 0.8);\n }\n"]);return Pr=function(){return e},e}function Er(){const e=ue(["\n &:before {\n transform: translate(100%, -50%);\n right: 0;\n top: 50%;\n border-top: "," solid transparent;\n border-left: "," solid rgba(28, 33, 48, 0.8);\n border-bottom: "," solid transparent;\n }\n"]);return Er=function(){return e},e}function Fr(){const e=ue(["\n &:before {\n transform: translate(-100%, -50%);\n left: 0;\n top: 50%;\n border-top: "," solid transparent;\n border-right: "," solid rgba(28, 33, 48, 0.8);\n border-bottom: "," solid transparent;\n }\n"]);return Fr=function(){return e},e}function zr(){const e=ue(["\n &:before {\n left: 50%;\n transform: translate(-50%, 100%);\n bottom: 0;\n border-left: "," solid transparent;\n border-right: "," solid transparent;\n border-top: "," solid rgba(28, 33, 48, 0.8);\n }\n"]);return zr=function(){return e},e}const Rr=S.css(xr()),qr=L.div(kr(),e=>{let{placement:t,distance:n="0.5rem",withArrow:r,cornerSize:o="0.25rem"}=e;return function(e,t,n){return void 0===e&&(e="top"),S.css(wr(),"top"===e&&((e,t)=>S.css(Mr(),e,t&&(e=>S.css(zr(),e,e,e))(t)))(t,n),"right"===e&&((e,t)=>S.css(Lr(),e,t&&(e=>S.css(Fr(),e,e,e))(t)))(t,n),"left"===e&&((e,t)=>S.css(Sr(),e,t&&(e=>S.css(Er(),e,e,e))(t)))(t,n),"bottom"===e&&((e,t)=>S.css(Cr(),e,t&&(e=>S.css(Pr(),e,e,e))(t)))(t,n))}(t,n,r?o:null)},e=>{let{withArrow:t}=e;return t&&Rr}),{Provider:Ar,Consumer:Tr}=t.createContext([]);exports.AVAILABLE_BASE_MAPS=["2gis","osm_mono","carto_dm","sputnik","stamen_terrain","stamen_toner","stamen_watercolor"],exports.BaseMeasureToolCreator=Ee,exports.BaseMeasureToolEditor=Fe,exports.CONTROL_PLACEMENTS=["top-left","top-right","bottom-left","bottom-right"],exports.ClusterLayer=e=>(bn(e),null),exports.EvergisDynamicLayer=e=>(ft(e),null),exports.EvergisProvider=e=>{let{api:r,children:o}=e;const i=t.useMemo(()=>r||j,[r]);return n.createElement(N.Provider,{value:i},o)},exports.EvergisTileLayer=e=>(dt(e),null),exports.FeatureLayer=e=>(ht(e),null),exports.Fullscreen=()=>n.createElement(Ke,null,n.createElement(Je,{onClick:()=>{}})),exports.FullscreenBtn=Je,exports.LabelSymbol=ce,exports.Legend=e=>{let{layer:t,children:r,className:o,config:i}=e;const s=$t(t,i);return s?n.createElement(xn,{symbol:s.symbol},n.createElement(Pn,{className:o},r?r(s):s.items.map(e=>n.createElement(qn,{key:e.attribute+"-"+e.parameter,item:e},t=>n.createElement(lr,{key:t.title,value:t,parameter:e.parameter}))))):null},exports.LegendContainer=Pn,exports.LegendSection=qn,exports.LegendSectionContainer=En,exports.LegendSectionHeader=Rn,exports.LegendSymbol=or,exports.LegendSymbolTitle=Fn,exports.LegendValue=lr,exports.LegendValueContainer=zn,exports.Map=e=>{let{className:r,position:o,resolution:i,minScale:s,maxScale:l,children:a,onBboxChange:u,style:c}=e;const f=fn(),{map:d}=H(),h=t.useCallback(e=>{u&&gn(d,{position:o,resolution:i})&&u(e)},[d,u,o,i]);return yn({position:o,resolution:i}),hn(s,l,o,i),en(h),n.createElement("div",{className:r,ref:f,style:c},a)},exports.MapControl=Ke,exports.MapControls=Qe,exports.MapLegend=e=>{let{layer:t,config:r,fromToTitle:o=br,className:i}=e;const s=((e,t)=>{const n=$t(e,t);if(!n)return null;const r=n.items[0];return{symbol:Tn(n.symbol,"stroke.color","#fff"),item:r}})(t,r);if(!s)return null;const{symbol:l,item:a}=s;return n.createElement(xn,{symbol:l},n.createElement(hr,{className:i},n.createElement(pr,null,n.createElement(mr,null,a.title),n.createElement(yr,null,n.createElement(gr,null,o[0]),a.values.map(e=>n.createElement(vr,{key:e.title,value:e,parameter:a.parameter})),n.createElement(gr,null,o[1])))))},exports.MapLegendContainer=pr,exports.MapLegendControl=hr,exports.MapLegendHeader=mr,exports.MapLegendSection=yr,exports.MapLegendSymbol=vr,exports.MapLegendValueDescr=gr,exports.MapProvider=e=>{let{map:r,painter:o,children:s}=e;const l=t.useMemo(()=>({map:r||G,painter:o||(r?new i.DomPainter(r):Z)}),[r,o]);return n.createElement(X.Provider,{value:l},s)},exports.Measure=()=>n.createElement(Ke,null,n.createElement(Ye,{onClick:()=>{}})),exports.MeasureBtn=Ye,exports.MeasureTool=ze,exports.Measurer=e=>{let{isActive:t,renderLabelSymbol:r}=e;const{map:o,painter:i}=H();return t?n.createElement(ze,{map:o,painter:i,renderLabelSymbol:r}):null},exports.ScaleRuler=()=>{const{resolution:e}=ln(),r=function(e){const{painter:n}=H(),{height:r,width:o}=n;return t.useMemo(()=>{if(0===o)return e;const t=o/10,i=n.getPointFromPxPosition(0,r/2),s=n.getPointFromPxPosition(t,r/2);return b.distance(i,s)/t},[r,o,e,n])}(e||0),o=50*r,i=it(o),s=it(o)/r;return n.createElement(nt,null,n.createElement(rt,{width:s},n.createElement(ot,{alignEnd:!0,margin:"0"},i>=1e3?i/1e3+"km":i+"m")))},exports.ScaleRulerBlock=rt,exports.ScaleRulerContainer=nt,exports.Search=()=>n.createElement(Ke,null,n.createElement(He,{onClick:()=>{}})),exports.SearchBtn=He,exports.ShadowedPointSymbol=me,exports.ShadowedPolySymbol=ye,exports.StyleProxy=Jt,exports.Symbol=sr,exports.TextContainer=ot,exports.TileLayer=e=>(function(e){let{maskUrl:t,zIndex:n,isDisplayed:r}=e,o=ie(e,["maskUrl","zIndex","isDisplayed"]);const{map:i}=H(),s=lt({factory:()=>new V.TileLayer(t,o),destructor:e=>-1!==i.indexOf(e)&&i.removeLayer(e)},[t]);ut(s,n),ct(s,r)}(e),null),exports.Tooltip=e=>{let{features:r=[],map:i,center:s,component:l,zIndex:a,children:u,content:c,onEachFeature:f,clickMode:d}=e,h=ie(e,["features","map","center","component","zIndex","children","content","onEachFeature","clickMode"]);const p=vn(a);return t.useEffect(()=>{(i?[i]:r).forEach(e=>{p({feature:e,component:"function"==typeof f?()=>f(e):()=>n.createElement(qr,Object.assign({},h),c),position:!s||e instanceof o.Map||!e.bbox.center?void 0:e.bbox.center,clickMode:d})})},[c,d,f,p,i,s,r,l,h]),n.createElement(Ar,{value:r},i?u:u?n.createElement(Tr,null,u):null)},exports.TooltipComponent=qr,exports.TooltipProvider=e=>{let{layer:r,popupLayer:o,children:i}=e;const s=t.useMemo(()=>({layer:r||J,popupLayer:o||Y}),[r,o]);return n.createElement(K.Provider,{value:s},i)},exports.Zoom=e=>{let{children:t}=e;const{zoomIn:r,zoomOut:o}=cn();return n.createElement(Ke,null,n.createElement(Ze,{onClick:r}),n.createElement(Xe,{onClick:o}),t)},exports.ZoomInBtn=Ze,exports.ZoomLevel=()=>{const e=an();return n.createElement(ot,{buttonText:!0,width:"2rem"},e||0)},exports.ZoomOutBtn=Xe,exports.createLabelSymbol=de,exports.createShadowRender=he,exports.defaultOffset=fe,exports.formatArea=Se,exports.formatLength=Le,exports.getEditorPointRenderer=pe,exports.getLegendSymbolRenders=Lt,exports.getMapLegendSymbolRenders=St,exports.getMapState=tn,exports.getScale=it,exports.getSymbolRenders=Mt,exports.isImageSymbol=function(e){return e instanceof F.StaticImageSymbol||e instanceof q.MaskedImage},exports.isPointSymbol=function(e){return e instanceof d.PointSymbol||e instanceof F.StaticImageSymbol||e instanceof z.SquareSymbol||e instanceof q.MaskedImage},exports.isPolygonSymbol=pt,exports.isPolylineSymbol=mt,exports.measureAreaSymbol=ke,exports.measureLengthSymbol=be,exports.measurePolygonSnapSymbol=xe,exports.placementMixin=Oe,exports.renderSymbolToCanvas=Pt,exports.shouldUpdateMapState=gn,exports.useClusterLayer=bn,exports.useEventPoint=un,exports.useEvergisContext=U,exports.useEvergisDynamicLayer=ft,exports.useEvergisTileLayer=dt,exports.useFeatureLayer=ht,exports.useLayerLegend=$t,exports.useLayerOrder=ut,exports.useLayerVisibility=ct,exports.useMapBboxChange=en,exports.useMapContext=H,exports.useMapLevel=an,exports.useMapPick=()=>{const{map:e,painter:n}=H(),[r,o]=t.useState(),i=t.useMemo(()=>e.layers,[e.layers]),s=t.useCallback(e=>{if(!(e instanceof T.sGisClickEvent))return;const t=[0,0,n.width,n.height],[r,s]=n.getPxPosition(e.point.position);o({clickPoint:[Math.round(r),Math.round(s)],envelopes:rn(i),imageRectangle:t})},[e]);return st({onMount:()=>e.on("click",s),onUnmount:()=>e.off("click",s)}),r},exports.useMapState=on,exports.useMapView=ln,exports.useMapViewActions=cn,exports.useMapWrapper=fn,exports.useMaxMinScale=hn,exports.useMount=st,exports.useProperty=lt,exports.useScale=function(e){let{resolution:n,minLength:r=50}=e;const o=function(e){const{painter:n}=H(),{height:r,width:o,bbox:{xMin:i,xMax:s,yMin:l,yMax:a,crs:u}}=n;return t.useMemo(()=>{if(0===o)return e;const t=o/10,i=n.getPointFromPxPosition(0,r/2),s=n.getPointFromPxPosition(t,r/2);return b.distance(i,s)/t},[r,o,i,s,l,a,u.wkid,e,n])}(n);return t.useMemo(()=>{const e=r*o;return{currentScale:mn(e),width:mn(e)/o}},[o,r])},exports.useTooltip=vn,exports.useTooltipContext=Q,exports.useUpdate=at,exports.useUpdateMapView=yn; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),n=e(t),r=require("@evergis/api"),o=require("@evergis/sgis/es/Map"),i=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),s=require("@evergis/sgis/es/layers/FeatureLayer"),l=require("@evergis/sgis/es/features/Polyline"),a=require("@evergis/sgis/es/features/Polygon"),u=e(require("react-dom")),c=require("@evergis/sgis/es/symbols/Symbol"),f=require("@evergis/sgis/es/renders/Arc"),d=require("@evergis/sgis/es/symbols/point/Point"),h=require("@evergis/sgis/es/features/PointFeature"),p=require("@evergis/sgis/es/symbols/PolylineSymbol"),m=require("@evergis/sgis/es/features/Poly"),y=require("@evergis/sgis/es/renders/Poly"),g=require("@evergis/sgis/es/controls/PolylineControl"),v=require("@evergis/sgis/es/features/Label"),b=require("@evergis/sgis/es/geotools"),x=require("@evergis/sgis/es/Crs"),k=require("@evergis/sgis/es/controls/Control"),w=require("@evergis/sgis/es/utils/math"),C=require("@evergis/sgis/es/controls/PolyEditor"),S=require("styled-components"),L=e(S),M=require("@evergis/icons"),P=require("@evergis/sgis/es/symbols/polygon/BrushFill"),E=require("@evergis/sgis/es/symbols/polygon/ImageFill"),z=require("@evergis/sgis/es/symbols/point/StaticImageSymbol"),F=require("@evergis/sgis/es/symbols/point/Square"),R=require("@evergis/sgis/es/symbols/polygon/Simple"),q=require("@evergis/sgis/es/symbols/point/MaskedImage"),T=require("@evergis/condition"),A=require("@evergis/sgis/es/commonEvents"),_=require("@evergis/sgis/es/Bbox"),O=require("@evergis/sgis/es/utils/domEvent"),D=require("@evergis/sgis/es/layers/ClusterLayer"),I=require("@evergis/sgis/es/layers/clusterProviders/GridClusterProvider"),W=require("@evergis/color"),B=require("@evergis/sgis/es/painters/DomPainter/Canvas"),V=require("@evergis/sgis/es/layers/TileLayer");const j=new r.Api({url:"/"}),N=t.createContext(j),U=()=>t.useContext(N),G=new o.Map,Z=new i.DomPainter(G),X=t.createContext({map:G,painter:Z}),H=()=>t.useContext(X),J=new s.FeatureLayer,Y=new s.FeatureLayer,K=t.createContext({layer:J,popupLayer:Y}),Q=()=>t.useContext(K);function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),e}function ne(){return(ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function se(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe(e);if(t){var o=oe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return se(this,n)}}function ae(e,t,n){return(ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=oe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function ue(e,t){return t||(t=e.slice(0)),e.raw=t,e}let ce=function(e){re(r,c.DynamicPointSymbol);var t=le(r);function r(e){var n;let{component:o,offset:i}=void 0===e?{}:e;return $(this,r),(n=t.call(this,{offset:i})).component=o,n}return te(r,[{key:"_getFeatureNode",value:function(e){const t=document.createElement("div");return this.renderDom(e.content,t),t}},{key:"_updateFeatureNode",value:function(e){this.renderDom(e.content,this.getNode(e))}},{key:"renderDom",value:function(e,t){if(!t)return;const r=this.component;r?u.render(n.createElement(r,{content:e}),t):t.innerText=e}}]),r}();const fe=[8,-16],de=e=>{const{offset:t=fe,renderLabel:r=(e=>{let{content:t}=e;return n.createElement("div",null,t)}),onClose:o}=e||{};return new ce({offset:t,component:e=>{let{content:t}=e;return r({content:t,onClose:o})}})};function he(e,t){let{strokeWidth:n=2,shadowColor:r,shadowSize:o,size:i=6}=t;return new f.Arc(e,{fillColor:"transparent",strokeColor:r,strokeWidth:o,radius:(i+n+o)/2})}function pe(e,t){let{strokeColor:n,strokeWidth:r,shadowColor:o,fillColor:i,shadowSize:s,size:l=0}=t;const a=l/2;return[he(e,{strokeWidth:r,strokeColor:n,shadowSize:s,shadowColor:o,size:l}),new f.Arc(e,{fillColor:i,strokeColor:n,strokeWidth:r,radius:a})]}let me=function(e){re(n,d.PointSymbol);var t=le(n);function n(e){return $(this,n),t.call(this,e)}return te(n,[{key:"renderFunction",value:function(e,t,n){if(!(e instanceof h.PointFeature))return[];const{position:r}=e.projectTo(n),o=[r[0]/t+(this.offset[0]||0),-r[1]/t+(this.offset[1]||0)],i=this.getShadow(o),s=this.getPoint(o);return i?[i,s]:[s]}},{key:"getShadow",value:function(e){return n.getShadowArc(e,this)}},{key:"getPoint",value:function(e){return n.getPointArc(e,this)}}],[{key:"getShadowArc",value:function(e,t){let{strokeWidth:n=2,shadowColor:r,shadowSize:o,size:i=6}=t;return new f.Arc(e,{fillColor:"transparent",strokeColor:r,strokeWidth:o,radius:(i+n+o)/2})}},{key:"getPointArc",value:function(e,t){let{strokeWidth:n,fillColor:r,strokeColor:o,size:i=6}=t;return new f.Arc(e,{fillColor:r,strokeColor:o,strokeWidth:n,radius:i/2})}},{key:"getArcs",value:function(e,t){const r=n.getShadowArc(e,t),o=n.getPointArc(e,t);return r?[r,o]:[o]}}]),n}(),ye=function(e){re(n,p.PolylineSymbol);var t=le(n);function n(e){return $(this,n),t.call(this,e)}return te(n,[{key:"renderFunction",value:function(e,t,n){if(!(e instanceof m.Poly))return[];const r=p.PolylineSymbol.getRenderedCoordinates(e,t,n),o=this.getPolyRender(r),i=this.getShadow(r),s=this.getVertexRenders(r);let l=[o];return i&&(l=[i,o]),s&&(l=l.concat(s)),l}},{key:"getShadow",value:function(e){return new y.PolyRender(e,{fillStyle:y.FillStyle.None,enclosed:this.enclose,strokeColor:this.shadowColor,strokeWidth:this.shadowSize,lineDash:this.lineDash})}},{key:"getPolyRender",value:function(e){return new y.PolyRender(e,{fillStyle:this.enclose?y.FillStyle.Color:y.FillStyle.None,enclosed:this.enclose,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,lineDash:this.lineDash})}},{key:"getVertexRenders",value:function(e){if(this.showVertex)return e.reduce((e,t)=>e.concat(t),[]).map(e=>pe(e,{size:6,strokeWidth:2,shadowColor:this.shadowColor,strokeColor:this.strokeColor,shadowSize:void 0!==this.vertexShadowSize?this.vertexShadowSize:2,fillColor:"#ffffff"})).reduce((e,t)=>e.concat(t),[])}}]),n}();const ge={strokeWidth:2,strokeColor:"#e33600",shadowSize:8,shadowColor:"rgba(227, 54, 0, 0.3)"},ve={strokeColor:"#ff6933",shadowSize:0,vertexShadowSize:0},be=new ye(ne({},ge,ve,{enclose:!1,showVertex:!0})),xe=new ye(ne({},ge,ve,{fillColor:"rgba(255, 105, 51, 0.25)",enclose:!0,showVertex:!0})),ke=new me(ne({},{size:10,strokeWidth:2,strokeColor:"#e33600",fillColor:"#ffffff",shadowColor:"rgba(227, 54, 0, 0.3)",shadowSize:3},{strokeColor:"#ff6933",shadowSize:0}));function we(e,t){if(e[0].length<=3)return!1;const n=e[0],r=n[0],o=n[n.length-1],i=2*t;return w.softEquals(r[0],o[0],i)&&w.softEquals(r[1],o[1],i)}function Ce(e,t,n){void 0===t&&(t=2),void 0===n&&(n=",");const[r,o]=e.toFixed(t).split(".");return[r.replace(/\B(?=(\d{3})+(?!\d))/g," "),o].join(n)}function Se(e){let t=e,n="м²";return e>=1e7?(t=e/1e6,n="км²"):e>=1e4&&(t=e/1e4,n="га"),Ce(t)+" "+n}function Le(e){let t=e,n="м";return e>1e4&&(t=e/1e3,n="км"),Ce(t)+" "+n}function Me(e,t){return"S : "+Se(e)+" P : "+Le(t)}const Pe=[Infinity,Infinity];let Ee=function(e){re(n,g.PolylineControl);var t=le(n);function n(e,r,o){var i;return $(this,n),(i=t.call(this,e,o)).cancel=()=>{i.fire("cancel")},i.painter=r,i.renderLabelSymbol=o.renderLabelSymbol,i.on("pointAdd",i.handlePointAdd),i.on("change",i.updateDistance),i}return te(n,[{key:"_handleMousemove",value:function(e){ae(oe(n.prototype),"_handleMousemove",this).call(this,e),this.drawPointOnMouseMove(e)}},{key:"_activate",value:function(){ae(oe(n.prototype),"_activate",this).call(this),this.addTempLabel(),this.setCursor("pointer")}},{key:"_deactivate",value:function(){ae(oe(n.prototype),"_deactivate",this).call(this),this.removeCoordLabel(),this.removeTempLabel(),this.removeMeasureLabel(),this.removeTempPolygon(),this.setCursor("default")}},{key:"handlePointAdd",value:function(){const e=this.activeFeature;if(!e)return;const{rings:t,crs:n}=e;if(we(t,this.map.resolution))return this.finishDrawing(),void this.fire(new k.DrawingFinishEvent(e,new MouseEvent("mouseup")));if(2===t[0].length){const e=n.projectionTo(x.geo),r=t[0][0];if(!e)return;const[o,i]=e(r);this.removeTempLabel(),this.addMeasureResultLabel(),this.addCoordLabel(o.toFixed(6)+", "+i.toFixed(6),r)}else this.removeCoordLabel()}},{key:"polygonPreview",value:function(){this.tempPolygon&&this._tempLayer&&this._tempLayer.remove(this.tempPolygon);const e=this.activeFeature;if(!e)return;const{rings:t,crs:n}=e,r=[...t[0]];r.shift(),this.tempPolygon=new a.Polygon(r,{crs:n}),this.tempPolygon.symbol=xe,this.activeFeature&&this.activeFeature.hide(),this._tempLayer&&this._tempLayer.add(this.tempPolygon)}},{key:"removeTempPolygon",value:function(){this.tempPolygon&&(this._tempLayer&&this._tempLayer.remove(this.tempPolygon),delete this.tempPolygon)}},{key:"updateDistance",value:function(e){const t=this.activeFeature,{ringIndex:n,pointIndex:r}=e;if(!t||null===n||null===r)return;const{rings:o,crs:i}=t,s=o[n][r],l=b.length(o,i);let a=Le(l);we(o,this.map.resolution)?(this.polygonPreview(),a=Me(b.area(o,i),l)):this.tempPolygon&&(t.show(),this.removeTempPolygon()),this.measureResultLabel&&(this.measureResultLabel.position=s,this.measureResultLabel.content=a)}},{key:"addTempLabel",value:function(){this.tempLabel=new v.LabelFeature(Pe,{content:"Нажмите на карту, чтобы начать измерение",crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this._tempLayer.add(this.tempLabel)}},{key:"addCoordLabel",value:function(e,t){this.coordLabel=new v.LabelFeature(t,{content:e,crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol,onClose:this.cancel})}),this._tempLayer&&this.coordLabel&&this._tempLayer.add(this.coordLabel)}},{key:"addMeasureResultLabel",value:function(){this.measureResultLabel=new v.LabelFeature(Pe,{crs:this.map.crs,symbol:de({renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this.measureResultLabel&&this._tempLayer.add(this.measureResultLabel)}},{key:"removeTempLabel",value:function(){this.tempLabel&&(this._tempLayer&&this._tempLayer.remove(this.tempLabel),delete this.tempLabel)}},{key:"removeCoordLabel",value:function(){this.coordLabel&&(this._tempLayer&&this._tempLayer.remove(this.coordLabel),delete this.coordLabel)}},{key:"removeMeasureLabel",value:function(){this.measureResultLabel&&(this._tempLayer&&this._tempLayer.remove(this.measureResultLabel),delete this.measureResultLabel)}},{key:"drawPointOnMouseMove",value:function(e){this.tempLabel&&(this.tempLabel.position=e.point.position)}},{key:"setCursor",value:function(e){const{wrapper:t}=this.painter;t&&"string"!=typeof t&&(t.style.cursor=e)}}]),n}(),ze=function(e){re(n,C.PolyEditor);var t=le(n);function n(e,r,o){var i;return $(this,n),(i=t.call(this,e,o)).measureResult=()=>{const e=i.activeFeature;if(!e)return null;const{rings:t,isEnclosed:n,crs:r}=e,o=t[0][t[0].length-1],s=b.area(t,r),l=b.length(t,r,n);return{content:n?Me(s,l):Le(l),position:o}},i.removeFeature=()=>{i.fire("remove")},i.painter=r,i.renderLabelSymbol=o.renderLabelSymbol,i.on("change",i.updateMeasureResult),i.on("edit",i.updateMeasureResult),i}return te(n,[{key:"_activate",value:function(){ae(oe(n.prototype),"_activate",this).call(this),this.addMeasureResultLabel()}},{key:"addMeasureResultLabel",value:function(){const e=this.measureResult();if(null===e)return;const{content:t,position:n}=e;this.measureResultLabel=new v.LabelFeature(n,{content:t,crs:this.map.crs,symbol:de({onClose:this.removeFeature,renderLabel:this.renderLabelSymbol})}),this._tempLayer&&this._tempLayer.add(this.measureResultLabel)}},{key:"updateMeasureResult",value:function(){if(this.measureResultLabel){const e=this.measureResult();if(null===e)return;const{content:t,position:n}=e;this.measureResultLabel.content=t,this.measureResultLabel.position=n}}}]),n}(),Fe=function(e){re(r,n.Component);var t=le(r);function r(){var e;return $(this,r),(e=t.apply(this,arguments)).createFeature=t=>{const n=e.getFeature([...t.feature.rings]);e.layer&&e.layer.add(n),e.editorControl&&(e.editorControl.activeFeature=n),e.switchMode(!1,!0)},e.removeFeature=()=>{e.editorControl&&e.editorControl.activeFeature&&e.layer&&e.layer.remove(e.editorControl.activeFeature),e.switchMode(!0,!1)},e.cancelFeatureCreation=()=>{setTimeout(()=>{e.switchMode(!1,!1),e.switchMode(!0,!1)},10)},e}return te(r,[{key:"componentDidMount",value:function(){const{map:e,painter:t,renderLabelSymbol:n}=this.props;this.layer=new s.FeatureLayer,this.initCreateMode(e,t,n),this.initEditMode(e,t,n),this.props.map.addLayer(this.layer),this.switchMode(!0,!1)}},{key:"componentWillUnmount",value:function(){this.layer&&this.props.map.removeLayer(this.layer),this.switchMode(!1,!1),this.offEvents(),this.clearProperties()}},{key:"initCreateMode",value:function(e,t,n){this.createControl=new Ee(e,t,{isActive:!1,useTempLayer:!0,symbol:be,dblClickMinTime:300,renderLabelSymbol:n}),this.createControl.on("drawingFinish",this.createFeature),this.createControl.on("cancel",this.cancelFeatureCreation)}},{key:"initEditMode",value:function(e,t,n){this.editorControl=new ze(e,t,{isActive:!1,activeLayer:this.layer,snappingSymbol:ke,symbol:be,renderLabelSymbol:n}),this.editorControl.featureDragAllowed=!1,this.editorControl.on("remove",this.removeFeature)}},{key:"offEvents",value:function(){this.createControl&&this.createControl.off("drawingFinish",this.createFeature),this.editorControl&&this.editorControl.off("remove",this.removeFeature),this.createControl&&this.createControl.off("cancel",this.cancelFeatureCreation)}},{key:"clearProperties",value:function(){delete this.createControl,delete this.editorControl,delete this.layer}},{key:"switchMode",value:function(e,t){this.createControl&&(this.createControl.isActive=e),this.editorControl&&(this.editorControl.isActive=t)}},{key:"getFeature",value:function(e){let t;return we(e,this.props.map.resolution)?(e[0].shift(),t=new a.Polygon(e,{crs:this.props.map.crs}),t.symbol=xe):(t=new l.Polyline(e,{crs:this.props.map.crs}),t.symbol=be),t}},{key:"render",value:function(){return n.createElement("div",{style:{display:"none"}})}}]),r}();function Re(){const e=ue(["\n ","\n ","\n ","\n ","\n"]);return Re=function(){return e},e}function qe(){const e=ue(["\n bottom: ",";\n right: ",";\n"]);return qe=function(){return e},e}function Te(){const e=ue(["\n bottom: ",";\n left: ",";\n"]);return Te=function(){return e},e}function Ae(){const e=ue(["\n top: ",";\n right: ",";\n"]);return Ae=function(){return e},e}function _e(){const e=ue(["\n top: ",";\n left: ",";\n"]);return _e=function(){return e},e}const Oe=function(e,t){return void 0===e&&(e="bottom-left"),void 0===t&&(t="1rem"),S.css(Re(),"top-left"===e&&(e=>S.css(_e(),e,e))(t),"top-right"===e&&(e=>S.css(Ae(),e,e))(t),"bottom-left"===e&&(e=>S.css(Te(),e,e))(t),"bottom-right"===e&&(e=>S.css(qe(),e,e))(t))};function De(){const e=ue(["\n position: absolute;\n display: flex;\n flex-direction: ",";\n\n ","\n\n "," {\n margin-bottom: ",";\n margin-right: ",";\n flex-direction: ",";\n }\n"]);return De=function(){return e},e}function Ie(){const e=ue(["\n border-radius: 0.15rem;\n background: rgba(28, 33, 48, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n font-size: 1.5rem;\n cursor: pointer;\n height: auto;\n width: auto;\n padding: 0.25rem;\n"]);return Ie=function(){return e},e}function We(){const e=ue(["\n ","\n"]);return We=function(){return e},e}function Be(){const e=ue(["\n ","\n"]);return Be=function(){return e},e}function Ve(){const e=ue(["\n ","\n"]);return Ve=function(){return e},e}function je(){const e=ue(["\n ","\n"]);return je=function(){return e},e}function Ne(){const e=ue(["\n ","\n"]);return Ne=function(){return e},e}function Ue(){const e=ue(["\n width: 2rem;\n height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]);return Ue=function(){return e},e}const Ge=S.css(Ue()),Ze=L(M.EverCloudPlusIcon)(Ne(),Ge),Xe=L(M.EverCloudMinusIcon)(je(),Ge),He=L(M.EverCloudSearchIcon)(Ve(),Ge),Je=L(M.EverCloudMaximizeIcon)(Be(),Ge),Ye=L(M.EverCloudMeasureLenghtIcon)(We(),Ge),Ke=L.div(Ie()),Qe=L.div(De(),e=>{let{vertical:t}=e;return t?"column":"row"},e=>{let{placement:t}=e;return Oe(t)},Ke,e=>{let{vertical:t}=e;return t?"0.5rem":"0"},e=>{let{vertical:t}=e;return t?"0":"0.5rem"},e=>{let{vertical:t}=e;return t?"column":"row"});function $e(){const e=ue(["\n height: 2rem;\n display: flex;\n justify-content: center;\n align-items: ",";\n width: ",";\n color: #fff;\n font-size: 1rem;\n cursor: default;\n padding: 0 0.5rem;\n"]);return $e=function(){return e},e}function et(){const e=ue(["\n display: flex;\n align-items: flex-end;\n justify-content: center;\n width: ",";\n height: 0.25rem;\n border: 0.0625rem solid white;\n border-top: 0;\n"]);return et=function(){return e},e}function tt(){const e=ue(["\n height: 2rem;\n cursor: default;\n display: flex;\n align-items: flex-end;\n padding: 0 0.5rem 0.5rem;\n box-sizing: border-box;\n"]);return tt=function(){return e},e}const nt=L.div(tt()),rt=L.div(et(),e=>{let{width:t}=e;return t+"px"}),ot=L.div($e(),e=>{let{alignEnd:t}=e;return t?"flex-end":"center"},e=>{let{width:t}=e;return t||"auto"});function it(e){const t=[1,2,5];for(let n=0;n<21;n++)for(let r=0;r<t.length;r++){const o=Math.pow(10,n)*t[r];if(o>e)return o}return 1}function st(e){let{onMount:n,onUnmount:r}=e;t.useEffect(()=>(n&&n(),r),[])}function lt(e,n){let{factory:r,destructor:o,update:i}=e;void 0===n&&(n=[]);const s=t.useRef();return st({onUnmount(){s.current&&o&&o(s.current)}}),t.useMemo(()=>{if(s.current)if(i){const e=i(s.current,n,{factory:r,destructor:o});e&&(s.current=e)}else o&&o(s.current);else i&&s.current||(s.current=r(n));return s.current},n)}function at(e){let{onUpdate:n,shouldUpdate:r,deps:o}=e;t.useEffect(()=>{r&&!r()||n()},o)}function ut(e,t){const{map:n}=H();at({onUpdate:()=>n.insertLayer(e,t),deps:[t,e]})}function ct(e,t){void 0===t&&(t=!0),at({shouldUpdate:()=>e.isDisplayed!==t,onUpdate:()=>e.isDisplayed=t,deps:[t,e]})}function ft(e){let{name:t,zIndex:n,style:o,condition:i,isDisplayed:s}=e;const l=U(),{map:a}=H(),u=lt({factory:()=>new r.EvergisDynamicLayer({name:t,condition:i,style:o},l),destructor:e=>-1!==a.indexOf(e)&&a.removeLayer(e),update:(e,t)=>{let[n,r,o]=t;e.name=n,e.style=r,e.condition=o}},[t,o,i]);return ut(u,n),ct(u,s),u}function dt(e){let{name:t,subDomains:n,zIndex:o,isDisplayed:i}=e;const s=U(),{map:l}=H(),a=lt({factory:()=>new r.EvergisTileLayer({name:t,subDomains:n},s),update:(e,t)=>{let[n,r]=t;e.name=n,e.subDomains=r,"function"==typeof e.clearCache&&e.clearCache(),"function"==typeof e.redraw&&e.redraw()},destructor:e=>-1!==l.indexOf(e)&&l.removeLayer(e)},[t,n]);return ut(a,o),ct(a,i),a}function ht(e){let{zIndex:t,isDisplayed:n=!0,features:r}=e;const{map:o}=H(),i=lt({factory:()=>new s.FeatureLayer({features:r}),destructor:e=>-1!==o.indexOf(e)&&o.removeLayer(e),update:(e,t)=>{let[n]=t;e.features=n}},[r]);return ut(i,t),ct(i,n),i}function pt(e){return e instanceof d.PointSymbol||e instanceof z.StaticImageSymbol||e instanceof F.SquareSymbol||e instanceof q.MaskedImage}function mt(e){return e instanceof z.StaticImageSymbol||e instanceof q.MaskedImage}function yt(e){return e instanceof R.PolygonSymbol||e instanceof P.BrushFill||e instanceof E.ImageFill}function gt(e){return e instanceof p.PolylineSymbol}const vt=new h.PointFeature([50,-50],{crs:x.plain}),bt=new l.Polyline([[0,-57],[26,-57],[40,-35],[60,-65],[74,-43],[100,-43]],{crs:x.plain}),xt=new a.Polygon([[50,-15],[80,-33],[80,-67],[50,-85],[20,-67],[20,-33],[50,-15]],{crs:x.plain}),kt=new l.Polyline([[0,-50],[100,-50]],{crs:x.plain}),wt=new a.Polygon([[0,0],[100,0],[100,-100],[0,-100]],{crs:x.plain}),Ct={polygon:new a.Polygon([[50,0],[100,-25],[100,-75],[50,-100],[0,-75],[0,-25]],{crs:x.plain})},St={polyline:kt,polygon:wt},Lt={point:vt,polyline:bt,polygon:xt},Mt=function(e,t){return void 0===t&&(t=100),Et(e,t,Ct)},Pt=function(e,t){return void 0===t&&(t=100),Et(e,t,St)};function Et(e,t,n){void 0===t&&(t=100),void 0===n&&(n={});const r=100/t,o=ne({},Lt,n);return yt(e)?e.renderFunctionAsync(o.polygon,r,x.plain):gt(e)?e.renderFunctionAsync(o.polyline,r,x.plain):e.renderFunctionAsync(o.point,r,x.plain)}function zt(e,t){e.forEach(e=>{t.draw(e)})}const Ft=e=>t=>t&&t.type===e,Rt=Ft("labelPointSymbol"),qt=Ft("polygonLabelSymbol"),Tt=Ft("polylineLabelSymbol"),At=e=>Boolean(e&&(Rt(e)||qt(e)||Tt(e))),_t=Ft("polygonSymbol"),Ot=Ft("simplePolylineSymbol"),Dt=Ft("compositeSymbol"),It=Ft("rasterSymbol"),Wt=e=>Boolean(e&&!At(e)&&!Dt(e)&&!It(e)),Bt=e=>({type:"compositeSymbol",childSymbols:e}),Vt=e=>Dt(e.symbol)?ne({},e,(e=>{const t=(e=>e&&Dt(e)&&e.childSymbols||[])(e);return{symbol:t.find(Wt),label:t.find(At)||null,raster:t.find(It)||null}})(e.symbol),{children:e.children&&e.children.map(Vt)}):e||{},jt=e=>{const{ignoreLabel:t,label:n,symbol:r,raster:o,children:i}=e,s=ie(e,["ignoreLabel","label","symbol","raster","children"]),l=[!t&&n,o].filter(Boolean);return ne({},s,{symbol:l.length?Bt([r,...l]):r,children:i?i.map(e=>jt(ne({},e,{ignoreLabel:t,label:n}))):i})};function Nt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Ut=e=>Boolean(Nt(e)&&e.type&&"byAttribute"===e.type),Gt=e=>Ut(e)||(e=>Boolean(Nt(e)&&e.type&&"calculated"===e.type))(e)?e.defaultValue:e,Zt={attribute:null,operation:null,value:null};let Xt=function(){function e(t){$(this,e),this.expressions=[],this.condition=t;const n=new T.ConditionInterpreter(t).value;this.expressions=n instanceof Error?[]:n.expressions}return te(e,[{key:"isUnique",value:function(){return this.leftExpression.operation===T.TokenType.ArEq}},{key:"isRange",value:function(){return[T.TokenType.ArGr,T.TokenType.ArGre,T.TokenType.ArLs,T.TokenType.ArLse].includes(this.leftExpression.operation)}},{key:"toString",value:function(){return this.condition}},{key:"attributeName",get:function(){return this.leftExpression.attribute}},{key:"uniqueValue",get:function(){if(this.isUnique()){const{value:e}=this.leftExpression;return"string"==typeof e?e:""}return console.warn("Trying to get unique from range condition "+this.condition),""}},{key:"range",get:function(){if(!this.isRange())return console.warn("Trying to get range from unique condition "+this.condition),[0,0];if(2===this.expressions.length){const{value:e}=this.leftExpression,{value:t}=this.rightExpression;return[e,t]}if(1===this.expressions.length){const{operation:e,value:t}=this.leftExpression,n=e===T.TokenType.ArGr;return[n?t:null,n?null:t]}return[0,0]}},{key:"type",get:function(){return this.isUnique()?1:0}},{key:"leftExpression",get:function(){return this.expressions.length>0?this.expressions[0]:Zt}},{key:"rightExpression",get:function(){return this.expressions.length>1?this.expressions[1]:Zt}}]),e}();const Ht={defaultTitle:"",defaultValue:null},Jt=function(e,t,n){return void 0===n&&(n=Ht),e.reduce((e,t)=>{const n=new Xt(t.condition||""),r=((e,t,n)=>ne({parameterValue:e,title:t},n.isUnique()?{uniqueValue:n.uniqueValue}:{from:n.range[0],to:n.range[1]}))((e=>"symbol"in e)(t)?t.symbol:t.value,t.title,n);return e.values.push(r),ne({},e,{type:e.type||n.type,attribute:e.attribute||n.attributeName})},ne({},n,{attribute:null,parameter:t,type:null,values:[]}))};let Yt=function(){function e(t){$(this,e),this.style=t,this.classifications=[],this.collectClassifications()}return te(e,[{key:"find",value:function(e){for(const t of this.classifications)if(e(t))return t;return null}},{key:"filter",value:function(e){return this.classifications.filter(e)}},{key:"map",value:function(e){return this.classifications.map(e)}},{key:"reduce",value:function(e,t){return this.classifications.reduce(e,t)}},{key:"hasClassifications",value:function(){return this.classifications.length>0}},{key:"collectClassifications",value:function(){this.style.children&&this.style.children.length&&this.classifications.push(Jt(this.style.children,"symbol")),this.style.symbol&&this.classifications.push(...function e(t,n){return void 0===n&&(n=[]),Object.entries(t).reduce((r,o)=>{let[i,s]=o;const l=(e=>Boolean(e&&"width"in e))(t)&&"height"===i;if(!Nt(s)||l)return r;if(!Ut(s))return[...r,...e(t[i],[...n,i])];const a=Jt(s.values,[...n,i].join("."),{defaultTitle:s.title,defaultValue:s.defaultValue});return[...r,a]},[])}(this.style.symbol))}},{key:"values",get:function(){return this.classifications}}]),e}(),Kt=function(){function e(t){$(this,e),this.style=Vt(t),this.classificationManager=new Yt(this.style)}return te(e,[{key:"serialize",value:function(){return jt(this.style)}},{key:"hasRasters",value:function(){return!(!this.style.raster&&!(this.style.children||[]).some(e=>e.raster))}},{key:"symbol",get:function(){return this.style.symbol}},{key:"raster",get:function(){return this.style.raster}},{key:"label",get:function(){return this.style.label}},{key:"children",get:function(){return this.style.children}},{key:"title",get:function(){return this.style.title}},{key:"condition",get:function(){return this.style.condition}},{key:"ignoreLabel",get:function(){return this.style.ignoreLabel}},{key:"resolution",get:function(){const{minResolution:e,maxResolution:t}=this.style;return void 0===e||void 0===t?null:[e,t]}}]),e}();const Qt=e=>Object.entries(e).reduce((e,t)=>{let[n,r]=t,o=Array.isArray(r)?r.map(Gt):Gt(r);return Nt(o)?ne({},e,{[n]:Qt(r)}):ne({},e,{[n]:o})},{}),$t=e=>{let{attributes:t,renderTitle:n,skipDefaultValue:r,reverse:o}=e;return e=>{const{defaultTitle:i,defaultValue:s,values:l,attribute:a,parameter:u}=e,c=a&&t?((e,t)=>{const n=t[e],r={name:e};return n?ne({},r,n):r})(a,t):void 0,f={title:i||"Другое",parameterValue:s},d=l.map((e,t)=>({title:n&&n(ne({},e,{attribute:c}),t),parameterValue:e.parameterValue})),h=r?d:[...d,f],p=o?[...h].reverse():h;return{title:c&&c.alias||a,attribute:c,parameter:u,values:p}}},en={renderTitle:function(e,t){return e.title?e.title:function(e){return Boolean(e&&"from"in e)}(e)?((e,t)=>{const n=Boolean(e.attribute&&"Double"===e.attribute.type),{from:r,to:o}=function(e,t,n){let{from:r,to:o}=e;return{from:null!==r&&0!==n?t?+r:+r+1:r,to:o}}(e,n,t);return null===r?o+" и менее":null===o?"более "+r:r===o?""+r:r+" - "+o})(e,t):function(e){return Boolean(e&&"uniqueValue"in e)}(e)?e.uniqueValue:""}},tn=(e,n)=>{const{style:r,layerDefinition:o}=e||{},{attributes:i}=o||{};return((e,n)=>t.useMemo(()=>e&&n&&n.attributes?function(e,t){const{classificationManager:n,symbol:r}=e,o=n.filter(e=>{let{parameter:n}=e;return!t.parameters||!n||t.parameters.includes(n)});return 0===o.length?null:{symbol:Qt(r),items:o.map($t(t))}}(e,n):null,[e,n]))(r&&new Kt(r),ne({attributes:i},en,n))};function nn(e,n){const{map:r}=H(),i=n?o.BboxChangeEvent:o.BboxChangeEndEvent,s=t.useCallback(()=>{e&&e(rn(r))},[e,r,i]);t.useEffect(()=>(r.on(i.type,s),()=>{r.off(i.type,s)}),[s,i])}function rn(e){return{position:e.position.slice(0),resolution:e.resolution}}function on(e){return e._currentRender&&e._currentRender.bbox&&e._currentRender.bbox.coordinates}function sn(e){let t={};for(const n of e)r.isEvergisDynamicLayer(n)&&(t[n.name]=on(n));return t}function ln(e){const{map:n}=H(),[,r]=t.useReducer(an,void 0,()=>rn(n));return nn(t.useCallback(r,[]),e),rn(n)}function an(e,t){return t}function un(){const{map:e,painter:n}=H(),{position:r,resolution:o}=ln(),i=t.useMemo(()=>{const t=e.tileScheme.getLevel(o);if(void 0!==t||null!==t)return e.tileScheme.levels[t].zIndex},[o]),s=t.useMemo(()=>n.bbox,[r,o]);return{position:r,resolution:o,level:i,bbox:s}}function cn(){const{map:e}=H(),{resolution:n}=ln(!0);return t.useMemo(()=>{const t=e.tileScheme.getLevel(n);if(void 0!==t||null!==t)return e.tileScheme.levels[t].zIndex},[n])}const fn=()=>{const{painter:e}=H();return t.useCallback(t=>{if("point"in t)return t.point;const n="browserEvent"in t?t.browserEvent:t,r=e.wrapper,{x:o,y:i}=O.getMouseOffset(r,"touches"in n?{pageX:n.touches[0].pageX,pageY:n.touches[0].pageY}:n);return e.getPointFromPxPosition(o,i)},[e])};function dn(){const{map:e,painter:n}=H(),r=fn(),o=t.useCallback(t=>{e.zoom(t,e.position)},[e]),i=t.useCallback(()=>o(1),[o]),s=t.useCallback(()=>o(-1),[o]),l=t.useCallback(t=>{let{position:r,resolution:o,extent:i}=t;if(r||o){const t=r?r.slice(0):e.position;e.animateTo(t,o||e.resolution)}if(i){const{xMax:t,xMin:r,yMax:o,yMin:s}=i,l=new _.Bbox([r,o],[t,s],e.crs);n&&n.show(l,!0)}},[e,n]),a=t.useCallback(t=>{e.zoom(1,r(t))},[r,e]);return{zoomTo:o,zoomIn:i,zoomOut:s,zoomAround:a,animateTo:l}}function hn(){const{painter:e}=H(),n=t.useRef(null);return st({onMount:()=>e.wrapper=n.current,onUnmount:()=>e.wrapper=null}),n}const pn=e=>t=>{let{zIndex:n}=t;return n===e},mn=(e,n,r,o)=>{const{map:i}=H();t.useEffect(()=>{const t=i.tileScheme.levels;if(void 0!==n){const{resolution:e}=t.find(pn(n))||{resolution:-1};i.minResolution=e}if(void 0!==e){const{resolution:n}=t.find(pn(e))||{resolution:-1};i.maxResolution=n}void 0===e&&void 0===n||yn(i,r,o)},[i,e,n])},yn=(e,t,n)=>{if(t&&n){const r=Math.min(Math.max(n,e.minResolution||0),e.maxResolution||Number.MAX_VALUE);e.animateTo(t,r)}};function gn(e){const t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}function vn(e,n){let{position:r,resolution:o}=e;const{map:i}=H(),{animateTo:s}=dn();t.useEffect(()=>{bn(i,{position:r,resolution:o})&&s({position:r,resolution:o})},[r,o,n])}function bn(e,t){let{position:n,resolution:r}=t;return function(e,t){return t&&(!w.softEquals(e.position[0],t[0])||!w.softEquals(e.position[1],t[1]))}(e,n)||function(e,t){return t&&!w.softEquals(e.resolution,t)}(e,r)}const xn=function(e){void 0===e&&(e=1);const{layer:n,popupLayer:r}=Q(),{map:i}=H(),s=fn(),l=t.useRef([]),a=t.useRef(null),u=t.useRef([]),c=t.useCallback(()=>r.remove(r.features),[r]),f=t.useCallback(()=>{l.current.forEach((e,t)=>{const n=u.current[t];if(n){const{onMouseOver:t,onMouseMove:r,onMouseOut:o,onClick:i}=n;e.hasListener("mouseover",t)&&e.off("mouseover",t),e.hasListener("mousemove",r)&&e.off("mousemove",r),e.hasListener("mouseout",o)&&e.off("mouseout",o),e.hasListener("click",i)&&e.off("click",i)}}),i.off("click",c),l.current=[],a.current=null,n.remove(n.features),u.current=[],-1!==i.indexOf(r)&&i.removeLayer(r)},[c,r,n,i]);t.useEffect(()=>(-1===i.indexOf(n)&&i.insertLayer(n,e),f),[f,i,n,e]);const d=t.useCallback(t=>{let{point:o,position:s,component:l,clickMode:u}=t;const c=new v.LabelFeature(s||o.position,{symbol:new ce({component:l}),crs:i.crs});u?(-1===i.indexOf(r)&&i.insertLayer(r,e),r.remove(r.features),r.add(c)):(a.current=c,n.add(c))},[r,n,i,e]),h=t.useCallback(e=>{e.node&&(e.node.doNotBubbleToMap=!0),e.stopPropagation(),a.current&&n.has(a.current)&&n.remove(a.current),a.current=null,n.remove(n.features)},[n]);return t.useCallback(e=>{const{feature:t,position:r,component:f,clickMode:p}=e,m=t||i;l.current.push(m);const y=m instanceof o.Map,g={onMouseOver:e=>{e.stopPropagation(),h(e),d({point:s(e),position:r,component:f})},onMouseMove:e=>{y||e.stopPropagation(),e.node&&(e.node.doNotBubbleToMap=!0);const t=s(e);a.current?(y&&!n.has(a.current)&&n.add(a.current),a.current.position=r||t.position):d({point:t,position:r,component:f})}};p&&(g.onClick=e=>{e.stopPropagation(),d({point:s(e),position:r,component:f,clickMode:p})}),g.onMouseOut=h,u.current.push(g);const{onMouseOver:v,onMouseMove:b,onMouseOut:x,onClick:k}=g;p&&!y?(m.on("mouseover",x),m.on("mousemove",x),m.on("click",k),i.hasListener("click",c)||i.on("click",c)):(y||m.on("mouseover",v),m.on("mousemove",b),m.on("mouseout",x))},[h,c,i,d,s,n])};function kn(e){let{zIndex:n,isDisplayed:r=!0,features:o,onChangeGrid:i,size:s,distance:l,clusterSymbol:a}=e;const{map:u}=H(),c=t.useRef(o),f=lt({factory:()=>{const e=new I.GridClusterProvider({size:s,distance:l,onChangeGrid:i?e=>i(e,f):void 0}),t=new D.ClusterLayer({gridClusterProvider:e,clusterSymbol:a});return c.current=o,t.add(o),t},destructor:e=>-1!==u.indexOf(e)&&u.removeLayer(e),update:(e,t)=>{let[n]=t;e.remove(c.current),e.add(n),c.current=n}},[o]);return ut(f,n),ct(f,r),f}const wn=t.createContext(null),Cn=e=>{let{symbol:t,children:r}=e;return n.createElement(wn.Provider,{value:t||null},r)};function Sn(){const e=ue(["\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"]);return Sn=function(){return e},e}function Ln(){const e=ue(["\n display: flex;\n align-items: center;\n font-size: 0.625rem;\n padding: 0.125rem 0;\n\n "," {\n padding-left: 0.5rem;\n }\n"]);return Ln=function(){return e},e}function Mn(){const e=ue(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n"]);return Mn=function(){return e},e}function Pn(){const e=ue([""]);return Pn=function(){return e},e}function En(){const e=ue(["\n background-color: #fff;\n\n canvas {\n border-radius: 0.125rem;\n }\n"]);return En=function(){return e},e}const zn=L.div(En()),Fn=L.div(Pn()),Rn=L.p(Mn()),qn=L.div(Ln(),Rn),Tn=L.div(Sn()),An=e=>{let{item:t,children:r}=e;return n.createElement(Fn,null,n.createElement(Tn,null,t.title),t.values.map(r))},_n=e=>(t,n)=>{const r=Array.isArray(n)?n:(e=>e.split("."))(n),[o,...i]=r,s=t[o];return ne({},t,i.length?{[o]:_n(e)(s,i)||s}:{[o]:e(s)||s})},On=(e,t,n)=>_n(()=>n)(e,t),Dn=e=>e?new W.Color(e).toString("hex"):void 0;function In(e,t,n){return Math.min(Math.max(e,t),n)}const Wn=e=>e&&"solid"!==e.type?((e,t,n)=>{if(!e||!e.length)return[];const r=[];for(let o=0;o<e.length;o++)o%2&&r.push(...n([e[o-1],e[o]],t));return r})(e.intervals,In(Gt(e.width),.25,6.5),(e,t)=>{let[n,r]=e;return[Math.round(n/Math.max(1,Math.min(t,16)/4)),Math.round(r+1+Math.max(1,Math.min(t,16)/2))]}):[],Bn=Ft("hatch"),Vn=Ft("pattern"),jn=Ft("dashed"),Nn=e=>{if("hatch"===e.type)return((e,t,n)=>{const r=Math.max(Math.round([Math.max(...n),t].reduce((e,t)=>e+t,0)),t),o=(i=r,Array(i).fill(null).map(()=>Array(i)));var i;return((e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t(r,o,n)})(o,(t,n,r)=>((e,t,n,r)=>{const o=Math.round(e/2);return(0===t||t===Math.PI)&&n===o||t===Math.PI/4&&r===n||t===Math.PI/2&&r===o||t===3*Math.PI/4&&e-1-r===n})(r,e,t,n)?255:0),o})(Gt(e.hatchAngle),Math.round(e.hatchWidth),e.scalingFactor)};let Un=function(e){re(n,P.BrushFill);var t=le(n);function n(e){var r,o,i,s,l;return $(this,n),(l=t.call(this,{strokeColor:Dn(Gt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Gt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Wn(e.stroke),fillBackground:Dn(Gt(null===(i=e.fill)||void 0===i?void 0:i.color)),fillForeground:Bn(e.fill)?Dn(Gt(null===(s=e.fill)||void 0===s?void 0:s.hatchColor)):void 0,fillBrush:Nn(e.fill),lineCap:"square"})).originalSymbol=e,l}return te(n,[{key:"_updateBrush",value:function(){if(!this._initialized)return;const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=this.fillBrush,r=n.length,o=new W.Color(this.fillForeground),i=new W.Color(this.fillBackground);e.height=r,e.width=r;for(let e=0;e<r;e++)for(let r=0;r<n[e].length;r++){const s=n[e][r]*o.a/65025,l=i.a/255*(1-s),a=+Math.min(1,s+l).toFixed(2),u=Math.round(Math.min(255,i.r*l+o.r*s)),c=Math.round(Math.min(255,i.g*l+o.g*s)),f=Math.round(Math.min(255,i.b*l+o.b*s));t.fillStyle="rgba("+u+","+c+","+f+","+a+")",t.fillRect(r,e,1,1)}this._brush=new Image,this._brush.src=e.toDataURL()}},{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}(),Gn=function(e){re(n,E.ImageFill);var t=le(n);function n(e){var r,o,i;return $(this,n),(i=t.call(this,{strokeColor:Dn(Gt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Gt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Wn(e.stroke),src:"data:image/png;base64,"+e.fill.pattern,lineCap:jn(e.stroke)?"square":"round"})).originalSymbol=e,i}return te(n,[{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}();const Zn={small:e=>3*(e+1)+1,large:e=>5*(e+1)-1};let Xn=function(){function e(t){$(this,e),this.getAnchor=e=>{if("right"===this.position){const t=e[e.length-1];return t&&t[t.length-1]||null}const t=e[0];return t&&t[0]||null},Object.assign(this,t)}return te(e,[{key:"getRender",value:function(e,t,n,r){const o="right"===this.position?1:-1,i=this.getAnchor(e),s=((e,t,n,r)=>{const o=b.projectRings(e,n,r);return w.simplifyCoordinates(o.map(e=>e.map(e=>{let[n,r]=e;return[n/t,r/-t]})),1)})(this.createRings(i,o),n,t,r);return this.createRender(s)}},{key:"miterSize",get:function(){const e=Zn[this.size];return e?e(this.strokeWidth):1}}]),e}();var Hn;!function(e){e.None="none",e.Arrow="arrow",e.FilledArrow="filledArrow",e.Square="square",e.FilledSquare="filledSquare",e.Circle="circle",e.FilledCircle="filledCircle"}(Hn||(Hn={}));let Jn=function(e){re(n,Xn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n,r+this.miterSize/2],[n+this.miterSize*t,r],[n,r-this.miterSize/2]]]}},{key:"createRender",value:function(e){const t=this.kind===Hn.FilledArrow;return new y.PolyRender(e,{enclosed:t,fillColor:t?this.color:void 0,fillStyle:t?y.FillStyle.Color:y.FillStyle.None,lineCap:"square",lineJoin:"miter",strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+this.strokeWidth}}]),n}(),Yn=function(e){re(n,Xn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n+(this.miterSize/2+this.strokeWidth)*t,r]]]}},{key:"createRender",value:function(e){return new f.Arc(e[0][0],{fillColor:this.kind===Hn.FilledCircle?this.color:"transparent",radius:this.miterSize/2,strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+3*this.strokeWidth}}]),n}(),Kn=function(e){re(n,Xn);var t=le(n);function n(){return $(this,n),t.apply(this,arguments)}return te(n,[{key:"createRings",value:function(e,t){let[n,r]=e;return[[[n,r+this.miterSize/2],[n,r-this.miterSize/2],[n+this.miterSize*t,r-this.miterSize/2],[n+this.miterSize*t,r+this.miterSize/2]]]}},{key:"createRender",value:function(e){const t=this.kind===Hn.FilledSquare;return new y.PolyRender(e,{enclosed:!0,fillColor:t?this.color:void 0,fillStyle:t?y.FillStyle.Color:y.FillStyle.None,lineCap:"square",lineJoin:"miter",strokeColor:this.color,strokeWidth:this.strokeWidth})}},{key:"usageSize",get:function(){return this.miterSize+this.strokeWidth}}]),n}();const Qn=e=>{switch(e.kind){case Hn.Arrow:case Hn.FilledArrow:return new Jn(e);case Hn.Square:case Hn.FilledSquare:return new Kn(e);case Hn.Circle:case Hn.FilledCircle:return new Yn(e);default:return null}},$n=(e,t,n)=>e.map((r,o)=>{switch(t){case"right":return((e,t,n)=>{const r=e.slice().reverse();for(let e=0;e<r.length;e++){const o=r[e];n&&0===e&&(r[e]=[o[0]-t,o[1]]);const i=r[e-1];i&&i[0]<o[0]&&(r[e]=[i[0]-Math.abs(i[0]-o[0]),o[1]])}return r.reverse()})(r,n,o===e.length-1);default:return((e,t,n)=>{const r=e.slice();for(let e=0;e<r.length;e++){const o=r[e];0===e&&n&&(r[e]=[o[0]+t,o[1]]);const i=r[e-1];i&&i[0]>o[0]&&(r[e]=[i[0]+Math.abs(o[0]-i[0]),o[1]])}return r})(r,n,0===o)}});let er=function(e){re(n,p.PolylineSymbol);var t=le(n);function n(e){var r,o,i;return $(this,n),(i=t.call(this,{strokeColor:Dn(Gt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:In(Gt(null===(o=e.stroke)||void 0===o?void 0:o.width),.25,6.5),lineDash:Wn(e.stroke),lineCap:jn(e.stroke)?"square":"round"})).originalSymbol=e,i}return te(n,[{key:"renderFunction",value:function(e,t,r){if(!Ot(this.originalSymbol))return ae(oe(n.prototype),"renderFunction",this).call(this,e,t,r);const{ending:o,beginningSize:i,beginning:s,endingSize:l}=this.originalSymbol,a=[],u=e.clone(),c=Qn({color:this.strokeColor,kind:s,position:"left",size:i,strokeWidth:this.strokeWidth}),f=Qn({color:this.strokeColor,kind:o,position:"right",size:l,strokeWidth:this.strokeWidth});if(c){const n=$n(u.rings,"left",c.usageSize),o=c.getRender(n,e.crs,t,r);u.rings=n,a.push(o)}if(f){const n=$n(u.rings,"right",f.usageSize),o=f.getRender(n,e.crs,t,r);u.rings=n,a.push(o)}return a.unshift(...ae(oe(n.prototype),"renderFunction",this).call(this,u,t,r)),a}},{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}(),tr=function(e){re(n,R.PolygonSymbol);var t=le(n);function n(e){var r,o,i,s;return $(this,n),(s=t.call(this,{strokeColor:Dn(Gt(null===(r=e.stroke)||void 0===r?void 0:r.color)),strokeWidth:Gt(null===(o=e.stroke)||void 0===o?void 0:o.width),lineDash:Wn(e.stroke),fillColor:Dn(Gt(null===(i=e.fill)||void 0===i?void 0:i.color)),lineCap:jn(e.stroke)?"square":"round"})).originalSymbol=e,s}return te(n,[{key:"clone",value:function(){return new n(this.originalSymbol)}}]),n}();function nr(e){switch(e.type){case"circlePointSymbol":return function(e){return new d.PointSymbol(rr(e))}(e);case"squarePointSymbol":return function(e){return new F.SquareSymbol(ne({},rr(e),{angle:Gt(e.angle)}))}(e);case"maskedImagePointSymbol":return function(e){return new q.MaskedImage(ne({},e,{angle:Gt(e.angle),width:Gt(e.width),height:Gt(e.height),anchorPoint:ir(e.offset),imageSource:or(e.image),maskSource:or(e.imageMask),maskColor:sr(Gt(e.maskedColor))}))}(e);case"imagePointSymbol":return function(e){return new z.StaticImageSymbol(ne({},e,{angle:Gt(e.angle),width:Gt(e.width),height:Gt(e.height),anchorPoint:ir(e.offset),source:or(e.image)}))}(e);case"polygonSymbol":return function(e){return(e=>Boolean(e&&_t(e)&&Vn(e.fill)))(e)?new Gn(e):(e=>Boolean(e&&_t(e)&&Bn(e.fill)))(e)?new Un(e):new tr(e)}(e);case"simplePolylineSymbol":case"polylineSymbol":return function(e){return new er(e)}(e);default:return null}}function rr(e){let{size:t,offset:n,strokeColor:r,strokeWidth:o,fillColor:i}=e;return{size:Gt(t),offset:ir(n),strokeWidth:Gt(o),strokeColor:sr(Gt(r)),fillColor:sr(Gt(i))}}function or(e){return"data:image/png;base64,"+e}function ir(e){return e.map(Gt)}function sr(e){return e?new W.Color(e).toString():null}const lr=e=>{let{parameter:r,parameterValue:o,children:i}=e;const s=(e=>{let{parameter:n,parameterValue:r}=e;const o=t.useContext(wn),i=o&&function(e,t,n){return"symbol"===t?n:On(e,t,n)}(o,n,r);return i&&nr(i)})({parameterValue:o,parameter:r});return s?n.createElement(n.Fragment,null,i(s)):null},ar=16,ur=e=>{let{symbol:r,size:o,render:i}=e;const{canvas:s,ref:l}=function(){const e=t.useRef(null),n=t.useCallback(t=>{e.current=null!==t?new B.Canvas(t):null},[]);return{canvas:e,ref:n}}();return function(e,n){let{symbol:r,size:o=ar,render:i=Et,maxWidth:s}=e;t.useEffect(()=>{if(null!==n.current){const e=n.current;!function(e,t,n){e.node.height=t,e.node.width=n?Math.min(t,n):t}(e,o,s),i(r,o).then(t=>{zt(t,e)})}},[r,o,s])}({symbol:r,size:o,render:i},s),n.createElement("canvas",{ref:l})};function cr(){const e=ue(["\n background: ",";\n height: 32px;\n width: 32px;\n"]);return cr=function(){return e},e}const fr=L.div(cr(),e=>{let{geometryType:t,icons:n}=e;return"url("+n[t]+") center center / "+("polyline"===t?"2rem 1.3rem":"auto 1rem")+" no-repeat"}),dr=(e,t,n)=>(mt(e)?(e.width=In(e.width,t,n),e.height=In(e.height,t,n)):pt(e)&&(e.size=In(e.size,t,n)),e),hr=32,pr=e=>{let{value:t,parameter:r}=e;return n.createElement(qn,null,n.createElement(lr,{parameter:r,parameterValue:t.parameterValue},e=>n.createElement(ur,{render:Pt,symbol:e,size:16})),n.createElement(Rn,null,t.title))};function mr(){const e=ue(["\n margin: 0.5rem;\n font-size: 0.625rem;\n opacity: 0.65;\n"]);return mr=function(){return e},e}function yr(){const e=ue(["\n display: flex;\n align-items: center;\n"]);return yr=function(){return e},e}function gr(){const e=ue(["\n margin: 0;\n"]);return gr=function(){return e},e}function vr(){const e=ue(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 16.5rem;\n height: 3.875rem;\n align-items: center;\n padding: 0.5rem;\n box-sizing: border-box;\n\n canvas {\n height: 1rem;\n width: 0.835rem;\n }\n"]);return vr=function(){return e},e}function br(){const e=ue(["\n cursor: default;\n"]);return br=function(){return e},e}const xr=L(Ke)(br()),kr=L.div(vr()),wr=L(Tn)(gr()),Cr=L.div(yr()),Sr=L.div(mr()),Lr=e=>{let{value:t,parameter:r}=e;return n.createElement(lr,{key:t.title,parameter:r,parameterValue:t.parameterValue},e=>n.createElement(ur,{render:Mt,symbol:e,size:100}))},Mr=["Выше","Ниже"];function Pr(){const e=ue(["\n position: absolute;\n z-index: 999;\n display: flex;\n font-size: 0.625rem;\n color: #fff;\n background-color: rgba(28, 33, 48, 0.8);\n padding: 0.4em 0.6em;\n border-radius: 2px;\n user-select: none;\n box-sizing: border-box;\n white-space: pre;\n ","\n ","\n"]);return Pr=function(){return e},e}function Er(){const e=ue(["\n &:before {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n }\n"]);return Er=function(){return e},e}function zr(){const e=ue(["\n ","\n ","\n ","\n ","\n"]);return zr=function(){return e},e}function Fr(){const e=ue(["\n transform: translate(-50%, 0);\n left: -50%;\n top: ",";\n ","\n"]);return Fr=function(){return e},e}function Rr(){const e=ue(["\n transform: translate(0, -50%);\n top: -50%;\n right: ",";\n ","\n"]);return Rr=function(){return e},e}function qr(){const e=ue(["\n transform: translate(0, -50%);\n top: -50%;\n left: ",";\n ","\n"]);return qr=function(){return e},e}function Tr(){const e=ue(["\n transform: translate(-50%, 0);\n left: -50%;\n bottom: ",";\n ","\n"]);return Tr=function(){return e},e}function Ar(){const e=ue(["\n &:before {\n transform: translate(-50%, -100%);\n left: 50%;\n top: 0;\n border-left: "," solid transparent;\n border-right: "," solid transparent;\n border-bottom: "," solid rgba(28, 33, 48, 0.8);\n }\n"]);return Ar=function(){return e},e}function _r(){const e=ue(["\n &:before {\n transform: translate(100%, -50%);\n right: 0;\n top: 50%;\n border-top: "," solid transparent;\n border-left: "," solid rgba(28, 33, 48, 0.8);\n border-bottom: "," solid transparent;\n }\n"]);return _r=function(){return e},e}function Or(){const e=ue(["\n &:before {\n transform: translate(-100%, -50%);\n left: 0;\n top: 50%;\n border-top: "," solid transparent;\n border-right: "," solid rgba(28, 33, 48, 0.8);\n border-bottom: "," solid transparent;\n }\n"]);return Or=function(){return e},e}function Dr(){const e=ue(["\n &:before {\n left: 50%;\n transform: translate(-50%, 100%);\n bottom: 0;\n border-left: "," solid transparent;\n border-right: "," solid transparent;\n border-top: "," solid rgba(28, 33, 48, 0.8);\n }\n"]);return Dr=function(){return e},e}const Ir=S.css(Er()),Wr=L.div(Pr(),e=>{let{placement:t,distance:n="0.5rem",withArrow:r,cornerSize:o="0.25rem"}=e;return function(e,t,n){return void 0===e&&(e="top"),S.css(zr(),"top"===e&&((e,t)=>S.css(Tr(),e,t&&(e=>S.css(Dr(),e,e,e))(t)))(t,n),"right"===e&&((e,t)=>S.css(qr(),e,t&&(e=>S.css(Or(),e,e,e))(t)))(t,n),"left"===e&&((e,t)=>S.css(Rr(),e,t&&(e=>S.css(_r(),e,e,e))(t)))(t,n),"bottom"===e&&((e,t)=>S.css(Fr(),e,t&&(e=>S.css(Ar(),e,e,e))(t)))(t,n))}(t,n,r?o:null)},e=>{let{withArrow:t}=e;return t&&Ir}),{Provider:Br,Consumer:Vr}=t.createContext([]);exports.AVAILABLE_BASE_MAPS=["2gis","osm_mono","carto_dm","sputnik","stamen_terrain","stamen_toner","stamen_watercolor"],exports.BaseMeasureToolCreator=Ee,exports.BaseMeasureToolEditor=ze,exports.CONTROL_PLACEMENTS=["top-left","top-right","bottom-left","bottom-right"],exports.ClusterLayer=e=>(kn(e),null),exports.CompoundIcon=fr,exports.EvergisDynamicLayer=e=>(ft(e),null),exports.EvergisProvider=e=>{let{api:r,children:o}=e;const i=t.useMemo(()=>r||j,[r]);return n.createElement(N.Provider,{value:i},o)},exports.EvergisTileLayer=e=>(dt(e),null),exports.FeatureLayer=e=>(ht(e),null),exports.Fullscreen=()=>n.createElement(Ke,null,n.createElement(Je,{onClick:()=>{}})),exports.FullscreenBtn=Je,exports.LabelSymbol=ce,exports.Legend=e=>{let{layer:t,children:r,className:o,config:i}=e;const s=tn(t,i);return s?n.createElement(Cn,{symbol:s.symbol},n.createElement(zn,{className:o},r?r(s):s.items.map(e=>n.createElement(An,{key:e.attribute+"-"+e.parameter,item:e},t=>n.createElement(pr,{key:t.title,value:t,parameter:e.parameter}))))):null},exports.LegendContainer=zn,exports.LegendSection=An,exports.LegendSectionContainer=Fn,exports.LegendSectionHeader=Tn,exports.LegendSymbol=lr,exports.LegendSymbolTitle=Rn,exports.LegendValue=pr,exports.LegendValueContainer=qn,exports.Map=e=>{let{className:r,position:o,resolution:i,minScale:s,maxScale:l,children:a,onBboxChange:u,style:c}=e;const f=hn(),{map:d}=H(),h=t.useCallback(e=>{u&&bn(d,{position:o,resolution:i})&&u(e)},[d,u,o,i]);return vn({position:o,resolution:i}),mn(s,l,o,i),nn(h),n.createElement("div",{className:r,ref:f,style:c},a)},exports.MapControl=Ke,exports.MapControls=Qe,exports.MapLegend=e=>{let{layer:t,config:r,fromToTitle:o=Mr,className:i}=e;const s=((e,t)=>{const n=tn(e,t);if(!n)return null;const r=n.items[0];return{symbol:On(n.symbol,"stroke.color","#fff"),item:r}})(t,r);if(!s)return null;const{symbol:l,item:a}=s;return n.createElement(Cn,{symbol:l},n.createElement(xr,{className:i},n.createElement(kr,null,n.createElement(wr,null,a.title),n.createElement(Cr,null,n.createElement(Sr,null,o[0]),a.values.map(e=>n.createElement(Lr,{key:e.title,value:e,parameter:a.parameter})),n.createElement(Sr,null,o[1])))))},exports.MapLegendContainer=kr,exports.MapLegendControl=xr,exports.MapLegendHeader=wr,exports.MapLegendSection=Cr,exports.MapLegendSymbol=Lr,exports.MapLegendValueDescr=Sr,exports.MapProvider=e=>{let{map:r,painter:o,children:s}=e;const l=t.useMemo(()=>({map:r||G,painter:o||(r?new i.DomPainter(r):Z)}),[r,o]);return n.createElement(X.Provider,{value:l},s)},exports.Measure=()=>n.createElement(Ke,null,n.createElement(Ye,{onClick:()=>{}})),exports.MeasureBtn=Ye,exports.MeasureTool=Fe,exports.Measurer=e=>{let{isActive:t,renderLabelSymbol:r}=e;const{map:o,painter:i}=H();return t?n.createElement(Fe,{map:o,painter:i,renderLabelSymbol:r}):null},exports.ScaleRuler=()=>{const{resolution:e}=un(),r=function(e){const{painter:n}=H(),{height:r,width:o}=n;return t.useMemo(()=>{if(0===o)return e;const t=o/10,i=n.getPointFromPxPosition(0,r/2),s=n.getPointFromPxPosition(t,r/2);return b.distance(i,s)/t},[r,o,e,n])}(e||0),o=50*r,i=it(o),s=it(o)/r;return n.createElement(nt,null,n.createElement(rt,{width:s},n.createElement(ot,{alignEnd:!0,margin:"0"},i>=1e3?i/1e3+"km":i+"m")))},exports.ScaleRulerBlock=rt,exports.ScaleRulerContainer=nt,exports.Search=()=>n.createElement(Ke,null,n.createElement(He,{onClick:()=>{}})),exports.SearchBtn=He,exports.ShadowedPointSymbol=me,exports.ShadowedPolySymbol=ye,exports.StyleProxy=Kt,exports.StyleSymbol=e=>{let{symbol:t,size:r=hr,children:o}=e,i=null;try{i=nr(t)}catch(e){}return o||i&&n.createElement(ur,{symbol:dr(i,0,r-1),size:r})},exports.Symbol=ur,exports.TextContainer=ot,exports.TileLayer=e=>(function(e){let{maskUrl:t,zIndex:n,isDisplayed:r}=e,o=ie(e,["maskUrl","zIndex","isDisplayed"]);const{map:i}=H(),s=lt({factory:()=>new V.TileLayer(t,o),destructor:e=>-1!==i.indexOf(e)&&i.removeLayer(e)},[t]);ut(s,n),ct(s,r)}(e),null),exports.Tooltip=e=>{let{features:r=[],map:i,center:s,component:l,zIndex:a,children:u,content:c,onEachFeature:f,clickMode:d}=e,h=ie(e,["features","map","center","component","zIndex","children","content","onEachFeature","clickMode"]);const p=xn(a);return t.useEffect(()=>{(i?[i]:r).forEach(e=>{p({feature:e,component:"function"==typeof f?()=>f(e):()=>n.createElement(Wr,Object.assign({},h),c),position:!s||e instanceof o.Map||!e.bbox.center?void 0:e.bbox.center,clickMode:d})})},[c,d,f,p,i,s,r,l,h]),n.createElement(Br,{value:r},i?u:u?n.createElement(Vr,null,u):null)},exports.TooltipComponent=Wr,exports.TooltipProvider=e=>{let{layer:r,popupLayer:o,children:i}=e;const s=t.useMemo(()=>({layer:r||J,popupLayer:o||Y}),[r,o]);return n.createElement(K.Provider,{value:s},i)},exports.Zoom=e=>{let{children:t}=e;const{zoomIn:r,zoomOut:o}=dn();return n.createElement(Ke,null,n.createElement(Ze,{onClick:r}),n.createElement(Xe,{onClick:o}),t)},exports.ZoomInBtn=Ze,exports.ZoomLevel=()=>{const e=cn();return n.createElement(ot,{buttonText:!0,width:"2rem"},e||0)},exports.ZoomOutBtn=Xe,exports.createLabelSymbol=de,exports.createShadowRender=he,exports.defaultOffset=fe,exports.formatArea=Se,exports.formatLength=Le,exports.getEditorPointRenderer=pe,exports.getLegendSymbolRenders=Pt,exports.getMapLegendSymbolRenders=Mt,exports.getMapState=rn,exports.getScale=it,exports.getSymbolRenders=Et,exports.isImageSymbol=mt,exports.isPointSymbol=pt,exports.isPolygonSymbol=yt,exports.isPolylineSymbol=gt,exports.measureAreaSymbol=xe,exports.measureLengthSymbol=be,exports.measurePolygonSnapSymbol=ke,exports.placementMixin=Oe,exports.renderSymbolToCanvas=zt,exports.shouldUpdateMapState=bn,exports.useClusterLayer=kn,exports.useEventPoint=fn,exports.useEvergisContext=U,exports.useEvergisDynamicLayer=ft,exports.useEvergisTileLayer=dt,exports.useFeatureLayer=ht,exports.useLayerLegend=tn,exports.useLayerOrder=ut,exports.useLayerVisibility=ct,exports.useMapBboxChange=nn,exports.useMapContext=H,exports.useMapLevel=cn,exports.useMapPick=()=>{const{map:e,painter:n}=H(),[r,o]=t.useState(),i=t.useMemo(()=>e.layers,[e.layers]),s=t.useCallback(e=>{if(!(e instanceof A.sGisClickEvent))return;const t=[0,0,n.width,n.height],[r,s]=n.getPxPosition(e.point.position);o({clickPoint:[Math.round(r),Math.round(s)],envelopes:sn(i),imageRectangle:t})},[e]);return st({onMount:()=>e.on("click",s),onUnmount:()=>e.off("click",s)}),r},exports.useMapState=ln,exports.useMapView=un,exports.useMapViewActions=dn,exports.useMapWrapper=hn,exports.useMaxMinScale=mn,exports.useMount=st,exports.useProperty=lt,exports.useScale=function(e){let{resolution:n,minLength:r=50}=e;const o=function(e){const{painter:n}=H(),{height:r,width:o,bbox:{xMin:i,xMax:s,yMin:l,yMax:a,crs:u}}=n;return t.useMemo(()=>{if(0===o)return e;const t=o/10,i=n.getPointFromPxPosition(0,r/2),s=n.getPointFromPxPosition(t,r/2);return b.distance(i,s)/t},[r,o,i,s,l,a,u.wkid,e,n])}(n);return t.useMemo(()=>{const e=r*o;return{currentScale:gn(e),width:gn(e)/o}},[o,r])},exports.useTooltip=xn,exports.useTooltipContext=Q,exports.useUpdate=at,exports.useUpdateMapView=vn; | ||
//# sourceMappingURL=react.cjs.production.min.js.map |
{ | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"license": "MIT", | ||
@@ -75,3 +75,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "f79778cbb4ee4b4b5235599cf87f7bd46a8ea313" | ||
"gitHead": "8931f38f6684f15d08455229eb688a0fbb50ef7f" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1115347
154
8854