@evergis/api 3.0.159 → 3.0.162

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