@evergis/api 3.0.167 → 3.0.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("@microsoft/signalr"),r=require("ky"),s=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,i=require("query-string"),o=require("nanoid"),a=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),u=require("@evergis/sgis/es/Map"),l=require("@evergis/sgis/es/layers/TileLayer"),c=require("@evergis/sgis/es/Crs"),p=require("@evergis/sgis/es/layers/DynamicLayer"),h=require("@evergis/sgis");function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function d(){return(d=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 k(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 g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(s[n]=e[n]);return s}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?b(e):t}function w(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var s=g(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return x(this,n)}}function T(e,t,n){return(T="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=g(e)););return e}(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(n):s.value}})(e,t,n||e)}let j=function(){function e(t){var n;void 0===t&&(t={}),y(this,e),this.ky=s.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return v(e,[{key:"extend",value:function(e){var t;this.ky=s.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:P(t)})}},{key:"post",value:function(e,t,n){const r=S(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=S(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=S(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=S(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+P(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function S(e,t){const n={searchParams:P(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function P(e){return void 0===e&&(e={}),i.stringify(e,{arrayFormat:"comma"})}function I(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let R=v((function e(t){y(this,e),this.http=t})),C=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}();const L=["taskId","layerName"];let E=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=m(e,L);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult1",value:function(e){return this.http.get("/search/"+e).json()}}]),n}();var U;(U=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",U.Unauthorized="Unauthorized",U.SessionClosed="SessionClosed";let F=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),N=function(e){k(n,F);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const A=["cameraId"],D=["cameraId"],O=["cameraId"],B=["cameraId"],M=["cameraId"];let _=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,A);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=m(e,D);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=m(e,O);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=m(e,B);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,M);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}}]),n}(),q=function(e){k(n,_);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),W=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}}]),n}(),H=function(e){k(n,W);var t=w(n);function n(e,r){var s;let{username:i,roles:o}=r;return y(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return v(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),G=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"downloadFile",value:function(e){return this.http.get("/upload/file",e).blob()}},{key:"uploadFile",value:function(e){return this.http.post("/upload/file",I(e)).json()}},{key:"deleteFile",value:function(e){return this.http.delete("/upload/file",null,e).then(()=>{})}},{key:"getFileInfo",value:function(e){return this.http.get("/upload/fileInfo",e).json()}}]),n}(),z=function(e){k(n,G);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),V=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).text()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),J=function(e){k(n,V);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Q=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),K=function(e){k(n,Q);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),X=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var Y;(Y=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",Y.Connected="Connected",Y.Break="Break",Y.Lost="Lost",Y.SessionClosed="SessionClosed";let Z=function(e){k(r,X);var n=w(r);function r(e,s,i){var o;return void 0===i&&(i=!1),y(this,r),(o=n.call(this,e)).api=s,o.MAX_WS_RECONNECT_TRIES=10,o.keepAlive=!1,o.reconnectTries=0,o.subscriptions=[],o._connectStatus=exports.ConnectionStatus.Initialized,o.onWsConnected=()=>{o.connectStatus=exports.ConnectionStatus.Connected,o.keepAlive&&(o.keepAliveTimeout=setInterval(()=>{o.ws&&o.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},o.onWsClosed=e=>{4001===e.code||4002===e.code?o.connectStatus=exports.ConnectionStatus.SessionClosed:o.reconnectTries<o.MAX_WS_RECONNECT_TRIES?(o.connectStatus=exports.ConnectionStatus.Break,o.reconnectTries++,o.ws&&(o.ws.onopen=null,o.ws.onclose=null,o.ws.onmessage=null,o.ws=void 0),o.keepAliveTimeout&&clearInterval(o.keepAliveTimeout),setTimeout(()=>{o.connect()},0)):o.connectStatus=exports.ConnectionStatus.Lost},o.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&o.emitter.emit(e,new $(n))}},o.emitter=new t.EventEmitter,o.keepAlive=i,o}return v(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new $(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{!this.api.isShared&&this.subscriptions.length&&this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),$=v((function e(t){y(this,e),this.data=t})),ee=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTaskList",value:function(e){return this.http.get("/scheduler/tasks",e).json()}},{key:"getTaskInfo",value:function(e){return this.http.get("/scheduler/tasks/"+e).json()}},{key:"getTaskProgress",value:function(e){return this.http.get("/scheduler/tasks/"+e+"/progress").json()}},{key:"cancelTask",value:function(e){return this.http.post("/scheduler/tasks/"+e+"/cancel",null).json()}},{key:"startCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"copy"}).json()}},{key:"startAggregateTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"aggregate"}).json()}},{key:"startBufferTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"buffer"}).json()}},{key:"startPrintTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"print"}).json()}},{key:"startTilingTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"tiling"}).json()}},{key:"startTilingTask1",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"rasterVrt"}).json()}},{key:"startNetCdfTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"netcdf"}).json()}},{key:"startRouteTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"route"}).json()}},{key:"startUnionTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"union"}).json()}},{key:"startOverlayTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"overlay"}).json()}},{key:"startFilterCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"filterCopy"}).json()}},{key:"startPipelineTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"pipeline"}).json()}},{key:"startEditAttributesBatch",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"editAttributes"}).json()}},{key:"universalSearchTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"universalSearch"}).json()}}]),n}(),te=function(e){k(n,ee);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"init",value:function(e){return this.notification=e,this.notification.subscribe("server_task")}},{key:"runCopyTask",value:async function(e){const{taskId:t}=await this.startCopyTask(e);return this.processTaskId(t)}},{key:"runBufferTask",value:async function(e){const{taskId:t}=await this.startBufferTask(e);return this.processTaskId(t)}},{key:"runUnionTask",value:async function(e){const{taskId:t}=await this.startUnionTask(e);return this.processTaskId(t)}},{key:"runPrintTask",value:async function(e){const{taskId:t}=await this.startPrintTask(e);return this.processTaskId(t)}},{key:"runTilingTask",value:async function(e){const{taskId:t}=await this.startTilingTask(e);return this.processTaskId(t)}},{key:"runRouteTask",value:async function(e){const{taskId:t}=await this.startRouteTask(e);return this.processTaskId(t)}},{key:"runOverlayTask",value:async function(e){const{taskId:t}=await this.startOverlayTask(e);return this.processTaskId(t)}},{key:"runFilterCopyTask",value:async function(e){const{taskId:t}=await this.startFilterCopyTask(e);return this.processTaskId(t)}},{key:"runPipelineTask",value:async function(e){const{taskId:t}=await this.startPipelineTask(e);return this.processTaskId(t)}},{key:"runEditAttributesTask",value:async function(e){const{taskId:t}=await this.startEditAttributesBatch(e);return this.processTaskId(t)}},{key:"waitTaskCompleted",value:async function(e){return new Promise(async(t,n)=>{const r=await this.getTaskProgress(e);this.resolveTaskStatus(r,t,n);const s=async r=>{let{data:i}=r;if(i.taskId===e&&i.status&&["Completed","Failed","Canceled"].includes(i.status)){const r=await this.getTaskProgress(e);this.notification&&this.notification.off("server_task",s),this.resolveTaskStatus(r,t,n)}};this.notification&&this.notification.on("server_task",s)})}},{key:"resolveTaskStatus",value:function(e,t,n){"Completed"===e.status?t(e):"Failed"!==e.status&&"Canceled"!==e.status||n(e.status)}},{key:"processTaskId",value:function(e){if(e)return this.waitTaskCompleted(e);throw new Error("Task was started with no testId")}}]),n}();const ne=["name"],re=["name"],se=["name"],ie=["name","id"],oe=["name","id"],ae=["name","id"],ue=["name","x","y","z"],le=["name"],ce=["name"],pe=["name"],he=["name"],ye=["name"],fe=["name"],ve=["name"],de=["name"],ke=["name"],ge=["name"],me=["name"],be=["layerName"],xe=["name","id"];let we=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/layers",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishLocalTileService",value:function(e){return this.http.post("/layers",e,{type:"LocalTileService"}).json()}},{key:"publishPostgresLayerService",value:function(e){return this.http.post("/layers",e,{type:"PostgresLayerService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"publishCompositeService",value:function(e){return this.http.post("/layers",e,{type:"CompositeService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateLocalTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"LocalTileService"}).json()}},{key:"updatePostgresLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresLayerService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"updateCompositeService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"CompositeService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeaturesQuery",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures",value:function(e){let{name:t}=e,n=m(e,ne);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=m(e,re);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"featuresContains",value:function(e){let{name:t}=e,n=m(e,se);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=m(e,ie);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=m(e,oe);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,s).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,s=m(e,ae);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,s).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:s}=e,i=m(e,ue);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=m(e,le);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=m(e,ce);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=m(e,pe);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=m(e,he);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=m(e,ye);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=m(e,fe);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=m(e,ve);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=m(e,de);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=m(e,ke);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=m(e,ge);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=m(e,me);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"selectFeatures",value:function(e){return this.http.get("/layers/features/select",e).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=m(e,be);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=m(e,xe);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"getPreview",value:function(e){return this.http.createUrl("/layers/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/layers/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/layers/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/layers/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/layers/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/layers/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/layers/"+e+"/permissions/"+t,null).json()}}]),n}();async function Te(e){return(await Promise.all(e.map(e=>e.catch(e=>je(e)?e:new Error(e))))).filter(Se)}function je(e){return e instanceof Error}function Se(e){return!je(e)}const Pe=["remote"];let Ie=function(e){k(n,we);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayerInfos",value:function(e){return Te(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return Te(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(d({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=m(e,Pe);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"create",value:function(e){return this.publishPostgresLayerService(e)}},{key:"update",value:function(e){return this.updatePostgresLayerService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const Re=["name"],Ce=["name"],Le=["name"],Ee=["name"];let Ue=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/tables",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=m(e,Re);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=m(e,Ce);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=m(e,Le);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=m(e,Ee);return this.http.get("/tables/"+t+"/data/unique-values",n).json()}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"getPreview",value:function(e){return this.http.createUrl("/tables/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/tables/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/tables/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/tables/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/tables/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/tables/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/tables/"+e+"/permissions/"+t,null).json()}}]),n}(),Fe=function(e){k(n,Ue);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableInfos",value:function(e){return Te(e.map(e=>this.getTableInfo(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),Ne=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/projects",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getPreview",value:function(e){return this.http.createUrl("/projects/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/projects/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/projects/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/projects/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/projects/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/projects/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/projects/"+e+"/permissions/"+t,null).json()}}]),n}(),Ae=function(e){k(n,Ne);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectInfos",value:function(e){return Te(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return Te(e.map(e=>this.getResourceDependencies(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();function De(e,t,n){return n.indexOf(e)===t}function Oe(e){return"string"==typeof e}var Be;(Be=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",Be.Table="Table",Be.Project="Project";let Me=function(){function e(t,n,r){y(this,e),this.projects=t,this.layers=n,this.tables=r}return v(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:s}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:s}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:s}=e.reduce((e,r)=>{const s=r.dependencies||[];if(t){const t=this.getDependentNames(s,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(s,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(De)),layers:await this.layers.getLayerInfos(s.filter(De))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter(Oe)}}]),e}(),_e=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",I(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),qe=function(e){k(n,_e);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const We=["providerName"],He=["providerName"],Ge=["providerName"];let ze=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=m(e,We);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=m(e,He);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=m(e,Ge);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),Ve=function(e){k(n,ze);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode2Gis",value:function(e){return this.geocode(d({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(d({providerName:"geocode2gis"},e))}}]),n}(),Je=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"checkLimits",value:function(e){return this.http.get("/resources/checkLimits",e).json()}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}(),Qe=function(e){k(n,Je);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ke=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Xe=function(e){k(n,Ke);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ye=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),Ze=function(e){k(n,Ye);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),$e=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getNamespaces",value:function(e){return this.http.get("/namespaces",e).json()}},{key:"createNamespace",value:function(e){return this.http.post("/namespaces",null,e).json()}},{key:"getNamespace",value:function(e){return this.http.get("/namespaces/"+e).json()}},{key:"removeNamespace",value:function(e){return this.http.delete("/namespaces/"+e,null).then(()=>{})}}]),n}(),et=function(e){k(n,$e);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),tt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",I(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",I(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",I(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e){return this.http.post("/account/login",e).text()}},{key:"refreshToken",value:function(){return this.http.post("/account/refresh-token",null).text()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).then(()=>{})}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const nt=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,rt=e=>{if(e){const t=nt();localStorage.setItem("@evergis/user-info",JSON.stringify(d({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let st=function(e){k(n,tt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:async function(e){e&&await T(g(n.prototype),"authenticate",this).call(this,e)}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(""),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){await this.revokeToken(),rt(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await T(g(n.prototype),"updateUser",this).call(this,d({username:this.username},e)),rt(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=nt();return e&&(this.userInfo=e),e}}]),n}();const it=["username"];let ot=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview",value:function(e,t){let{username:n}=e,r=m(e,it);return this.http.post("/account/user/preview/"+n,I(t),r).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),at=function(e){k(n,ot);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,e)).userInfo=r,s}return v(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=nt();return e&&(this.userInfo=e),e}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"updateCurrentUserPhoto",value:async function(e,t){const{fileId:n}=await this.uploadPreview(d({username:this.username},t),{file:e});rt({profile_photo:n,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){var e;const t=this.getPreview(""),n=await fetch(t),r=null!=(e=n.headers.get("content-type"))&&e.includes("text/plain")?await n.text():t+"?r="+Math.random();rt({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),rt({profile_photo:"",has_profile_photo:!1})}}]),n}(),ut=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),lt=function(e){k(n,ut);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),ct=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),pt=function(e){k(n,ct);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return v(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),ht=function(e){k(n,ct);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).config=null,e}return v(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}();var yt;(yt=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",yt.HTTP_CLIENT="client",yt.HTTP_SERVER="server",yt.UNKNOWN="unknown";const ft=e=>e instanceof r.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),vt=e=>e&&e.type&&e.reason;function dt(e){return function(t){return!!t.type&&e.includes(t.type)}}const kt=dt(["PostgresLayerService","PostgresTileLayerService","QueryLayerService"]),gt=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let mt=function(){function e(t){let{account:n}=t;y(this,e),this.account=n}return v(e,[{key:"createId",value:function(){return gt()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(d({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),bt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),xt=function(e){k(n,bt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),wt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}}]),n}(),Tt=function(e){k(n,wt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"getClassify",value:function(e){return this.classify(e)}}]),n}(),jt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",I(t),e).json()}}]),n}(),St=function(e){k(n,jt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}();const Pt=["name","z","x","y"];let It=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:s}=e,i=m(e,Pt);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",i).then(()=>{})}}]),n}(),Rt=function(e){k(n,It);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVt",value:function(e,t,n,r,s){return this.getVectorTile({name:e,z:t,x:n,y:r,isProject:s})}}]),n}(),Ct=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).blob()}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",I(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),Lt=function(e){k(n,Ct);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();var Et;(Et=exports.UrlPath||(exports.UrlPath={})).Base="/map",Et.Shared="/shared",Et.Portal="/portal";const Ut={401:exports.ApiEvent.Unauthorized},Ft=Object.values(exports.UrlPath),Nt=Ft[0];let At=function(e){k(i,t.EventEmitter);var s=w(i);function i(e){var t;let{url:o,wsUrl:a,wsKeepAlive:u,snappingHubUrl:l,http:c,urlPath:p,httpOptions:h}=e;y(this,i),t=s.call(this);const{hooks:f}=h||{};return t.http=c||new j(d({prefixUrl:o,timeout:!1},h||{},{hooks:d({},f||{},{beforeRequest:[...f&&f.beforeRequest||[]],afterResponse:[e=>{const n=Ut[e.status];return n&&t.emit(n,ft(new r.HTTPError(e))),e},...f&&f.afterResponse||[]]})})),t.url=o,t.wsUrl=a||o,t.urlPath=p||t.defineUrlPath(),t.layers=new Ie(t.http),t.tables=new Fe(t.http),t.projects=new Ae(t.http),t.resources=new Me(t.projects,t.layers,t.tables),t.styles=new qe(t.http),t.account=new st(t.http),t.accountPreview=new at(t.http,t.account),t.bulk=new N(t.http),t.security=new H(t.http,t.account),t.notification=new Z(t.http,b(t),u),t.scheduler=new te(t.http),t.file=new z(t.http),t.filters=new J(t.http),t.import=new K(t.http),t.geocode=new Ve(t.http),t.cameras=new q(t.http),t.print=new Lt(t.http),t.tools=new Xe(t.http),t.resourceCatalog=new Qe(t.http),t.general=new Ze(t.http),t.namespace=new et(t.http),t.external=new lt(t.http),t.clientSettings=new pt(t.http),t.portalSettings=new ht(t.http),t.iceRouter=new xt(t.http),t.statistic=new Tt(t.http),t.feedback=new St(t.http),t.vectorTiles=new Rt(t.http),t.universalSearch=new E(t.http),t.spatialReference=new C(t.http),t.names=new mt({account:t.account}),t.snappingHub=l?(new n.HubConnectionBuilder).withUrl(l,{withCredentials:!0,skipNegotiation:!0,transport:n.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,t}return v(i,[{key:"init",value:async function(e){let{authParams:t,connectWs:n,initScheduler:r,fetchSettings:s,fetchUser:i}=e;try{await this.account.login(t),i&&await this.account.fetchCurrentUser(),n&&await this.connectWs(),r&&await this.initScheduler(),s&&await this.clientSettings.fetchClientSettings({urlPath:this.urlPath}),await this.notification.subscribe("service_update")}catch(e){throw ft(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw ft(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==n.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"initScheduler",value:function(){return this.scheduler.init(this.notification)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&Ft.includes(t)?t:Nt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),i}(),Dt=function(e){k(n,l.TileLayer);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,"",{crs:e.crs,opacity:e.opacity})).api=r,s.name=e.name,s.sourceUrl=e.sourceUrl,s.subDomains=e.subDomains,s}return v(n,[{key:"getTileUrl",value:function(e,t,n){var r;const s=this.name,i=this.subDomains?function(e,t){void 0===e&&(e=0),void 0===t&&(t=100);let n=t-e,r=Math.random();return r=Math.floor(r*n),r+=e,r}(0,(null==(r=this.subDomains)?void 0:r.length)-1):void 0;return this.sourceUrl?(this.subDomains&&void 0!==i?this.sourceUrl.replace("{0}",this.subDomains[i]):this.sourceUrl).replace("{1}",""+n).replace("{2}",""+e).replace("{3}",""+t):this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:s})}}]),n}();const Ot=["name","style","condition","dataFilterId","crs"];let Bt=function(e){k(n,p.DynamicLayer);var t=w(n);function n(e,r){var s;let{name:i,style:o,condition:a,dataFilterId:u,crs:l=c.webMercator}=e,p=m(e,Ot);return y(this,n),(s=t.call(this,p)).api=r,s.name=i,s.styleId=o,s.conditionQuery=a,s.filterId=u,s.crs=l,s.subscribeRedraw(),s}return v(n,[{key:"style",get:function(){return this.styleId},set:function(e){this.styleId=e,this.forceUpdate()}},{key:"condition",get:function(){return this.conditionQuery},set:function(e){this.conditionQuery=e,this.forceUpdate()}},{key:"dataFilterId",get:function(){return this.filterId},set:function(e){this.filterId=e,this.forceUpdate()}},{key:"getUrl",value:function(e,t){return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[t.width,t.height],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery,dataFilterId:this.filterId})}},{key:"subscribeRedraw",value:function(){this.api.notification.on("service_update",e=>{(null==e?void 0:e.data.layerName)===this.name&&(this.forceUpdate(),this.redraw())})}}]),n}();const Mt={RemoteTileService:Dt,LocalTileService:Dt,PostgresLayerService:Bt,StyledFeatureLayer:Bt,CompositeService:null};let _t=function(){function e(t,n){y(this,e),this.layers=t,this.http=n}return v(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(Mt).includes(e)))(n))return;const r=Mt[n];if(r)return new r((e=>d({},e,{name:"services/"+e.name}))(t),this.http);throw new Error('Constructor for service type: "'+t.type+'" not implemented')}},{key:"getLayerInfo",value:async function(e){try{return await this.layers.getLayerInfo(e)}catch(t){throw new Error('Service with name: "'+e+'" not exists')}}}]),e}();var qt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(qt||(qt={}));let Wt=function(e){k(n,At);var t=w(n);function n(e,r,s){var i;return y(this,n),(i=t.call(this,r)).map=new u.Map,i.painter=new a.DomPainter(i.map),i.mapProps=e,i.auth=s,i.layersManager=new _t(i.layers,i.http),i}return v(n,[{key:"init",value:async function(){await T(g(n.prototype),"init",this).call(this,{authParams:this.auth,connectWs:!0,fetchSettings:!0,initScheduler:!0});const{baseService:e,services:t,projectName:r}=this.mapProps;e&&await this.setBaseMap(e),t&&await Promise.all(t.map(e=>this.addLayer(e))),r&&await this.loadProject(r),this.setMapProps()}},{key:"reset",value:async function(){await this.account.logout(),this.painter.wrapper=null}},{key:"addLayer",value:async function(e){await this.insertLayer(e,qt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,qt.BaseMaps)}},{key:"loadProject",value:async function(e){const t=await this.projects.getProjectInfo(e);if(!t||!t.content)return;const{baseMapName:n,items:r}=t.content;if(n&&await this.setBaseMap(n),r){const e=r.map(e=>e.name).filter(Ht);await Promise.all(e.map(e=>this.addLayer(e)))}}},{key:"insertLayer",value:async function(e,t){const n=await this.layersManager.getLayerService(e);n&&this.map.insertLayer(n.layer,t)}},{key:"setMapProps",value:function(){const{position:e,centerPoint:t,mapWrapper:n,resolution:r}=this.mapProps;e?this.map.position=e:t&&(this.map.centerPoint=t),r&&(this.map.resolution=r),n&&(this.painter.wrapper=n)}}]),n}();const Ht=e=>void 0!==e;var Gt,zt,Vt,Jt,Qt,Kt,Xt,Yt,Zt,$t,en,tn,nn,rn,sn,on,an,un,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn;(Gt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Gt.Array="Array",Gt.Min="Min",Gt.Max="Max",Gt.Avg="Avg",Gt.Sum="Sum",Gt.Extent="Extent",Gt.H3="H3",Gt.Count="Count",Gt.TotalCount="TotalCount",Gt.DistinctCount="DistinctCount",Gt.First="First",Gt.Last="Last",Gt.Median="Median",Gt.Mod="Mod",Gt.StdDeviation="StdDeviation",Gt.SumOfProduct="SumOfProduct",Gt.OnlyValue="OnlyValue",Gt.WeightedAvg="WeightedAvg",Gt.DensityIndicators="DensityIndicators",Gt.DividedSum="DividedSum",(zt=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",zt.SelectFromHandBook="SelectFromHandBook",zt.SelectFromRange="SelectFromRange",zt.ViewHandBook="ViewHandBook",(Vt=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Vt.String="String",Vt.Int32="Int32",Vt.Int64="Int64",Vt.Double="Double",Vt.DateTime="DateTime",Vt.Boolean="Boolean",Vt.Point="Point",Vt.Polyline="Polyline",Vt.MultiPolygon="MultiPolygon",Vt.Multipoint="Multipoint",Vt.H3Index="H3Index",Vt.Json="Json",(Jt=exports.ClassificationType||(exports.ClassificationType={})).None="none",Jt.NaturalBreaks="naturalBreaks",Jt.EqualInterval="equalInterval",Jt.Quantile="quantile",Jt.Unique="unique",(Qt=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Qt.DateTime="dateTime",Qt.Text="text",(Kt=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",Kt.SerializeError="SerializeError",Kt.InvalidDataService="InvalidDataService",Kt.InvalidConfiguration="InvalidConfiguration",Kt.InvalidDataServiceName="InvalidDataServiceName",Kt.InvalidTableName="InvalidTableName",Kt.InvalidLayerName="InvalidLayerName",Kt.ResourceNotFound="ResourceNotFound",Kt.InvalidCondition="InvalidCondition",Kt.InvalidAttributes="InvalidAttributes",Kt.InvalidIdAttribute="InvalidIdAttribute",Kt.InvalidGeometryAttribute="InvalidGeometryAttribute",Kt.InvalidGeometryAttributeType="InvalidGeometryAttributeType",Kt.InvalidColumnName="InvalidColumnName",Kt.InvalidIdColumnSettings="InvalidIdColumnSettings",Kt.ColumnNotExistsInTable="ColumnNotExistsInTable",Kt.InvalidStyle="InvalidStyle",Kt.InvalidLayerType="InvalidLayerType",Kt.ColumnLoadingError="ColumnLoadingError",Kt.InvalidAttributeFormat="InvalidAttributeFormat",Kt.DataSourceNotFound="DataSourceNotFound",Kt.DuplicateColumns="DuplicateColumns",Kt.DuplicateAttributes="DuplicateAttributes",Kt.TableWithoutColumns="TableWithoutColumns",Kt.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(Xt=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Xt.ResourceNotFound="ResourceNotFound",Xt.InternalError="InternalError",Xt.BadRequest="BadRequest",Xt.DuplicateContent="DuplicateContent",(Yt=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Yt.LimitError="LimitError",Yt.ValidationError="ValidationError",Yt.JwtExpired="JwtExpired",Yt.TokenInvalid="TokenInvalid",Yt.RefreshTokenExpired="RefreshTokenExpired",Yt.RefreshTokenInvalid="RefreshTokenInvalid",Yt.CreateUserFailed="CreateUserFailed",Yt.SetUserPasswordFailed="SetUserPasswordFailed",Yt.SetUserRoleFailed="SetUserRoleFailed",Yt.UpdateUserFailed="UpdateUserFailed",Yt.RemoveUserFailed="RemoveUserFailed",Yt.CreateRoleFailed="CreateRoleFailed",Yt.UpdateRoleFailed="UpdateRoleFailed",Yt.RemoveUserRoleFailed="RemoveUserRoleFailed",Yt.ChangeActiveStateFailed="ChangeActiveStateFailed",Yt.RemoveRoleFailed="RemoveRoleFailed",Yt.UserNotFound="UserNotFound",Yt.RoleNotFound="RoleNotFound",Yt.EmailNotConfirmed="EmailNotConfirmed",Yt.DuplicateEmailError="DuplicateEmailError",Yt.InvalidPassword="InvalidPassword",Yt.RoleExists="RoleExists",Yt.UserExists="UserExists",Yt.UserLockedError="UserLockedError",Yt.InvalidEmail="InvalidEmail",Yt.InvalidUsername="InvalidUsername",Yt.Unauthorized="Unauthorized",Yt.EmailNotChanged="EmailNotChanged",Yt.EmailNotSet="EmailNotSet",(Zt=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",Zt.GeometricFeature="GeometricFeature",($t=exports.FontStyle||(exports.FontStyle={})).Normal="normal",$t.Oblique="oblique",$t.Italic="italic",(en=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",en.ExtraLight="ExtraLight",en.Light="Light",en.SemiLight="SemiLight",en.Normal="Normal",en.Medium="Medium",en.DemiBold="DemiBold",en.Bold="Bold",en.ExtraBold="ExtraBold",en.Black="Black",en.ExtraBlack="ExtraBlack",(tn=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",tn.Point="point",tn.Polyline="polyline",tn.Polygon="multipolygon",tn.Envelope="envelope",tn.Multipoint="multipoint",(nn=exports.Group||(exports.Group={})).My="my",nn.Role="role",nn.Public="public",nn.All="all",(rn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",rn.Square="Square",rn.Round="Round",rn.Triangle="Triangle",(sn=exports.LineEndingType||(exports.LineEndingType={})).None="none",sn.Arrow="arrow",sn.FilledArrow="filledArrow",sn.Square="square",sn.FilledSquare="filledSquare",sn.Circle="circle",sn.FilledCircle="filledCircle",sn.Diamond="diamond",sn.FilledDiamond="filledDiamond",sn.RoundSquare="roundSquare",sn.FilledRoundSquare="filledRoundSquare",sn.Svg="svg",(on=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",on.Bevel="Bevel",on.Round="Round",(an=exports.Operation||(exports.Operation={})).Unknown="Unknown",an.Union="union",an.Intersection="intersection",an.Subtraction="subtraction",an.SymDifference="symDifference",(un=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",un.TMS="tms",(ln=exports.Permissions||(exports.Permissions={})).None="none",ln.Configure="configure",ln.Write="write",ln.Read="read",ln.ReadConfigure="read,configure",ln.ReadWrite="read,write",ln.All="read,write,configure",(cn=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",cn.CreateTable="CreateTable",cn.CreateLayer="CreateLayer",cn.CreateProject="CreateProject",cn.MaxFeaturesInOneTable="MaxFeaturesInOneTable",cn.MaxObjectsToExport="MaxObjectsToExport",cn.MaxUploadContentSize="MaxUploadContentSize",(pn=exports.ReferenceJoinType||(exports.ReferenceJoinType={})).OneToMany="OneToMany",pn.OneToOne="OneToOne",pn.Intersect="Intersect",pn.RightJoin="RightJoin",pn.FullJoin="FullJoin",pn.CrossJoin="CrossJoin",(hn=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",hn.Table="table",hn.Layer="layer",hn.Project="project",hn.File="file",hn.Feature="feature",hn.Tag="tag",(yn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",yn.Layer="layers",yn.Project="projects",(fn=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",fn.Scheduled="Scheduled",fn.Planning="Planning",fn.Executing="Executing",fn.Completed="Completed",fn.Failed="Failed",fn.Canceled="Canceled",fn.Timeout="Timeout",(vn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",vn.PreserveTopology="PreserveTopology",vn.VW="VW",(dn=exports.StringSubType||(exports.StringSubType={})).None="None",dn.Image="Image",dn.PkkCode="PkkCode",dn.Attachments="Attachments",(kn=exports.TaskGroup||(exports.TaskGroup={})).My="my",kn.All="all",(gn=exports.TextAlignment||(exports.TextAlignment={})).Right="right",gn.Left="left",gn.Center="center",gn.Justified="justified",(mn=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",mn.Bottom="bottom",mn.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return r.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return r.TimeoutError}}),exports.Account=st,exports.AccountPreview=at,exports.Api=At,exports.BulkOperations=N,exports.Cameras=q,exports.ClientSettings=pt,exports.EvergisDynamicLayer=Bt,exports.EvergisTileLayer=Dt,exports.External=lt,exports.Feedback=St,exports.FileUpload=z,exports.Filters=J,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=Ze,exports.Geocode=Ve,exports.HttpClient=j,exports.IceRouter=xt,exports.Import=K,exports.Layers=Ie,exports.LayersManager=_t,exports.Names=mt,exports.Namespace=et,exports.Notification=Z,exports.NotificationEvent=$,exports.PortalSettings=ht,exports.Projects=Ae,exports.ResourceCatalog=Qe,exports.Resources=Me,exports.Scheduler=te,exports.Security=H,exports.SpatialProcessor=Wt,exports.Statistic=Tt,exports.Styles=qe,exports.Tables=Fe,exports.Tools=Xe,exports.VectorTiles=Rt,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=ft,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=gt,exports.isEvergisDynamicLayer=function(e){return e instanceof Bt},exports.isEvergisTileLayer=function(e){return e instanceof Dt},exports.isFeatureLayer=function(e){return e instanceof h.FeatureLayer},exports.isHTTPError=e=>vt(e)&&"http"===e.type,exports.isHandledError=vt,exports.isLayer=kt,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Oe,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=Te,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=I,exports.unique=De;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("@microsoft/signalr"),r=require("ky"),s=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,i=require("query-string"),o=require("nanoid"),a=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),u=require("@evergis/sgis/es/Map"),l=require("@evergis/sgis/es/layers/TileLayer"),c=require("@evergis/sgis/es/Crs"),p=require("@evergis/sgis/es/layers/DynamicLayer"),h=require("@evergis/sgis");function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(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 v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(){return(d=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 k(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(s[n]=e[n]);return s}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function x(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var s=g(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return w(this,n)}}function T(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}function j(){return(j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=T(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}}).apply(this,arguments)}let S=function(){function e(t){var n;void 0===t&&(t={}),y(this,e),this.ky=s.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return v(e,[{key:"extend",value:function(e){var t;this.ky=s.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:I(t)})}},{key:"post",value:function(e,t,n){const r=P(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=P(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=P(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=P(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+I(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function P(e,t){const n={searchParams:I(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function I(e){return void 0===e&&(e={}),i.stringify(e,{arrayFormat:"comma"})}function R(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let C=v((function e(t){y(this,e),this.http=t})),L=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}();const E=["taskId","layerName"];let U=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=m(e,E);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult1",value:function(e){return this.http.get("/search/"+e).json()}}]),n}();var F;(F=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",F.Unauthorized="Unauthorized",F.SessionClosed="SessionClosed";let N=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),A=function(e){k(n,N);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const D=["cameraId"],O=["cameraId"],B=["cameraId"],M=["cameraId"],_=["cameraId"];let q=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,D);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=m(e,O);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=m(e,B);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=m(e,M);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,_);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}}]),n}(),W=function(e){k(n,q);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),H=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}}]),n}(),G=function(e){k(n,H);var t=x(n);function n(e,r){var s;let{username:i,roles:o}=r;return y(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return v(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),z=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"downloadFile",value:function(e){return this.http.get("/upload/file",e).blob()}},{key:"uploadFile",value:function(e){return this.http.post("/upload/file",R(e)).json()}},{key:"deleteFile",value:function(e){return this.http.delete("/upload/file",null,e).then(()=>{})}},{key:"getFileInfo",value:function(e){return this.http.get("/upload/fileInfo",e).json()}}]),n}(),V=function(e){k(n,z);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),J=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).text()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),Q=function(e){k(n,J);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),K=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),X=function(e){k(n,K);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Y=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var Z;(Z=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",Z.Connected="Connected",Z.Break="Break",Z.Lost="Lost",Z.SessionClosed="SessionClosed";let $=function(e){k(r,Y);var n=x(r);function r(e,s,i){var o;return void 0===i&&(i=!1),y(this,r),(o=n.call(this,e)).api=s,o.MAX_WS_RECONNECT_TRIES=10,o.keepAlive=!1,o.reconnectTries=0,o.subscriptions=[],o._connectStatus=exports.ConnectionStatus.Initialized,o.onWsConnected=()=>{o.connectStatus=exports.ConnectionStatus.Connected,o.keepAlive&&(o.keepAliveTimeout=setInterval(()=>{o.ws&&o.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},o.onWsClosed=e=>{4001===e.code||4002===e.code?o.connectStatus=exports.ConnectionStatus.SessionClosed:o.reconnectTries<o.MAX_WS_RECONNECT_TRIES?(o.connectStatus=exports.ConnectionStatus.Break,o.reconnectTries++,o.ws&&(o.ws.onopen=null,o.ws.onclose=null,o.ws.onmessage=null,o.ws=void 0),o.keepAliveTimeout&&clearInterval(o.keepAliveTimeout),setTimeout(()=>{o.connect()},0)):o.connectStatus=exports.ConnectionStatus.Lost},o.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&o.emitter.emit(e,new ee(n))}},o.emitter=new t.EventEmitter,o.keepAlive=i,o}return v(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new ee(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{!this.api.isShared&&this.subscriptions.length&&this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),ee=v((function e(t){y(this,e),this.data=t})),te=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTaskList",value:function(e){return this.http.get("/scheduler/tasks",e).json()}},{key:"getTaskInfo",value:function(e){return this.http.get("/scheduler/tasks/"+e).json()}},{key:"getTaskProgress",value:function(e){return this.http.get("/scheduler/tasks/"+e+"/progress").json()}},{key:"cancelTask",value:function(e){return this.http.post("/scheduler/tasks/"+e+"/cancel",null).json()}},{key:"startCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"copy"}).json()}},{key:"startAggregateTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"aggregate"}).json()}},{key:"startBufferTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"buffer"}).json()}},{key:"startPrintTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"print"}).json()}},{key:"startTilingTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"tiling"}).json()}},{key:"startTilingTask1",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"rasterVrt"}).json()}},{key:"startNetCdfTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"netcdf"}).json()}},{key:"startRouteTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"route"}).json()}},{key:"startUnionTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"union"}).json()}},{key:"startOverlayTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"overlay"}).json()}},{key:"startFilterCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"filterCopy"}).json()}},{key:"startPipelineTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"pipeline"}).json()}},{key:"startEditAttributesBatch",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"editAttributes"}).json()}},{key:"universalSearchTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"universalSearch"}).json()}}]),n}(),ne=function(e){k(n,te);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"init",value:function(e){return this.notification=e,this.notification.subscribe("server_task")}},{key:"runCopyTask",value:async function(e){const{taskId:t}=await this.startCopyTask(e);return this.processTaskId(t)}},{key:"runBufferTask",value:async function(e){const{taskId:t}=await this.startBufferTask(e);return this.processTaskId(t)}},{key:"runUnionTask",value:async function(e){const{taskId:t}=await this.startUnionTask(e);return this.processTaskId(t)}},{key:"runPrintTask",value:async function(e){const{taskId:t}=await this.startPrintTask(e);return this.processTaskId(t)}},{key:"runTilingTask",value:async function(e){const{taskId:t}=await this.startTilingTask(e);return this.processTaskId(t)}},{key:"runRouteTask",value:async function(e){const{taskId:t}=await this.startRouteTask(e);return this.processTaskId(t)}},{key:"runOverlayTask",value:async function(e){const{taskId:t}=await this.startOverlayTask(e);return this.processTaskId(t)}},{key:"runFilterCopyTask",value:async function(e){const{taskId:t}=await this.startFilterCopyTask(e);return this.processTaskId(t)}},{key:"runPipelineTask",value:async function(e){const{taskId:t}=await this.startPipelineTask(e);return this.processTaskId(t)}},{key:"runEditAttributesTask",value:async function(e){const{taskId:t}=await this.startEditAttributesBatch(e);return this.processTaskId(t)}},{key:"waitTaskCompleted",value:async function(e){return new Promise(async(t,n)=>{const r=await this.getTaskProgress(e);this.resolveTaskStatus(r,t,n);const s=async r=>{let{data:i}=r;if(i.taskId===e&&i.status&&["Completed","Failed","Canceled"].includes(i.status)){const r=await this.getTaskProgress(e);this.notification&&this.notification.off("server_task",s),this.resolveTaskStatus(r,t,n)}};this.notification&&this.notification.on("server_task",s)})}},{key:"resolveTaskStatus",value:function(e,t,n){"Completed"===e.status?t(e):"Failed"!==e.status&&"Canceled"!==e.status||n(e.status)}},{key:"processTaskId",value:function(e){if(e)return this.waitTaskCompleted(e);throw new Error("Task was started with no testId")}}]),n}();const re=["name"],se=["name"],ie=["name"],oe=["name","id"],ae=["name","id"],ue=["name","id"],le=["name","x","y","z"],ce=["name"],pe=["name"],he=["name"],ye=["name"],fe=["name"],ve=["name"],de=["name"],ke=["name"],ge=["name"],me=["name"],be=["name"],we=["layerName"],xe=["name","id"];let Te=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/layers",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishLocalTileService",value:function(e){return this.http.post("/layers",e,{type:"LocalTileService"}).json()}},{key:"publishPostgresLayerService",value:function(e){return this.http.post("/layers",e,{type:"PostgresLayerService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"publishCompositeService",value:function(e){return this.http.post("/layers",e,{type:"CompositeService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateLocalTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"LocalTileService"}).json()}},{key:"updatePostgresLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresLayerService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"updateCompositeService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"CompositeService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeaturesQuery",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures",value:function(e){let{name:t}=e,n=m(e,re);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=m(e,se);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"featuresContains",value:function(e){let{name:t}=e,n=m(e,ie);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=m(e,oe);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=m(e,ae);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,s).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,s=m(e,ue);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,s).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:s}=e,i=m(e,le);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=m(e,ce);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=m(e,pe);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=m(e,he);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=m(e,ye);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=m(e,fe);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=m(e,ve);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=m(e,de);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=m(e,ke);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=m(e,ge);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=m(e,me);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=m(e,be);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"selectFeatures",value:function(e){return this.http.get("/layers/features/select",e).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=m(e,we);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=m(e,xe);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"getPreview",value:function(e){return this.http.createUrl("/layers/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/layers/"+e+"/preview",R(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/layers/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/layers/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/layers/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/layers/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/layers/"+e+"/permissions/"+t,null).json()}}]),n}();async function je(e){return(await Promise.all(e.map(e=>e.catch(e=>Se(e)?e:new Error(e))))).filter(Pe)}function Se(e){return e instanceof Error}function Pe(e){return!Se(e)}const Ie=["remote"];let Re=function(e){k(n,Te);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayerInfos",value:function(e){return je(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return je(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(d({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=m(e,Ie);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"create",value:function(e){return this.publishPostgresLayerService(e)}},{key:"update",value:function(e){return this.updatePostgresLayerService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const Ce=["name"],Le=["name"],Ee=["name"],Ue=["name"];let Fe=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/tables",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=m(e,Ce);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=m(e,Le);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=m(e,Ee);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=m(e,Ue);return this.http.get("/tables/"+t+"/data/unique-values",n).json()}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"getPreview",value:function(e){return this.http.createUrl("/tables/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/tables/"+e+"/preview",R(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/tables/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/tables/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/tables/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/tables/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/tables/"+e+"/permissions/"+t,null).json()}}]),n}(),Ne=function(e){k(n,Fe);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableInfos",value:function(e){return je(e.map(e=>this.getTableInfo(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),Ae=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/projects",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getPreview",value:function(e){return this.http.createUrl("/projects/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/projects/"+e+"/preview",R(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/projects/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/projects/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/projects/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/projects/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/projects/"+e+"/permissions/"+t,null).json()}}]),n}(),De=function(e){k(n,Ae);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectInfos",value:function(e){return je(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return je(e.map(e=>this.getResourceDependencies(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();function Oe(e,t,n){return n.indexOf(e)===t}function Be(e){return"string"==typeof e}var Me;(Me=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",Me.Table="Table",Me.Project="Project";let _e=function(){function e(t,n,r){y(this,e),this.projects=t,this.layers=n,this.tables=r}return v(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:s}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:s}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:s}=e.reduce((e,r)=>{const s=r.dependencies||[];if(t){const t=this.getDependentNames(s,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(s,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(Oe)),layers:await this.layers.getLayerInfos(s.filter(Oe))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter(Be)}}]),e}(),qe=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",R(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),We=function(e){k(n,qe);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const He=["providerName"],Ge=["providerName"],ze=["providerName"];let Ve=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=m(e,He);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=m(e,Ge);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=m(e,ze);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),Je=function(e){k(n,Ve);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode2Gis",value:function(e){return this.geocode(d({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(d({providerName:"geocode2gis"},e))}}]),n}(),Qe=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"checkLimits",value:function(e){return this.http.get("/resources/checkLimits",e).json()}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}(),Ke=function(e){k(n,Qe);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Xe=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ye=function(e){k(n,Xe);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ze=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),$e=function(e){k(n,Ze);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),et=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getNamespaces",value:function(e){return this.http.get("/namespaces",e).json()}},{key:"createNamespace",value:function(e){return this.http.post("/namespaces",null,e).json()}},{key:"getNamespace",value:function(e){return this.http.get("/namespaces/"+e).json()}},{key:"removeNamespace",value:function(e){return this.http.delete("/namespaces/"+e,null).then(()=>{})}}]),n}(),tt=function(e){k(n,et);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),nt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",R(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",R(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",R(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e){return this.http.post("/account/login",e).text()}},{key:"refreshToken",value:function(){return this.http.post("/account/refresh-token",null).text()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).then(()=>{})}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const rt=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,st=e=>{if(e){const t=rt();localStorage.setItem("@evergis/user-info",JSON.stringify(d({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let it=function(e){k(n,nt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:async function(e){e&&await j(g(n.prototype),"authenticate",this).call(this,e)}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(""),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){await this.revokeToken(),st(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await j(g(n.prototype),"updateUser",this).call(this,d({username:this.username},e)),st(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=rt();return e&&(this.userInfo=e),e}}]),n}();const ot=["username"];let at=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview",value:function(e,t){let{username:n}=e,r=m(e,ot);return this.http.post("/account/user/preview/"+n,R(t),r).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),ut=function(e){k(n,at);var t=x(n);function n(e,r){var s;return y(this,n),(s=t.call(this,e)).userInfo=r,s}return v(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=rt();return e&&(this.userInfo=e),e}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"updateCurrentUserPhoto",value:async function(e,t){const{fileId:n}=await this.uploadPreview(d({username:this.username},t),{file:e});st({profile_photo:n,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){var e;const t=this.getPreview(""),n=await fetch(t),r=null!=(e=n.headers.get("content-type"))&&e.includes("text/plain")?await n.text():t+"?r="+Math.random();st({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),st({profile_photo:"",has_profile_photo:!1})}}]),n}(),lt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),ct=function(e){k(n,lt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),pt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),ht=function(e){k(n,pt);var t=x(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return v(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),yt=function(e){k(n,pt);var t=x(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).config=null,e}return v(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}();var ft;(ft=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",ft.HTTP_CLIENT="client",ft.HTTP_SERVER="server",ft.UNKNOWN="unknown";const vt=e=>e instanceof r.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),dt=e=>e&&e.type&&e.reason;function kt(e){return function(t){return!!t.type&&e.includes(t.type)}}const gt=kt(["PostgresLayerService","PostgresTileLayerService","QueryLayerService"]),mt=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let bt=function(){function e(t){let{account:n}=t;y(this,e),this.account=n}return v(e,[{key:"createId",value:function(){return mt()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(d({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),wt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),xt=function(e){k(n,wt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Tt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}}]),n}(),jt=function(e){k(n,Tt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"getClassify",value:function(e){return this.classify(e)}}]),n}(),St=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",R(t),e).json()}}]),n}(),Pt=function(e){k(n,St);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}();const It=["name","z","x","y"];let Rt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:s}=e,i=m(e,It);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",i).then(()=>{})}}]),n}(),Ct=function(e){k(n,Rt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVt",value:function(e,t,n,r,s){return this.getVectorTile({name:e,z:t,x:n,y:r,isProject:s})}}]),n}(),Lt=function(e){k(n,C);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).blob()}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",R(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),Et=function(e){k(n,Lt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();var Ut;(Ut=exports.UrlPath||(exports.UrlPath={})).Base="/map",Ut.Shared="/shared",Ut.Portal="/portal";const Ft={401:exports.ApiEvent.Unauthorized},Nt=Object.values(exports.UrlPath),At=Nt[0];let Dt=function(e){k(i,t.EventEmitter);var s=x(i);function i(e){var t;let{url:o,wsUrl:a,wsKeepAlive:u,snappingHubUrl:l,http:c,urlPath:p,httpOptions:h}=e;y(this,i),t=s.call(this);const{hooks:f}=h||{};return t.http=c||new S(d({prefixUrl:o,timeout:!1},h||{},{hooks:d({},f||{},{beforeRequest:[...f&&f.beforeRequest||[]],afterResponse:[e=>{const n=Ft[e.status];return n&&t.emit(n,vt(new r.HTTPError(e))),e},...f&&f.afterResponse||[]]})})),t.url=o,t.wsUrl=a||o,t.urlPath=p||t.defineUrlPath(),t.layers=new Re(t.http),t.tables=new Ne(t.http),t.projects=new De(t.http),t.resources=new _e(t.projects,t.layers,t.tables),t.styles=new We(t.http),t.account=new it(t.http),t.accountPreview=new ut(t.http,t.account),t.bulk=new A(t.http),t.security=new G(t.http,t.account),t.notification=new $(t.http,b(t),u),t.scheduler=new ne(t.http),t.file=new V(t.http),t.filters=new Q(t.http),t.import=new X(t.http),t.geocode=new Je(t.http),t.cameras=new W(t.http),t.print=new Et(t.http),t.tools=new Ye(t.http),t.resourceCatalog=new Ke(t.http),t.general=new $e(t.http),t.namespace=new tt(t.http),t.external=new ct(t.http),t.clientSettings=new ht(t.http),t.portalSettings=new yt(t.http),t.iceRouter=new xt(t.http),t.statistic=new jt(t.http),t.feedback=new Pt(t.http),t.vectorTiles=new Ct(t.http),t.universalSearch=new U(t.http),t.spatialReference=new L(t.http),t.names=new bt({account:t.account}),t.snappingHub=l?(new n.HubConnectionBuilder).withUrl(l,{withCredentials:!0,skipNegotiation:!0,transport:n.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,t}return v(i,[{key:"init",value:async function(e){let{authParams:t,connectWs:n,initScheduler:r,fetchSettings:s,fetchUser:i}=e;try{await this.account.login(t),i&&await this.account.fetchCurrentUser(),n&&await this.connectWs(),r&&await this.initScheduler(),s&&await this.clientSettings.fetchClientSettings({urlPath:this.urlPath}),await this.notification.subscribe("service_update")}catch(e){throw vt(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw vt(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==n.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"initScheduler",value:function(){return this.scheduler.init(this.notification)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&Nt.includes(t)?t:At}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),i}(),Ot=function(e){k(n,l.TileLayer);var t=x(n);function n(e,r){var s;return y(this,n),(s=t.call(this,"",{crs:e.crs,opacity:e.opacity})).api=r,s.name=e.name,s.sourceUrl=e.sourceUrl,s.subDomains=e.subDomains,s}return v(n,[{key:"getTileUrl",value:function(e,t,n){var r;const s=this.name,i=this.subDomains?function(e,t){void 0===e&&(e=0),void 0===t&&(t=100);let n=t-e,r=Math.random();return r=Math.floor(r*n),r+=e,r}(0,(null==(r=this.subDomains)?void 0:r.length)-1):void 0;return this.sourceUrl?(this.subDomains&&void 0!==i?this.sourceUrl.replace("{0}",this.subDomains[i]):this.sourceUrl).replace("{1}",""+n).replace("{2}",""+e).replace("{3}",""+t):this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:s})}}]),n}();const Bt=["name","style","condition","dataFilterId","crs"];let Mt=function(e){k(n,p.DynamicLayer);var t=x(n);function n(e,r){var s;let{name:i,style:o,condition:a,dataFilterId:u,crs:l=c.webMercator}=e,p=m(e,Bt);return y(this,n),(s=t.call(this,p)).api=r,s.name=i,s.styleId=o,s.conditionQuery=a,s.filterId=u,s.crs=l,s.subscribeRedraw(),s}return v(n,[{key:"style",get:function(){return this.styleId},set:function(e){this.styleId=e,this.forceUpdate()}},{key:"condition",get:function(){return this.conditionQuery},set:function(e){this.conditionQuery=e,this.forceUpdate()}},{key:"dataFilterId",get:function(){return this.filterId},set:function(e){this.filterId=e,this.forceUpdate()}},{key:"getUrl",value:function(e,t){return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[t.width,t.height],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery,dataFilterId:this.filterId})}},{key:"subscribeRedraw",value:function(){this.api.notification.on("service_update",e=>{(null==e?void 0:e.data.layerName)===this.name&&(this.forceUpdate(),this.redraw())})}}]),n}();const _t={RemoteTileService:Ot,LocalTileService:Ot,PostgresLayerService:Mt,StyledFeatureLayer:Mt,CompositeService:null};let qt=function(){function e(t,n){y(this,e),this.layers=t,this.http=n}return v(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(_t).includes(e)))(n))return;const r=_t[n];if(r)return new r((e=>d({},e,{name:"services/"+e.name}))(t),this.http);throw new Error('Constructor for service type: "'+t.type+'" not implemented')}},{key:"getLayerInfo",value:async function(e){try{return await this.layers.getLayerInfo(e)}catch(t){throw new Error('Service with name: "'+e+'" not exists')}}}]),e}();var Wt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(Wt||(Wt={}));let Ht=function(e){k(n,Dt);var t=x(n);function n(e,r,s){var i;return y(this,n),(i=t.call(this,r)).map=new u.Map,i.painter=new a.DomPainter(i.map),i.mapProps=e,i.auth=s,i.layersManager=new qt(i.layers,i.http),i}return v(n,[{key:"init",value:async function(){await j(g(n.prototype),"init",this).call(this,{authParams:this.auth,connectWs:!0,fetchSettings:!0,initScheduler:!0});const{baseService:e,services:t,projectName:r}=this.mapProps;e&&await this.setBaseMap(e),t&&await Promise.all(t.map(e=>this.addLayer(e))),r&&await this.loadProject(r),this.setMapProps()}},{key:"reset",value:async function(){await this.account.logout(),this.painter.wrapper=null}},{key:"addLayer",value:async function(e){await this.insertLayer(e,Wt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,Wt.BaseMaps)}},{key:"loadProject",value:async function(e){const t=await this.projects.getProjectInfo(e);if(!t||!t.content)return;const{baseMapName:n,items:r}=t.content;if(n&&await this.setBaseMap(n),r){const e=r.map(e=>e.name).filter(Gt);await Promise.all(e.map(e=>this.addLayer(e)))}}},{key:"insertLayer",value:async function(e,t){const n=await this.layersManager.getLayerService(e);n&&this.map.insertLayer(n.layer,t)}},{key:"setMapProps",value:function(){const{position:e,centerPoint:t,mapWrapper:n,resolution:r}=this.mapProps;e?this.map.position=e:t&&(this.map.centerPoint=t),r&&(this.map.resolution=r),n&&(this.painter.wrapper=n)}}]),n}();const Gt=e=>void 0!==e;var zt,Vt,Jt,Qt,Kt,Xt,Yt,Zt,$t,en,tn,nn,rn,sn,on,an,un,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn,bn;(zt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",zt.Array="Array",zt.Min="Min",zt.Max="Max",zt.Avg="Avg",zt.Sum="Sum",zt.Extent="Extent",zt.H3="H3",zt.Count="Count",zt.TotalCount="TotalCount",zt.DistinctCount="DistinctCount",zt.First="First",zt.Last="Last",zt.Median="Median",zt.Mod="Mod",zt.StdDeviation="StdDeviation",zt.SumOfProduct="SumOfProduct",zt.OnlyValue="OnlyValue",zt.WeightedAvg="WeightedAvg",zt.DensityIndicators="DensityIndicators",zt.DividedSum="DividedSum",(Vt=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",Vt.SelectFromHandBook="SelectFromHandBook",Vt.SelectFromRange="SelectFromRange",Vt.ViewHandBook="ViewHandBook",(Jt=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Jt.String="String",Jt.Int32="Int32",Jt.Int64="Int64",Jt.Double="Double",Jt.DateTime="DateTime",Jt.Boolean="Boolean",Jt.Point="Point",Jt.Polyline="Polyline",Jt.MultiPolygon="MultiPolygon",Jt.Multipoint="Multipoint",Jt.H3Index="H3Index",Jt.Json="Json",(Qt=exports.ClassificationType||(exports.ClassificationType={})).None="none",Qt.NaturalBreaks="naturalBreaks",Qt.EqualInterval="equalInterval",Qt.Quantile="quantile",Qt.Unique="unique",(Kt=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Kt.DateTime="dateTime",Kt.Text="text",(Xt=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",Xt.SerializeError="SerializeError",Xt.InvalidDataService="InvalidDataService",Xt.InvalidConfiguration="InvalidConfiguration",Xt.InvalidDataServiceName="InvalidDataServiceName",Xt.InvalidTableName="InvalidTableName",Xt.InvalidLayerName="InvalidLayerName",Xt.ResourceNotFound="ResourceNotFound",Xt.InvalidCondition="InvalidCondition",Xt.InvalidAttributes="InvalidAttributes",Xt.InvalidIdAttribute="InvalidIdAttribute",Xt.InvalidGeometryAttribute="InvalidGeometryAttribute",Xt.InvalidGeometryAttributeType="InvalidGeometryAttributeType",Xt.InvalidColumnName="InvalidColumnName",Xt.InvalidIdColumnSettings="InvalidIdColumnSettings",Xt.ColumnNotExistsInTable="ColumnNotExistsInTable",Xt.InvalidStyle="InvalidStyle",Xt.InvalidLayerType="InvalidLayerType",Xt.ColumnLoadingError="ColumnLoadingError",Xt.InvalidAttributeFormat="InvalidAttributeFormat",Xt.DataSourceNotFound="DataSourceNotFound",Xt.DuplicateColumns="DuplicateColumns",Xt.DuplicateAttributes="DuplicateAttributes",Xt.TableWithoutColumns="TableWithoutColumns",Xt.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(Yt=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Yt.ResourceNotFound="ResourceNotFound",Yt.InternalError="InternalError",Yt.BadRequest="BadRequest",Yt.DuplicateContent="DuplicateContent",(Zt=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Zt.LimitError="LimitError",Zt.ValidationError="ValidationError",Zt.JwtExpired="JwtExpired",Zt.TokenInvalid="TokenInvalid",Zt.RefreshTokenExpired="RefreshTokenExpired",Zt.RefreshTokenInvalid="RefreshTokenInvalid",Zt.CreateUserFailed="CreateUserFailed",Zt.SetUserPasswordFailed="SetUserPasswordFailed",Zt.SetUserRoleFailed="SetUserRoleFailed",Zt.UpdateUserFailed="UpdateUserFailed",Zt.RemoveUserFailed="RemoveUserFailed",Zt.CreateRoleFailed="CreateRoleFailed",Zt.UpdateRoleFailed="UpdateRoleFailed",Zt.RemoveUserRoleFailed="RemoveUserRoleFailed",Zt.ChangeActiveStateFailed="ChangeActiveStateFailed",Zt.RemoveRoleFailed="RemoveRoleFailed",Zt.UserNotFound="UserNotFound",Zt.RoleNotFound="RoleNotFound",Zt.EmailNotConfirmed="EmailNotConfirmed",Zt.DuplicateEmailError="DuplicateEmailError",Zt.InvalidPassword="InvalidPassword",Zt.RoleExists="RoleExists",Zt.UserExists="UserExists",Zt.UserLockedError="UserLockedError",Zt.InvalidEmail="InvalidEmail",Zt.InvalidUsername="InvalidUsername",Zt.Unauthorized="Unauthorized",Zt.EmailNotChanged="EmailNotChanged",Zt.EmailNotSet="EmailNotSet",($t=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",$t.GeometricFeature="GeometricFeature",(en=exports.FontStyle||(exports.FontStyle={})).Normal="normal",en.Oblique="oblique",en.Italic="italic",(tn=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",tn.ExtraLight="ExtraLight",tn.Light="Light",tn.SemiLight="SemiLight",tn.Normal="Normal",tn.Medium="Medium",tn.DemiBold="DemiBold",tn.Bold="Bold",tn.ExtraBold="ExtraBold",tn.Black="Black",tn.ExtraBlack="ExtraBlack",(nn=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",nn.Point="point",nn.Polyline="polyline",nn.Polygon="multipolygon",nn.Envelope="envelope",nn.Multipoint="multipoint",(rn=exports.Group||(exports.Group={})).My="my",rn.Role="role",rn.Public="public",rn.All="all",(sn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",sn.Square="Square",sn.Round="Round",sn.Triangle="Triangle",(on=exports.LineEndingType||(exports.LineEndingType={})).None="none",on.Arrow="arrow",on.FilledArrow="filledArrow",on.Square="square",on.FilledSquare="filledSquare",on.Circle="circle",on.FilledCircle="filledCircle",on.Diamond="diamond",on.FilledDiamond="filledDiamond",on.RoundSquare="roundSquare",on.FilledRoundSquare="filledRoundSquare",on.Svg="svg",(an=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",an.Bevel="Bevel",an.Round="Round",(un=exports.Operation||(exports.Operation={})).Unknown="Unknown",un.Union="union",un.Intersection="intersection",un.Subtraction="subtraction",un.SymDifference="symDifference",(ln=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",ln.TMS="tms",(cn=exports.Permissions||(exports.Permissions={})).None="none",cn.Configure="configure",cn.Write="write",cn.Read="read",cn.ReadConfigure="read,configure",cn.ReadWrite="read,write",cn.All="read,write,configure",(pn=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",pn.CreateTable="CreateTable",pn.CreateLayer="CreateLayer",pn.CreateProject="CreateProject",pn.MaxFeaturesInOneTable="MaxFeaturesInOneTable",pn.MaxObjectsToExport="MaxObjectsToExport",pn.MaxUploadContentSize="MaxUploadContentSize",(hn=exports.ReferenceJoinType||(exports.ReferenceJoinType={})).OneToMany="OneToMany",hn.OneToOne="OneToOne",hn.Intersect="Intersect",hn.RightJoin="RightJoin",hn.FullJoin="FullJoin",hn.CrossJoin="CrossJoin",(yn=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",yn.Table="table",yn.Layer="layer",yn.Project="project",yn.File="file",yn.Feature="feature",yn.Tag="tag",(fn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",fn.Layer="layers",fn.Project="projects",(vn=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",vn.Scheduled="Scheduled",vn.Planning="Planning",vn.Executing="Executing",vn.Completed="Completed",vn.Failed="Failed",vn.Canceled="Canceled",vn.Timeout="Timeout",(dn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",dn.PreserveTopology="PreserveTopology",dn.VW="VW",(kn=exports.StringSubType||(exports.StringSubType={})).None="None",kn.Image="Image",kn.PkkCode="PkkCode",kn.Attachments="Attachments",(gn=exports.TaskGroup||(exports.TaskGroup={})).My="my",gn.All="all",(mn=exports.TextAlignment||(exports.TextAlignment={})).Right="right",mn.Left="left",mn.Center="center",mn.Justified="justified",(bn=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",bn.Bottom="bottom",bn.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return r.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return r.TimeoutError}}),exports.Account=it,exports.AccountPreview=ut,exports.Api=Dt,exports.BulkOperations=A,exports.Cameras=W,exports.ClientSettings=ht,exports.EvergisDynamicLayer=Mt,exports.EvergisTileLayer=Ot,exports.External=ct,exports.Feedback=Pt,exports.FileUpload=V,exports.Filters=Q,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=$e,exports.Geocode=Je,exports.HttpClient=S,exports.IceRouter=xt,exports.Import=X,exports.Layers=Re,exports.LayersManager=qt,exports.Names=bt,exports.Namespace=tt,exports.Notification=$,exports.NotificationEvent=ee,exports.PortalSettings=yt,exports.Projects=De,exports.ResourceCatalog=Ke,exports.Resources=_e,exports.Scheduler=ne,exports.Security=G,exports.SpatialProcessor=Ht,exports.Statistic=jt,exports.Styles=We,exports.Tables=Ne,exports.Tools=Ye,exports.VectorTiles=Ct,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=vt,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=mt,exports.isEvergisDynamicLayer=function(e){return e instanceof Mt},exports.isEvergisTileLayer=function(e){return e instanceof Ot},exports.isFeatureLayer=function(e){return e instanceof h.FeatureLayer},exports.isHTTPError=e=>dt(e)&&"http"===e.type,exports.isHandledError=dt,exports.isLayer=gt,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Be,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=je,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=R,exports.unique=Oe;
2
2
  //# sourceMappingURL=api.cjs.production.min.js.map