@evergis/api 3.0.213 → 3.0.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Api.d.ts +3 -5
- package/dist/__generated__/AccountService.d.ts +2 -2
- package/dist/__generated__/DataSourceService.d.ts +68 -2
- package/dist/__generated__/EqlService.d.ts +12 -1
- package/dist/__generated__/LayersService.d.ts +2 -2
- package/dist/__generated__/RemoteTaskManagerService.d.ts +262 -0
- package/dist/__generated__/StatisticService.d.ts +2 -2
- package/dist/__generated__/TablesService.d.ts +2 -2
- package/dist/__generated__/WmsServerService.d.ts +2 -2
- package/dist/__generated__/data-contracts.d.ts +528 -459
- package/dist/api.cjs.development.js +576 -857
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +639 -890
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/services/RemoteTaskManager.d.ts +3 -0
- package/dist/services/Statistic.d.ts +4 -2
- package/dist/services/index.d.ts +1 -1
- package/dist/utils/errorHandler.d.ts +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/package.json +2 -2
- package/dist/SpatialProcessor.d.ts +0 -30
- package/dist/__generated__/SchedulerService.d.ts +0 -207
- package/dist/layers/EvergisDynamicLayer.d.ts +0 -28
- package/dist/layers/EvergisTileLayer.d.ts +0 -18
- package/dist/layers/LayersManager.d.ts +0 -11
- package/dist/layers/index.d.ts +0 -3
- package/dist/services/Scheduler.d.ts +0 -20
- package/dist/types/EvergisLayer.d.ts +0 -6
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/guards.d.ts +0 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,s=require("@microsoft/signalr"),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 S(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}function T(){return(T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=S(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 j=function(){function e(t){var n;void 0===t&&(t={}),y(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return v(e,[{key:"extend",value:function(e){var t;this.ky=r.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 L=v((function e(t){y(this,e),this.http=t})),C=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getDataSourcesList",value:function(e){return this.http.get("/ds",e).json()}},{key:"createDataSource",value:function(e){return this.http.post("/ds",e).then(()=>{})}},{key:"updateDataSource",value:function(e){return this.http.patch("/ds",e).then(()=>{})}},{key:"getDataSource",value:function(e){return this.http.get("/ds/"+e).json()}},{key:"removeDataSource",value:function(e){return this.http.delete("/ds/"+e,null).then(()=>{})}},{key:"testConnection",value:function(e){return this.http.post("/ds/testConnection",e).json()}}]),n}(),E=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),U=function(e){k(n,L);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 F=["taskId","layerName"];let N=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"searchResultDcGetSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=m(e,F);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult",value:function(e){return this.http.get("/search/"+e).json()}}]),n}(),D=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getParents",value:function(e){return this.http.get("/resources/"+e+"/parents").json()}},{key:"getTags",value:function(e){return this.http.get("/resources/tags",e).json()}},{key:"putTags",value:function(e,t){return this.http.put("/resources/"+e+"/tags",t).json()}},{key:"postGetAll",value:function(e,t){return this.http.post("/resources",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"patchResource",value:function(e,t){return this.http.patch("/resources/"+e,t).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.post("/resources/file",R(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions1",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).then(()=>{})}},{key:"setPermissions",value:function(e){return this.http.put("/resources/permissions",e).then(()=>{})}},{key:"downloadFile",value:function(e){return this.http.get("/resources/"+e+"/download").blob()}},{key:"cleanResources",value:function(){return this.http.post("/resources/clean",null).then(()=>{})}}]),n}();var A;(A=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",A.Unauthorized="Unauthorized",A.SessionClosed="SessionClosed";let O=function(e){k(n,L);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,t){return this.http.post("/account/login",t,e).json()}},{key:"refreshToken",value:function(e){return this.http.post("/account/refresh-token",e).json()}},{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).json()}},{key:"registerClient",value:function(e){return this.http.post("/account/oauth2/client",e).json()}},{key:"unbindClient",value:function(e){return this.http.delete("/account/oauth2/client/"+e,null).then(()=>{})}},{key:"token",value:function(e){return this.http.post("/account/oauth2/token",e).json()}},{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 B=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,M=e=>{if(e){const t=B();localStorage.setItem("@evergis/user-info",JSON.stringify(d({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let _=function(e){k(n,O);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:async function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r=!1),e){const s=await T(g(n.prototype),"authenticate",this).call(this,t,e);s&&r&&(window.localStorage.setItem("evergis-jwt-token",s.token),window.localStorage.setItem("evergis-refresh-token",s.refreshToken))}}},{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(){window.localStorage.getItem("evergis-jwt-token")&&(window.localStorage.removeItem("evergis-jwt-token"),window.localStorage.removeItem("evergis-refresh-token")),await this.revokeToken(),M(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await T(g(n.prototype),"updateUser",this).call(this,d({username:this.username},e)),M(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=B();return e&&(this.userInfo=e),e}}]),n}();const q=["username"];let G=function(e){k(n,L);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,q);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}(),H=function(e){k(n,G);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=B();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});M({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();M({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),M({profile_photo:"",has_profile_photo:!1})}}]),n}(),W=function(e){k(n,L);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}(),V=function(e){k(n,W);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const z=["cameraId"],Q=["cameraId"],J=["cameraId"],K=["cameraId"],X=["cameraId"],Y=["cameraId"];let Z=function(e){k(n,L);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,z);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=m(e,Q);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=m(e,J);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=m(e,K);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,X);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=m(e,Y);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),$=function(e){k(n,Z);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ee=function(e){k(n,L);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}(),te=function(e){k(n,ee);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}(),ne=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getQueryResult",value:function(e){return this.http.post("/eql/query",e).json()}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}}]),n}(),re=function(e){k(n,ne);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),se=function(e){k(n,L);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}(),ie=function(e){k(n,se);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}(),oe=function(e){k(n,L);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}(),ae=function(e){k(n,oe);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}(),ue=function(e){k(n,L);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}(),le=function(e){k(n,ue);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}(),ce=function(e){k(n,L);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}(),pe=function(e){k(n,ce);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),he=function(e){k(n,L);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}(),ye=function(e){k(n,he);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const fe=["providerName"],ve=["providerName"],de=["providerName"];let ke=function(e){k(n,L);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,fe);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=m(e,ve);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=m(e,de);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),ge=function(e){k(n,ke);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}(),me=function(e){k(n,L);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}(),be=function(e){k(n,me);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),we=function(e){k(n,L);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:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",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}(),xe=function(e){k(n,we);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const Se=["name"],Te=["name"],je=["name"],Pe=["name","id"],Ie=["name","id"],Re=["name","id"],Le=["name","x","y","z"],Ce=["name"],Ee=["name"],Ue=["name"],Fe=["name"],Ne=["name"],De=["name"],Ae=["name"],Oe=["name"],Be=["name"],Me=["name"],_e=["name"],qe=["layerName"],Ge=["name","id"];let He=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getBulkFeatures",value:function(e){return this.http.post("/bulk/layers/features/query",e).json()}},{key:"getBulkExtents",value:function(e,t){return this.http.post("/bulk/layers/extent",t,e).json()}},{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:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=m(e,Se);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=m(e,Te);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,je);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=m(e,Pe);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,Ie);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,Re);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,Ee);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=m(e,Ue);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=m(e,Fe);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=m(e,Ne);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=m(e,De);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=m(e,Ae);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=m(e,Oe);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=m(e,Be);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,_e);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).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,qe);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=m(e,Ge);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:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").then(()=>{})}},{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 We(e){return(await Promise.all(e.map(e=>e.catch(e=>Ve(e)?e:new Error(e))))).filter(ze)}function Ve(e){return e instanceof Error}function ze(e){return!Ve(e)}const Qe=["remote"],Je=["remote"];let Ke=function(e){k(n,He);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayerInfos",value:function(e){return We(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return We(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,Qe);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"updateTileLayer",value:function(e){let{remote:t}=e,n=m(e,Je);return t?this.updateRemoteTileService(n.name,n):this.updateLocalTileService(n.name,n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findMany",value:function(e,t){return this.getLayersInfo({layerNames:e,projectNames:t})}},{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:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var Xe;(Xe=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",Xe.HTTP_CLIENT="client",Xe.HTTP_SERVER="server",Xe.UNKNOWN="unknown";const Ye=e=>e instanceof n.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),Ze=e=>e&&e.type&&e.reason;function $e(e){return function(t){return!!t.type&&e.includes(t.type)}}const et=$e(["PostgresLayerService","PostgresTileLayerService","QueryLayerService"]);function tt(e){return"string"==typeof e}const nt=e=>e===exports.UrlPath.Presentation?exports.UrlPath.Base:e;function rt(e,t,n){return n.indexOf(e)===t}const st=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let it=function(){function e(t){let{account:n}=t;y(this,e),this.account=n}return v(e,[{key:"createId",value:function(){return st()}},{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}(),ot=function(e){k(n,L);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}(),at=function(e){k(n,ot);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ut=function(e){k(n,L);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 lt;(lt=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",lt.Connected="Connected",lt.Break="Break",lt.Lost="Lost",lt.SessionClosed="SessionClosed";let ct=function(e){k(r,ut);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 pt(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 pt(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.api.isPresentation||!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}(),pt=v((function e(t){y(this,e),this.data=t})),ht=function(e){k(n,ee);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}(),yt=function(e){k(n,L);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}(),ft=function(e){k(n,yt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const vt=["name"];let dt=function(e){k(n,L);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:"getProjectEnvelope",value:function(e){let{name:t}=e,n=m(e,vt);return this.http.get("/projects/"+t+"/extent",n).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}(),kt=function(e){k(n,dt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectInfos",value:function(e){return We(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return We(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}(),gt=function(e){k(n,L);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}(),mt=function(e){k(n,gt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();var bt;(bt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",bt.Table="Table",bt.Project="Project";let wt=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(rt)),layers:await this.layers.getLayerInfos(s.filter(rt))}}},{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(tt)}}]),e}(),xt=function(e){k(n,L);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}(),St=function(e){k(n,xt);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}(),Tt=function(e){k(n,L);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}(),jt=function(e){k(n,Tt);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}(),Pt=function(e){k(n,L);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:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),It=function(e){k(n,Pt);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:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),Rt=function(e){k(n,L);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}(),Lt=function(e){k(n,Rt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const Ct=["name"],Et=["name"],Ut=["name"],Ft=["name"];let Nt=function(e){k(n,L);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,Ct);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,Et);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=m(e,Ut);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=m(e,Ft);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:"createViewFromQueryLayer",value:function(e){return this.http.post("/tables/fromLayer",e).json()}},{key:"createViewFromQuery",value:function(e){return this.http.post("/tables/fromQuery",e).json()}},{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}(),Dt=function(e){k(n,Nt);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableInfos",value:function(e){return We(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}(),At=function(e){k(n,L);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ot=function(e){k(n,At);var t=x(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const Bt=["name","z","x","y"];let Mt=function(e){k(n,L);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,Bt);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",i).then(()=>{})}}]),n}(),_t=function(e){k(n,Mt);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}();var qt;(qt=exports.UrlPath||(exports.UrlPath={})).Base="/map",qt.Shared="/shared",qt.Presentation="/presentation",qt.Portal="/portal";const Gt={401:exports.ApiEvent.Unauthorized},Ht=Object.values(exports.UrlPath),Wt=Ht[0];let Vt=function(e){k(i,t.EventEmitter);var r=x(i);function i(e){var t,o;let{url:a,wsUrl:u,wsKeepAlive:l,snappingHubUrl:c,http:p,urlPath:h,httpOptions:f}=e;y(this,i),o=r.call(this);const{hooks:v}=f||{};return o.http=p||new j(d({prefixUrl:a,timeout:!1},f||{},{hooks:d({},v||{},{beforeRequest:[e=>{const t=window.localStorage.getItem("evergis-jwt-token");var n;t&&(null==(n=e.headers)||n.set("Authorization","Bearer "+(t||"")))},...null!=(t=null==v?void 0:v.beforeRequest)?t:[]],afterResponse:[e=>{const t=Gt[e.status];return t&&o.emit(t,Ye(new n.HTTPError(e))),e},...(null==v?void 0:v.afterResponse)||[]]})})),o.url=a,o.wsUrl=u||a,o.urlPath=h||o.defineUrlPath(),o.layers=new Ke(o.http),o.tables=new Dt(o.http),o.projects=new kt(o.http),o.resources=new wt(o.projects,o.layers,o.tables),o.styles=new Lt(o.http),o.account=new _(o.http),o.accountPreview=new H(o.http,o.account),o.bulk=new V(o.http),o.security=new jt(o.http,o.account),o.notification=new ct(o.http,b(o),l),o.scheduler=new St(o.http),o.file=new le(o.http),o.filters=new pe(o.http),o.import=new xe(o.http),o.geocode=new ge(o.http),o.cameras=new $(o.http),o.print=new ft(o.http),o.tools=new Ot(o.http),o.resourceCatalog=new mt(o.http),o.general=new ye(o.http),o.namespace=new at(o.http),o.external=new ie(o.http),o.clientSettings=new te(o.http),o.portalSettings=new ht(o.http),o.iceRouter=new be(o.http),o.statistic=new It(o.http),o.feedback=new ae(o.http),o.vectorTiles=new _t(o.http),o.universalSearch=new N(o.http),o.spatialReference=new U(o.http),o.eql=new re(o.http),o.catalog=new D(o.http),o.queryToken=new E(o.http),o.dataSource=new C(o.http),o.names=new it({account:o.account}),o.snappingHub=c?(new s.HubConnectionBuilder).withUrl(c,{withCredentials:!0,skipNegotiation:!0,transport:s.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,o}return v(i,[{key:"init",value:async function(e){let{authParams:t,authQueryParams:n,connectWs:r,initScheduler:s,fetchSettings:i,fetchUser:o,useJwt:a}=e;try{await this.account.login(t,n,a),o&&await this.account.fetchCurrentUser(),r&&await this.connectWs(),s&&await this.initScheduler(),i&&await this.clientSettings.fetchClientSettings({urlPath:nt(this.urlPath)}),await this.notification.subscribe("service_update")}catch(e){throw Ye(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 Ye(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!==s.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&&Ht.includes(t)?t:Wt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}},{key:"isPresentation",get:function(){return this.urlPath===exports.UrlPath.Presentation||"8082"===window.location.port}}]),i}(),zt=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 Qt=["name","style","condition","dataFilterId","crs"];let Jt=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,Qt);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 Kt={RemoteTileService:zt,LocalTileService:zt,PostgresLayerService:Jt,StyledFeatureLayer:Jt,CompositeService:null};let Xt=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(Kt).includes(e)))(n))return;const r=Kt[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 Yt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(Yt||(Yt={}));let Zt=function(e){k(n,Vt);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 Xt(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,Yt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,Yt.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($t);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 $t=e=>void 0!==e;var en,tn,nn,rn,sn,on,an,un,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn,bn,wn,xn,Sn,Tn,jn,Pn,In,Rn,Ln,Cn,En,Un,Fn,Nn,Dn,An,On;(en=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",en.Array="Array",en.Min="Min",en.Max="Max",en.Avg="Avg",en.Sum="Sum",en.Extent="Extent",en.H3="H3",en.Count="Count",en.TotalCount="TotalCount",en.DistinctCount="DistinctCount",en.First="First",en.Last="Last",en.Median="Median",en.Mod="Mod",en.StdDeviation="StdDeviation",en.SumOfProduct="SumOfProduct",en.OnlyValue="OnlyValue",en.WeightedAvg="WeightedAvg",en.DensityIndicators="DensityIndicators",en.DividedSum="DividedSum",(tn=exports.AttributeIconType||(exports.AttributeIconType={})).Unknown="Unknown",tn.Icon="Icon",tn.PNG="PNG",tn.SVG="SVG",(nn=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",nn.SelectFromHandBook="SelectFromHandBook",nn.SelectFromRange="SelectFromRange",nn.ViewHandBook="ViewHandBook",(rn=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",rn.String="String",rn.Int32="Int32",rn.Int64="Int64",rn.Double="Double",rn.DateTime="DateTime",rn.Boolean="Boolean",rn.Point="Point",rn.Polyline="Polyline",rn.MultiPolygon="MultiPolygon",rn.Multipoint="Multipoint",rn.H3Index="H3Index",rn.Json="Json",(sn=exports.AuthorizationGrant||(exports.AuthorizationGrant={})).AuthorizationCode="authorization_code",sn.RefreshToken="refresh_token",(on=exports.CatalogResourceType||(exports.CatalogResourceType={})).None="None",on.Map="Map",on.Layer="Layer",on.Table="Table",on.File="File",on.TaskPrototype="TaskPrototype",on.DataSource="DataSource",(an=exports.ClassificationType||(exports.ClassificationType={})).None="none",an.NaturalBreaks="naturalBreaks",an.EqualInterval="equalInterval",an.Quantile="quantile",an.Unique="unique",(un=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",un.DateTime="dateTime",un.Text="text",(ln=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",ln.SerializeError="SerializeError",ln.InvalidDataService="InvalidDataService",ln.InvalidConfiguration="InvalidConfiguration",ln.InvalidDataServiceName="InvalidDataServiceName",ln.InvalidTableName="InvalidTableName",ln.InvalidLayerName="InvalidLayerName",ln.ResourceNotFound="ResourceNotFound",ln.InvalidCondition="InvalidCondition",ln.InvalidAttributes="InvalidAttributes",ln.InvalidIdAttribute="InvalidIdAttribute",ln.InvalidGeometryAttribute="InvalidGeometryAttribute",ln.InvalidGeometryAttributeType="InvalidGeometryAttributeType",ln.InvalidColumnName="InvalidColumnName",ln.InvalidIdColumnSettings="InvalidIdColumnSettings",ln.ColumnNotExistsInTable="ColumnNotExistsInTable",ln.InvalidStyle="InvalidStyle",ln.InvalidLayerType="InvalidLayerType",ln.ColumnLoadingError="ColumnLoadingError",ln.InvalidAttributeFormat="InvalidAttributeFormat",ln.DataSourceNotFound="DataSourceNotFound",ln.DuplicateColumns="DuplicateColumns",ln.DuplicateAttributes="DuplicateAttributes",ln.TableWithoutColumns="TableWithoutColumns",ln.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(cn=exports.DataSourceType||(exports.DataSourceType={})).Postgres="Postgres",cn.Trino="Trino",cn.S3="S3",cn.GisServer="GisServer",(pn=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",pn.ResourceNotFound="ResourceNotFound",pn.InternalError="InternalError",pn.BadRequest="BadRequest",pn.DuplicateContent="DuplicateContent",(hn=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",hn.LimitError="LimitError",hn.ValidationError="ValidationError",hn.JwtExpired="JwtExpired",hn.TokenInvalid="TokenInvalid",hn.RefreshTokenExpired="RefreshTokenExpired",hn.RefreshTokenInvalid="RefreshTokenInvalid",hn.CreateUserFailed="CreateUserFailed",hn.SetUserPasswordFailed="SetUserPasswordFailed",hn.SetUserRoleFailed="SetUserRoleFailed",hn.UpdateUserFailed="UpdateUserFailed",hn.RemoveUserFailed="RemoveUserFailed",hn.CreateRoleFailed="CreateRoleFailed",hn.UpdateRoleFailed="UpdateRoleFailed",hn.RemoveUserRoleFailed="RemoveUserRoleFailed",hn.ChangeActiveStateFailed="ChangeActiveStateFailed",hn.RemoveRoleFailed="RemoveRoleFailed",hn.UserNotFound="UserNotFound",hn.RoleNotFound="RoleNotFound",hn.EmailNotConfirmed="EmailNotConfirmed",hn.DuplicateEmailError="DuplicateEmailError",hn.InvalidPassword="InvalidPassword",hn.RoleExists="RoleExists",hn.UserExists="UserExists",hn.UserLockedError="UserLockedError",hn.InvalidEmail="InvalidEmail",hn.InvalidUsername="InvalidUsername",hn.Unauthorized="Unauthorized",hn.EmailNotChanged="EmailNotChanged",hn.EmailNotSet="EmailNotSet",(yn=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",yn.GeometricFeature="GeometricFeature",(fn=exports.FontStyle||(exports.FontStyle={})).Normal="normal",fn.Oblique="oblique",fn.Italic="italic",(vn=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",vn.ExtraLight="ExtraLight",vn.Light="Light",vn.SemiLight="SemiLight",vn.Normal="Normal",vn.Medium="Medium",vn.DemiBold="DemiBold",vn.Bold="Bold",vn.ExtraBold="ExtraBold",vn.Black="Black",vn.ExtraBlack="ExtraBlack",(dn=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",dn.Point="point",dn.Polyline="polyline",dn.Polygon="multipolygon",dn.Envelope="envelope",dn.Multipoint="multipoint",(kn=exports.Group||(exports.Group={})).My="my",kn.Role="role",kn.Public="public",kn.All="all",(gn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",gn.Square="Square",gn.Round="Round",gn.Triangle="Triangle",(mn=exports.LineEndingType||(exports.LineEndingType={})).None="none",mn.Arrow="arrow",mn.FilledArrow="filledArrow",mn.Square="square",mn.FilledSquare="filledSquare",mn.Circle="circle",mn.FilledCircle="filledCircle",mn.Diamond="diamond",mn.FilledDiamond="filledDiamond",mn.RoundSquare="roundSquare",mn.FilledRoundSquare="filledRoundSquare",mn.Svg="svg",(bn=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",bn.Bevel="Bevel",bn.Round="Round",(wn=exports.Operation||(exports.Operation={})).Unknown="Unknown",wn.Union="union",wn.Intersection="intersection",wn.Subtraction="subtraction",wn.SymDifference="symDifference",(xn=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",xn.Shared="Shared",xn.Public="Public",(Sn=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",Sn.TMS="tms",(Tn=exports.Permissions||(exports.Permissions={})).None="none",Tn.Configure="configure",Tn.Write="write",Tn.Read="read",Tn.ReadConfigure="read,configure",Tn.ReadWrite="read,write",Tn.All="read,write,configure",(jn=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",jn.CreateTable="CreateTable",jn.CreateLayer="CreateLayer",jn.CreateProject="CreateProject",jn.MaxFeaturesInOneTable="MaxFeaturesInOneTable",jn.MaxObjectsToExport="MaxObjectsToExport",jn.MaxUploadContentSize="MaxUploadContentSize",(Pn=exports.Quality||(exports.Quality={})).Low="Low",Pn.Medium="Medium",Pn.High="High",(In=exports.ResourceSubTypeFilter||(exports.ResourceSubTypeFilter={})).RemoteTileService="RemoteTileService",In.ProxyService="ProxyService",In.PostgresLayerService="PostgresLayerService",In.QueryLayerService="QueryLayerService",In.TileCatalogTable="TileCatalogTable",(Rn=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",Rn.Table="table",Rn.Layer="layer",Rn.Project="project",Rn.File="file",Rn.Feature="feature",Rn.Tag="tag",(Ln=exports.ResourceTypeFilter||(exports.ResourceTypeFilter={})).Map="Map",Ln.Layer="Layer",Ln.Table="Table",Ln.RasterCatalog="RasterCatalog",Ln.ProxyService="ProxyService",Ln.RemoteTileService="RemoteTileService",Ln.File="File",Ln.DataSource="DataSource",(Cn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",Cn.Layer="layers",Cn.Project="projects",(En=exports.ResponseType||(exports.ResponseType={})).Code="code",En.Token="token",(Un=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",Un.Scheduled="Scheduled",Un.Planning="Planning",Un.Executing="Executing",Un.Completed="Completed",Un.Failed="Failed",Un.Canceled="Canceled",Un.Timeout="Timeout",(Fn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",Fn.PreserveTopology="PreserveTopology",Fn.VW="VW",(Nn=exports.StringSubType||(exports.StringSubType={})).None="None",Nn.Image="Image",Nn.PkkCode="PkkCode",Nn.Attachments="Attachments",(Dn=exports.TaskGroup||(exports.TaskGroup={})).My="my",Dn.All="all",(An=exports.TextAlignment||(exports.TextAlignment={})).Right="right",An.Left="left",An.Center="center",An.Justified="justified",(On=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",On.Bottom="bottom",On.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=_,exports.AccountPreview=H,exports.Api=Vt,exports.BulkOperations=V,exports.Cameras=$,exports.ClientSettings=te,exports.Eql=re,exports.EvergisDynamicLayer=Jt,exports.EvergisTileLayer=zt,exports.External=ie,exports.Feedback=ae,exports.FileUpload=le,exports.Filters=pe,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=ye,exports.Geocode=ge,exports.HttpClient=j,exports.IceRouter=be,exports.Import=xe,exports.Layers=Ke,exports.LayersManager=Xt,exports.Names=it,exports.Namespace=at,exports.Notification=ct,exports.NotificationEvent=pt,exports.PortalSettings=ht,exports.Print=ft,exports.Projects=kt,exports.ResourceCatalog=mt,exports.Resources=wt,exports.STORAGE_REFRESH_TOKEN_KEY="evergis-refresh-token",exports.STORAGE_TOKEN_KEY="evergis-jwt-token",exports.Scheduler=St,exports.Security=jt,exports.SpatialProcessor=Zt,exports.Statistic=It,exports.Styles=Lt,exports.Tables=Dt,exports.Tools=Ot,exports.VectorTiles=_t,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Ye,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=st,exports.getFetchingUrlPath=nt,exports.isEvergisDynamicLayer=function(e){return e instanceof Jt},exports.isEvergisTileLayer=function(e){return e instanceof zt},exports.isFeatureLayer=function(e){return e instanceof h.FeatureLayer},exports.isHTTPError=e=>Ze(e)&&"http"===e.type,exports.isHandledError=Ze,exports.isLayer=et,exports.isProjectContentItems=function(e){return null!=e},exports.isString=tt,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.parseJwt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(e=>"%"+"00".concat(e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(n)},exports.promiseAllIgnoreErrors=We,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=rt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,s=require("@microsoft/signalr"),o=require("query-string"),i=require("nanoid");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 l(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(){return(c=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 p(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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if(null==e)return{};var n,r,s={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(s[n]=e[n]);return s}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(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 f(e)}function d(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=h(e);if(t){var s=h(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return v(this,n)}}function k(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}function g(){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=k(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 m=function(){function e(t){var n;void 0===t&&(t={}),u(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return l(e,[{key:"extend",value:function(e){var t;this.ky=r.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:x(t)})}},{key:"post",value:function(e,t,n){const r=b(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=b(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=b(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=b(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+x(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function b(e,t){const n={searchParams:x(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 x(e){return void 0===e&&(e={}),o.stringify(e,{arrayFormat:"comma"})}function S(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let j=l((function e(t){u(this,e),this.http=t})),w=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"createArcGisDataSource",value:function(e){return this.http.post("/ds/arcgis",e).then(()=>{})}},{key:"updateArcGisDataSource",value:function(e){return this.http.patch("/ds/arcgis",e).then(()=>{})}},{key:"getDataSourcesList",value:function(e){return this.http.get("/ds",e).json()}},{key:"createDataSource",value:function(e){return this.http.post("/ds",e).then(()=>{})}},{key:"updateDataSource",value:function(e){return this.http.patch("/ds",e).then(()=>{})}},{key:"getDataSource",value:function(e){return this.http.get("/ds/"+e).json()}},{key:"removeDataSource",value:function(e){return this.http.delete("/ds/"+e,null).then(()=>{})}},{key:"testConnection",value:function(e){return this.http.post("/ds/testConnection",e).json()}},{key:"createS3DataSource",value:function(e){return this.http.post("/ds/s3",e).then(()=>{})}},{key:"updateS3DataSource",value:function(e){return this.http.patch("/ds/s3",e).then(()=>{})}},{key:"createArcGisDataSource1",value:function(e){return this.http.post("/ds/wms",e).then(()=>{})}},{key:"updateArcGisDataSource1",value:function(e){return this.http.patch("/ds/wms",e).then(()=>{})}}]),n}(),T=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),P=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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 R=["taskId","layerName"];let I=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"searchResultDcGetSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=y(e,R);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult",value:function(e){return this.http.get("/search/"+e).json()}}]),n}(),C=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getParents",value:function(e){return this.http.get("/resources/"+e+"/parents").json()}},{key:"getTags",value:function(e){return this.http.get("/resources/tags",e).json()}},{key:"putTags",value:function(e,t){return this.http.put("/resources/"+e+"/tags",t).json()}},{key:"postGetAll",value:function(e,t){return this.http.post("/resources",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"patchResource",value:function(e,t){return this.http.patch("/resources/"+e,t).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.post("/resources/file",S(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions1",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).then(()=>{})}},{key:"setPermissions",value:function(e){return this.http.put("/resources/permissions",e).then(()=>{})}},{key:"downloadFile",value:function(e){return this.http.get("/resources/"+e+"/download").blob()}},{key:"cleanResources",value:function(){return this.http.post("/resources/clean",null).then(()=>{})}}]),n}();var L;(L=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",L.Unauthorized="Unauthorized",L.SessionClosed="SessionClosed";let E=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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",S(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",S(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",S(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,t){return this.http.post("/account/login",t,e).json()}},{key:"refreshToken",value:function(e){return this.http.post("/account/refresh-token",e).json()}},{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).json()}},{key:"registerClient",value:function(e){return this.http.post("/account/oauth2/client",e).json()}},{key:"unbindClient",value:function(e){return this.http.delete("/account/oauth2/client/"+e,null).then(()=>{})}},{key:"token",value:function(e){return this.http.post("/account/oauth2/token",e).json()}},{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 F=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,U=e=>{if(e){const t=F();localStorage.setItem("@evergis/user-info",JSON.stringify(c({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let A=function(e){p(n,E);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"login",value:async function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r=!1),e){const s=await g(h(n.prototype),"authenticate",this).call(this,t,e);s&&r&&(window.localStorage.setItem("evergis-jwt-token",s.token),window.localStorage.setItem("evergis-refresh-token",s.refreshToken))}}},{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(){window.localStorage.getItem("evergis-jwt-token")&&(window.localStorage.removeItem("evergis-jwt-token"),window.localStorage.removeItem("evergis-refresh-token")),await this.revokeToken(),U(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await g(h(n.prototype),"updateUser",this).call(this,c({username:this.username},e)),U(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=F();return e&&(this.userInfo=e),e}}]),n}();const D=["username"];let N=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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=y(e,D);return this.http.post("/account/user/preview/"+n,S(t),r).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),O=function(e){p(n,N);var t=d(n);function n(e,r){var s;return u(this,n),(s=t.call(this,e)).userInfo=r,s}return l(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=F();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(c({username:this.username},t),{file:e});U({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();U({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),U({profile_photo:"",has_profile_photo:!1})}}]),n}(),B=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),M=function(e){p(n,B);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const _=["cameraId"],q=["cameraId"],G=["cameraId"],W=["cameraId"],H=["cameraId"],V=["cameraId"];let z=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,_);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=y(e,q);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=y(e,G);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=y(e,W);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=y(e,H);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=y(e,V);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),Q=function(e){p(n,z);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),J=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),K=function(e){p(n,J);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return l(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}(),X=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getQueryResult",value:function(e){return this.http.post("/eql/query",e).json()}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}},{key:"getAvailiableLayerParameters",value:function(e){return this.http.get("/eql/getAvailiableParams",e).json()}}]),n}(),Y=function(e){p(n,X);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),Z=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),$=function(e){p(n,Z);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),ee=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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",S(t),e).json()}}]),n}(),te=function(e){p(n,ee);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),ne=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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",S(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}(),re=function(e){p(n,ne);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),se=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),oe=function(e){p(n,se);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),ie=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),ue=function(e){p(n,ie);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const ae=["providerName"],le=["providerName"],ce=["providerName"];let pe=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=y(e,ae);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=y(e,le);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=y(e,ce);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),he=function(e){p(n,pe);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"geocode2Gis",value:function(e){return this.geocode(c({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(c({providerName:"geocode2gis"},e))}}]),n}(),ye=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),fe=function(e){p(n,ye);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),ve=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",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}(),de=function(e){p(n,ve);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const ke=["name"],ge=["name"],me=["name"],be=["name","id"],xe=["name","id"],Se=["name","id"],je=["name","x","y","z"],we=["name"],Te=["name"],Pe=["name"],Re=["name"],Ie=["name"],Ce=["name"],Le=["name"],Ee=["name"],Fe=["name"],Ue=["name"],Ae=["name"],De=["layerName"],Ne=["name","id"];let Oe=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getBulkFeatures",value:function(e){return this.http.post("/bulk/layers/features/query",e).json()}},{key:"getBulkExtents",value:function(e,t){return this.http.post("/bulk/layers/extent",t,e).json()}},{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:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=y(e,ke);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=y(e,ge);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=y(e,me);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=y(e,be);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=y(e,xe);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=y(e,Se);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,o=y(e,je);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,o)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=y(e,we);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=y(e,Te);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=y(e,Pe);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=y(e,Re);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=y(e,Ie);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=y(e,Ce);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=y(e,Le);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=y(e,Ee);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=y(e,Fe);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=y(e,Ue);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=y(e,Ae);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).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=y(e,De);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=y(e,Ne);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:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").then(()=>{})}},{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",S(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 Be(e){return(await Promise.all(e.map(e=>e.catch(e=>Me(e)?e:new Error(e))))).filter(_e)}function Me(e){return e instanceof Error}function _e(e){return!Me(e)}const qe=["remote"],Ge=["remote"];let We=function(e){p(n,Oe);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getLayerInfos",value:function(e){return Be(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return Be(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(c({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=y(e,qe);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"updateTileLayer",value:function(e){let{remote:t}=e,n=y(e,Ge);return t?this.updateRemoteTileService(n.name,n):this.updateLocalTileService(n.name,n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findMany",value:function(e,t){return this.getLayersInfo({layerNames:e,projectNames:t})}},{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:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var He;(He=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",He.HTTP_CLIENT="client",He.HTTP_SERVER="server",He.UNKNOWN="unknown";const Ve=e=>e instanceof n.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),ze=e=>e&&e.type&&e.reason;function Qe(e){return"string"==typeof e}const Je=e=>e===exports.UrlPath.Presentation?exports.UrlPath.Base:e;function Ke(e,t,n){return n.indexOf(e)===t}const Xe=i.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let Ye=function(){function e(t){let{account:n}=t;u(this,e),this.account=n}return l(e,[{key:"createId",value:function(){return Xe()}},{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(c({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}(),Ze=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),$e=function(e){p(n,Ze);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),et=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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 tt;(tt=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",tt.Connected="Connected",tt.Break="Break",tt.Lost="Lost",tt.SessionClosed="SessionClosed";let nt=function(e){p(r,et);var n=d(r);function r(e,s,o){var i;return void 0===o&&(o=!1),u(this,r),(i=n.call(this,e)).api=s,i.MAX_WS_RECONNECT_TRIES=10,i.keepAlive=!1,i.reconnectTries=0,i.subscriptions=[],i._connectStatus=exports.ConnectionStatus.Initialized,i.onWsConnected=()=>{i.connectStatus=exports.ConnectionStatus.Connected,i.keepAlive&&(i.keepAliveTimeout=setInterval(()=>{i.ws&&i.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},i.onWsClosed=e=>{4001===e.code||4002===e.code?i.connectStatus=exports.ConnectionStatus.SessionClosed:i.reconnectTries<i.MAX_WS_RECONNECT_TRIES?(i.connectStatus=exports.ConnectionStatus.Break,i.reconnectTries++,i.ws&&(i.ws.onopen=null,i.ws.onclose=null,i.ws.onmessage=null,i.ws=void 0),i.keepAliveTimeout&&clearInterval(i.keepAliveTimeout),setTimeout(()=>{i.connect()},0)):i.connectStatus=exports.ConnectionStatus.Lost},i.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&&i.emitter.emit(e,new rt(n))}},i.emitter=new t.EventEmitter,i.keepAlive=o,i}return l(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new rt(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.api.isPresentation||!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}(),rt=l((function e(t){u(this,e),this.data=t})),st=function(e){p(n,J);var t=d(n);function n(){var e;return u(this,n),(e=t.apply(this,arguments)).config=null,e}return l(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}(),ot=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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",S(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}(),it=function(e){p(n,ot);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const ut=["name"];let at=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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:"getProjectEnvelope",value:function(e){let{name:t}=e,n=y(e,ut);return this.http.get("/projects/"+t+"/extent",n).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",S(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}(),lt=function(e){p(n,at);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getProjectInfos",value:function(e){return Be(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return Be(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}();const ct=["id"];let pt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"cancelTask",value:function(e){return this.http.post("/scheduler/tasks/"+e+"/cancel",null).then(()=>{})}},{key:"startCogCreateTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"cogService_create"}).text()}},{key:"startRasterVrtTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"cogService_vrt"}).text()}},{key:"startNetCdfTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"cogService_netcdf"}).text()}},{key:"startBufferTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"geoService_buffer"}).text()}},{key:"startCopyTableTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"geoService_copy"}).text()}},{key:"startUnionTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"geoService_union"}).text()}},{key:"startOverlayTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"geoService_overlay"}).text()}},{key:"startCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"copyTask"}).text()}},{key:"startAvailableAreaTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"availabilityArea"}).text()}},{key:"startGeocodeTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"geocodeTask"}).text()}},{key:"get",value:function(e){return this.http.get("/scheduler/task/"+e+"/subtasks").then(()=>{})}},{key:"stop",value:function(e){return this.http.post("/scheduler/task/"+e+"/stop",null).then(()=>{})}},{key:"createTaskPrototype",value:function(e){return this.http.post("/scheduler",e).text()}},{key:"getTaskPrototypes",value:function(e){return this.http.get("/scheduler",e).then(()=>{})}},{key:"updateTaskPrototype",value:function(e,t){return this.http.put("/scheduler/"+e,t).then(()=>{})}},{key:"delete",value:function(e){return this.http.delete("/scheduler/"+e,null).then(()=>{})}},{key:"setEnable",value:function(e,t){return this.http.post("/scheduler/"+e+"/enable/"+t,null).then(()=>{})}},{key:"getTasksForPrototype",value:function(e){let{id:t}=e,n=y(e,ct);return this.http.get("/scheduler/"+t+"/tasks",n).then(()=>{})}},{key:"startTask",value:function(e,t){return this.http.post("/scheduler/"+e+"/start/"+t,null).then(()=>{})}},{key:"startTask1",value:function(e){return this.http.post("/scheduler/"+e+"/start",null).then(()=>{})}},{key:"get1",value:function(){return this.http.get("/scheduler/worker").json()}},{key:"post",value:function(e){return this.http.post("/scheduler/worker",e).json()}}]),n}(),ht=function(e){p(n,pt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),yt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),ft=function(e){p(n,yt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();var vt;(vt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",vt.Table="Table",vt.Project="Project";let dt=function(){function e(t,n,r){u(this,e),this.projects=t,this.layers=n,this.tables=r}return l(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(Ke)),layers:await this.layers.getLayerInfos(s.filter(Ke))}}},{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(Qe)}}]),e}(),kt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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}(),gt=function(e){p(n,kt);var t=d(n);function n(e,r){var s;let{username:o,roles:i}=r;return u(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=o,s.ownerRoles=i,s}return l(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),mt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),bt=function(e){p(n,mt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),xt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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",S(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),St=function(e){p(n,xt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const jt=["name"],wt=["name"],Tt=["name"],Pt=["name"];let Rt=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(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=y(e,jt);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=y(e,wt);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=y(e,Tt);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=y(e,Pt);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:"createViewFromQueryLayer",value:function(e){return this.http.post("/tables/fromLayer",e).json()}},{key:"createViewFromQuery",value:function(e){return this.http.post("/tables/fromQuery",e).json()}},{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",S(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}(),It=function(e){p(n,Rt);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getTableInfos",value:function(e){return Be(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}(),Ct=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}(),Lt=function(e){p(n,Ct);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n)}();const Et=["name","z","x","y"];let Ft=function(e){p(n,j);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:s}=e,o=y(e,Et);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",o).then(()=>{})}}]),n}(),Ut=function(e){p(n,Ft);var t=d(n);function n(){return u(this,n),t.apply(this,arguments)}return l(n,[{key:"getVt",value:function(e,t,n,r,s){return this.getVectorTile({name:e,z:t,x:n,y:r,isProject:s})}}]),n}();var At;(At=exports.UrlPath||(exports.UrlPath={})).Base="/map",At.Shared="/shared",At.Presentation="/presentation",At.Portal="/portal";const Dt={401:exports.ApiEvent.Unauthorized},Nt=Object.values(exports.UrlPath),Ot=Nt[0];let Bt=function(e){p(o,t.EventEmitter);var r=d(o);function o(e){var t,i;let{url:a,wsUrl:l,wsKeepAlive:p,snappingHubUrl:h,http:y,urlPath:v,httpOptions:d}=e;u(this,o),i=r.call(this);const{hooks:k}=d||{};return i.http=y||new m(c({prefixUrl:a,timeout:!1,retry:{methods:["get","post","delete"],limit:5,statusCodes:[401]}},d||{},{hooks:c({},k||{},{beforeRequest:[e=>{const t=window.localStorage.getItem("evergis-jwt-token");var n;t&&(null==(n=e.headers)||n.set("Authorization","Bearer "+(t||"")))},...null!=(t=null==k?void 0:k.beforeRequest)?t:[]],beforeRetry:[async e=>{let{request:t,error:r,retryCount:s}=e;if(r instanceof n.HTTPError&&401===r.response.status&&1===s)try{const e=window.localStorage.getItem("evergis-refresh-token");if(e){var o;const n=await i.account.refreshToken({refreshToken:e});n&&(window.localStorage.setItem("evergis-jwt-token",n.token),window.localStorage.setItem("evergis-refresh-token",n.refreshToken)),null==(o=t.headers)||o.set("Authorization","Bearer "+(n.token||""))}}catch(r){throw new Error("Failed to refresh token")}}],afterResponse:[(e,t,r)=>{const s=Dt[r.status];return s&&i.emit(s,Ve(new n.HTTPError(r,e,t))),r},...(null==k?void 0:k.afterResponse)||[]]})})),i.url=a,i.wsUrl=l||a,i.urlPath=v||i.defineUrlPath(),i.layers=new We(i.http),i.tables=new It(i.http),i.projects=new lt(i.http),i.resources=new dt(i.projects,i.layers,i.tables),i.styles=new St(i.http),i.account=new A(i.http),i.accountPreview=new O(i.http,i.account),i.bulk=new M(i.http),i.security=new gt(i.http,i.account),i.notification=new nt(i.http,f(i),p),i.file=new re(i.http),i.filters=new oe(i.http),i.import=new de(i.http),i.geocode=new he(i.http),i.cameras=new Q(i.http),i.print=new it(i.http),i.tools=new Lt(i.http),i.resourceCatalog=new ft(i.http),i.general=new ue(i.http),i.namespace=new $e(i.http),i.external=new $(i.http),i.clientSettings=new K(i.http),i.portalSettings=new st(i.http),i.iceRouter=new fe(i.http),i.statistic=new bt(i.http),i.feedback=new te(i.http),i.vectorTiles=new Ut(i.http),i.universalSearch=new I(i.http),i.spatialReference=new P(i.http),i.eql=new Y(i.http),i.catalog=new C(i.http),i.queryToken=new T(i.http),i.dataSource=new w(i.http),i.remoteTaskManager=new ht(i.http),i.names=new Ye({account:i.account}),i.snappingHub=h?(new s.HubConnectionBuilder).withUrl(h,{withCredentials:!0,skipNegotiation:!0,transport:s.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,i}return l(o,[{key:"init",value:async function(e){let{authParams:t,authQueryParams:n,connectWs:r,fetchSettings:s,fetchUser:o,useJwt:i}=e;try{await this.account.login(t,n,i),o&&await this.account.fetchCurrentUser(),r&&await this.connectWs(),s&&await this.clientSettings.fetchClientSettings({urlPath:Je(this.urlPath)}),await this.notification.subscribe("service_update")}catch(e){throw Ve(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 Ve(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!==s.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:"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:Ot}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}},{key:"isPresentation",get:function(){return this.urlPath===exports.UrlPath.Presentation||"8082"===window.location.port}}]),o}();var Mt,_t,qt,Gt,Wt,Ht,Vt,zt,Qt,Jt,Kt,Xt,Yt,Zt,$t,en,tn,nn,rn,sn,on,un,an,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn,bn,xn,Sn;(Mt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Mt.Array="Array",Mt.Min="Min",Mt.Max="Max",Mt.Avg="Avg",Mt.Sum="Sum",Mt.Extent="Extent",Mt.H3="H3",Mt.Count="Count",Mt.TotalCount="TotalCount",Mt.DistinctCount="DistinctCount",Mt.First="First",Mt.Last="Last",Mt.Median="Median",Mt.Mod="Mod",Mt.StdDeviation="StdDeviation",Mt.SumOfProduct="SumOfProduct",Mt.OnlyValue="OnlyValue",Mt.WeightedAvg="WeightedAvg",Mt.DensityIndicators="DensityIndicators",Mt.DividedSum="DividedSum",(_t=exports.AttributeIconType||(exports.AttributeIconType={})).Unknown="Unknown",_t.Icon="Icon",_t.PNG="PNG",_t.SVG="SVG",(qt=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",qt.SelectFromHandBook="SelectFromHandBook",qt.SelectFromRange="SelectFromRange",qt.ViewHandBook="ViewHandBook",(Gt=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Gt.String="String",Gt.Int32="Int32",Gt.Int64="Int64",Gt.Double="Double",Gt.DateTime="DateTime",Gt.Boolean="Boolean",Gt.Point="Point",Gt.Polyline="Polyline",Gt.MultiPolygon="MultiPolygon",Gt.Multipoint="Multipoint",Gt.H3Index="H3Index",Gt.Json="Json",(Wt=exports.AuthorizationGrant||(exports.AuthorizationGrant={})).AuthorizationCode="authorization_code",Wt.RefreshToken="refresh_token",(Ht=exports.CatalogResourceType||(exports.CatalogResourceType={})).None="None",Ht.Map="Map",Ht.Layer="Layer",Ht.Table="Table",Ht.File="File",Ht.TaskPrototype="TaskPrototype",Ht.DataSource="DataSource",(Vt=exports.ClassificationType||(exports.ClassificationType={})).None="none",Vt.NaturalBreaks="naturalBreaks",Vt.EqualInterval="equalInterval",Vt.Quantile="quantile",Vt.Unique="unique",(zt=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",zt.DateTime="dateTime",zt.Text="text",(Qt=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",Qt.SerializeError="SerializeError",Qt.InvalidDataService="InvalidDataService",Qt.InvalidConfiguration="InvalidConfiguration",Qt.InvalidDataServiceName="InvalidDataServiceName",Qt.InvalidTableName="InvalidTableName",Qt.InvalidLayerName="InvalidLayerName",Qt.ResourceNotFound="ResourceNotFound",Qt.InvalidCondition="InvalidCondition",Qt.InvalidAttributes="InvalidAttributes",Qt.InvalidIdAttribute="InvalidIdAttribute",Qt.InvalidGeometryAttribute="InvalidGeometryAttribute",Qt.InvalidGeometryAttributeType="InvalidGeometryAttributeType",Qt.InvalidColumnName="InvalidColumnName",Qt.InvalidIdColumnSettings="InvalidIdColumnSettings",Qt.ColumnNotExistsInTable="ColumnNotExistsInTable",Qt.InvalidStyle="InvalidStyle",Qt.InvalidLayerType="InvalidLayerType",Qt.ColumnLoadingError="ColumnLoadingError",Qt.InvalidAttributeFormat="InvalidAttributeFormat",Qt.DataSourceNotFound="DataSourceNotFound",Qt.DuplicateColumns="DuplicateColumns",Qt.DuplicateAttributes="DuplicateAttributes",Qt.TableWithoutColumns="TableWithoutColumns",Qt.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(Jt=exports.DataSourceType||(exports.DataSourceType={})).Postgres="Postgres",Jt.Trino="Trino",Jt.S3="S3",Jt.GisServer="GisServer",(Kt=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Kt.ResourceNotFound="ResourceNotFound",Kt.InternalError="InternalError",Kt.BadRequest="BadRequest",Kt.DuplicateContent="DuplicateContent",(Xt=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Xt.LimitError="LimitError",Xt.ValidationError="ValidationError",Xt.JwtExpired="JwtExpired",Xt.TokenInvalid="TokenInvalid",Xt.RefreshTokenExpired="RefreshTokenExpired",Xt.RefreshTokenInvalid="RefreshTokenInvalid",Xt.CreateUserFailed="CreateUserFailed",Xt.SetUserPasswordFailed="SetUserPasswordFailed",Xt.SetUserRoleFailed="SetUserRoleFailed",Xt.UpdateUserFailed="UpdateUserFailed",Xt.RemoveUserFailed="RemoveUserFailed",Xt.CreateRoleFailed="CreateRoleFailed",Xt.UpdateRoleFailed="UpdateRoleFailed",Xt.RemoveUserRoleFailed="RemoveUserRoleFailed",Xt.ChangeActiveStateFailed="ChangeActiveStateFailed",Xt.RemoveRoleFailed="RemoveRoleFailed",Xt.UserNotFound="UserNotFound",Xt.RoleNotFound="RoleNotFound",Xt.EmailNotConfirmed="EmailNotConfirmed",Xt.DuplicateEmailError="DuplicateEmailError",Xt.InvalidPassword="InvalidPassword",Xt.RoleExists="RoleExists",Xt.UserExists="UserExists",Xt.UserLockedError="UserLockedError",Xt.InvalidEmail="InvalidEmail",Xt.InvalidUsername="InvalidUsername",Xt.Unauthorized="Unauthorized",Xt.EmailNotChanged="EmailNotChanged",Xt.EmailNotSet="EmailNotSet",(Yt=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",Yt.GeometricFeature="GeometricFeature",(Zt=exports.FontStyle||(exports.FontStyle={})).Normal="normal",Zt.Oblique="oblique",Zt.Italic="italic",($t=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",$t.ExtraLight="ExtraLight",$t.Light="Light",$t.SemiLight="SemiLight",$t.Normal="Normal",$t.Medium="Medium",$t.DemiBold="DemiBold",$t.Bold="Bold",$t.ExtraBold="ExtraBold",$t.Black="Black",$t.ExtraBlack="ExtraBlack",(en=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",en.Point="point",en.Polyline="polyline",en.Polygon="multipolygon",en.Envelope="envelope",en.Multipoint="multipoint",(tn=exports.Group||(exports.Group={})).My="my",tn.Role="role",tn.Public="public",tn.All="all",(nn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",nn.Square="Square",nn.Round="Round",nn.Triangle="Triangle",(rn=exports.LineEndingType||(exports.LineEndingType={})).None="none",rn.Arrow="arrow",rn.FilledArrow="filledArrow",rn.Square="square",rn.FilledSquare="filledSquare",rn.Circle="circle",rn.FilledCircle="filledCircle",rn.Diamond="diamond",rn.FilledDiamond="filledDiamond",rn.RoundSquare="roundSquare",rn.FilledRoundSquare="filledRoundSquare",rn.Svg="svg",(sn=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",sn.Bevel="Bevel",sn.Round="Round",(on=exports.Operation||(exports.Operation={})).Unknown="Unknown",on.Union="union",on.Intersection="intersection",on.Subtraction="subtraction",on.SymDifference="symDifference",(un=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",un.Shared="Shared",un.Public="Public",(an=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",an.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",cn.MaxEqlQueryParametersValues="MaxEqlQueryParametersValues",(pn=exports.Quality||(exports.Quality={})).Low="Low",pn.Medium="Medium",pn.High="High",(hn=exports.ResourceSubTypeFilter||(exports.ResourceSubTypeFilter={})).RemoteTileService="RemoteTileService",hn.ProxyService="ProxyService",hn.PostgresLayerService="PostgresLayerService",hn.QueryLayerService="QueryLayerService",hn.TileCatalogTable="TileCatalogTable",(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",yn.DataSource="datasource",(fn=exports.ResourceTypeFilter||(exports.ResourceTypeFilter={})).Map="Map",fn.Layer="Layer",fn.Table="Table",fn.RasterCatalog="RasterCatalog",fn.ProxyService="ProxyService",fn.RemoteTileService="RemoteTileService",fn.File="File",fn.DataSource="DataSource",(vn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",vn.Layer="layers",vn.Project="projects",(dn=exports.ResponseType||(exports.ResponseType={})).Code="code",dn.Token="token",(kn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",kn.PreserveTopology="PreserveTopology",kn.VW="VW",(gn=exports.StringSubType||(exports.StringSubType={})).None="None",gn.Image="Image",gn.PkkCode="PkkCode",gn.Attachments="Attachments",(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",(xn=exports.WorkerMethodType||(exports.WorkerMethodType={})).Task="Task",xn.Rest="Rest",xn.Both="Both",(Sn=exports.WorkerSettingsFieldType||(exports.WorkerSettingsFieldType={})).Integer="Integer",Sn.Double="Double",Sn.String="String",Sn.Extent="Extent",Sn.Geometry="Geometry",Sn.IntergerArray="IntergerArray",Sn.DoubleArray="DoubleArray",Sn.StringArray="StringArray",Sn.Boolean="Boolean",Sn.SourceEql="SourceEql",Sn.Layer="Layer",Sn.Table="Table",Sn.Folder="Folder",Sn.Json="Json",Sn.Expression="Expression",Sn.Expressions="Expressions",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=A,exports.AccountPreview=O,exports.Api=Bt,exports.BulkOperations=M,exports.Cameras=Q,exports.ClientSettings=K,exports.Eql=Y,exports.External=$,exports.Feedback=te,exports.FileUpload=re,exports.Filters=oe,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=ue,exports.Geocode=he,exports.HttpClient=m,exports.IceRouter=fe,exports.Import=de,exports.Layers=We,exports.Names=Ye,exports.Namespace=$e,exports.Notification=nt,exports.NotificationEvent=rt,exports.PortalSettings=st,exports.Print=it,exports.Projects=lt,exports.RemoteTaskManager=ht,exports.ResourceCatalog=ft,exports.Resources=dt,exports.STORAGE_REFRESH_TOKEN_KEY="evergis-refresh-token",exports.STORAGE_TOKEN_KEY="evergis-jwt-token",exports.Security=gt,exports.Statistic=bt,exports.Styles=St,exports.Tables=It,exports.Tools=Lt,exports.VectorTiles=Ut,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Ve,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=Xe,exports.getFetchingUrlPath=Je,exports.isHTTPError=e=>ze(e)&&"http"===e.type,exports.isHandledError=ze,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Qe,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.parseJwt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(e=>"%"+"00".concat(e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(n)},exports.promiseAllIgnoreErrors=Be,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=S,exports.unique=Ke;
|
|
2
2
|
//# sourceMappingURL=api.cjs.production.min.js.map
|