/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"./GeoEventConnection.js";import{WebSocketConnection as t}from"./WebSocketConnection.js";import{ClientSideConnection as n}from"../../../support/ClientSideConnection.js";function o(e,t){if(null==e&&null==t)return null;const n={};return null!=t&&(n.geometry=t),null!=e&&(n.where=e),n}function r(r,i,s,c,l,u,a,m,p){const f={source:r,sourceSpatialReference:i,spatialReference:s,geometryType:c,filter:o(l,u),maxReconnectionAttempts:a,maxReconnectionInterval:m,customParameters:p};if(!r)return new n(f);return r.path.startsWith("wss://")||r.path.startsWith("ws://")?new t(f):new e(f)}export{r as createConnection};
