/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"../../../core/Collection.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import{mapCollection as i}from"../../../core/mapCollectionUtils.js";import n from"./FeatureSnappingLayerSource.js";import{defaults as r}from"./Settings.js";import o from"./SnappingOptions.js";const l=e.ofType(n);function a(e,a){const s=i(a?.excludeInternal?()=>e.map?.allLayers.filter(e=>!("internal"in e)||!e.internal):()=>e.map?.allLayers,e=>new n({layer:e}),{recycleItems:!0,createCollection:()=>new l}),c=new o({enabled:!0,selfEnabled:a?.selfEnabled??!1,featureEnabled:!0,featureSources:s,distance:a?.distance??r.distance,touchSensitivityMultiplier:a?.touchSensitivityMultiplier??r.touchSensitivityMultiplier});return{...t(s),options:c}}export{a as makeAllLayerSnappingOptions};
