/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{S as e}from"../../../chunks/SimpleGeometryCursor.js";import{G as r}from"../../../chunks/GeometryCursor.js";import{E as t,n as s}from"../../../chunks/MultiPathImpl.js";import{G as o,h as n}from"../../../chunks/Geometry.js";import{Envelope2D as m}from"../../../chunks/Envelope2D.js";import{c as u}from"../../../chunks/Envelope.js";import{t as i,ay as l}from"../../../chunks/SpatialReference.js";class p{getOperatorType(){return 10008}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,r,t,s){const o=(new i).executeMany(e,t,s);return new c(o,r,t,s)}}class c extends r{m_polygons;m_polylines;m_resultPolygons=null;m_sr;m_progressTracker;m_bFirst;constructor(e,r,t,s){super(),this.m_polygons=e,this.m_polylines=r,this.m_sr=t,this.m_progressTracker=s,this.m_bFirst=!0}tock(){return!0}getRank(){return 1}next(){return this.m_bFirst&&(this.performOperation(),this.m_bFirst=!1),this.m_resultPolygons?this.m_resultPolygons.next():null}getGeometryID(){return null!=this.m_resultPolygons?this.m_resultPolygons.getGeometryID():-1}performOperation(){const e=new m,r=new t;let i,p=s;for(;i=this.m_polylines.next();){if(i.getGeometryType()!==o.enumPolyline||i.isEmpty())continue;p===s?p=r.addGeometry(i):r.appendGeometry(p,i);const t=new m;i.queryEnvelope(t),e.mergeEnvelope2D(t)}if(0===r.getTotalPointCount())return;for(;i=this.m_polygons.next();){if(!n(i.getGeometryType())||i.isEmpty())continue;const t=new m;i.queryEnvelope(t),e.mergeEnvelope2D(t),r.addGeometry(i)}const c=u(this.m_sr,e,!0);this.m_resultPolygons=l(r,p,c,this.m_progressTracker)}}const y=new p;function a(r,t,s){const o=y.execute(new e(r),new e(t),s,null);return Array.from(o)}function h(){return y.supportsCurves()}export{a as execute,h as supportsCurves};
