var GenerateWebmapForReport_1;import{__decorate}from"tslib";import{ActivityInputError,ActivityNotImplementedError,GenericActivityError}from"../../Errors.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";let GenerateWebmapForReport=GenerateWebmapForReport_1=class{async execute(e,t,r){var a=validation.string("mapName",e.mapName,validation.never),o=validation.number("scale",e.scale,void 0);if(o<=0)throw new ActivityInputError("scale","Scale must be greater than zero.");const i=r.create();if(await i.load(),!i.map)throw new GenericActivityError("No map available. Unable to generate webmap parameters.");r=o||i.getScale(),e=e.extent||i.getExtent(),t=await this.getWebmap(i,r,t.ambient.trivia);return{result:{extent:await this.getWgs84Extent(e),mapName:a,scale:o||0,webmap:t}}}async getWebmap(e,t,r){throw console.warn("getWebmap needs to be overridden by a client implementation."),new ActivityNotImplementedError(GenerateWebmapForReport_1.action)}async getWgs84Extent(e){throw console.warn("getWgs84Extent needs to be overridden by a client implementation."),new ActivityNotImplementedError(GenerateWebmapForReport_1.action)}};GenerateWebmapForReport.action="gcx:wf:geocortex::GenerateWebmapForReport",GenerateWebmapForReport.suite="gcx:wf:builtin",GenerateWebmapForReport=GenerateWebmapForReport_1=__decorate([activate(MapProvider)],GenerateWebmapForReport);export{GenerateWebmapForReport};