/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{execute as e,executeMany as o,load as t,isLoaded as r}from"../gx/operatorProject.js";import{applyZConversionAfterProjection as n}from"../support/projectionZScaling.js";import{isMesh as s}from"../../support/jsonTypeUtils.js";let a,i,p,c,f,m;function l(){return!!a&&r()}async function u(){if(!l()){const[e,o]=await Promise.all([import("../support/jsonConverter.js"),import("../support/projectionTransformation.js"),t()]);a=e.fromGeometries,i=e.fromGeometry,p=e.fromSpatialReference,c=e.toGeometry,f=e.getSpatialReference,m=o.createProjectionTransformation}}function j(o,t,r){const a=i(o),f=p(t),l=m(a.getSpatialReference(),f,r),u=c(e(a.getGeometry(),l),f);return!r?.zConversionDisabled&&u&&!s(u)&&o.spatialReference&&n([u],o.spatialReference,t),u}function y(e,t,r){const[s,i]=a(e),l=p(t),u=m(i,l,r),j=o(s,u).map(e=>c(e,l));if(!r?.zConversionDisabled&&j){const o=f(e);o&&n(j,o,t)}return j}export{j as execute,y as executeMany,l as isLoaded,u as load};
