!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","../../Errors","./MapProvider","../../Hooks","../../Validation"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,p=e("tslib"),d=e("../../Errors"),r=e("./MapProvider"),o=e("../../Hooks"),l=e("../../Validation"),r=((n=i).prototype.execute=function(c,s,u){return p.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,a;return p.__generator(this,function(e){switch(e.label){case 0:if(t=l.validation.string("mapName",c.mapName,l.validation.never),(r=l.validation.number("scale",c.scale,void 0))<=0)throw new d.ActivityInputError("scale","Scale must be greater than zero.");return[4,(n=u.create()).load()];case 1:if(e.sent(),!n.map)throw new d.GenericActivityError("No map available. Unable to generate webmap parameters.");return o=r||n.getScale(),i=c.extent||n.getExtent(),[4,this.getWebmap(n,o,s.ambient.trivia)];case 2:return a=e.sent(),[4,this.getWgs84Extent(i)];case 3:return[2,{result:{extent:e.sent(),mapName:t,scale:r||0,webmap:a}}]}})})},i.prototype.getWebmap=function(e,t,r){return p.__awaiter(this,void 0,void 0,function(){return p.__generator(this,function(e){throw console.warn("getWebmap needs to be overridden by a client implementation."),new d.ActivityNotImplementedError(n.action)})})},i.prototype.getWgs84Extent=function(e){return p.__awaiter(this,void 0,void 0,function(){return p.__generator(this,function(e){throw console.warn("getWgs84Extent needs to be overridden by a client implementation."),new d.ActivityNotImplementedError(n.action)})})},i.action="gcx:wf:geocortex::GenerateWebmapForReport",i.suite="gcx:wf:builtin",n=p.__decorate([o.activate(r.MapProvider)],i));function i(){}t.GenerateWebmapForReport=r});