/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{getDefaultUnitSystem as t}from"../core/units.js";import r from"../portal/Portal.js";function e(e){const n="metric";if(!e)return n;const{map:i}=e,o=(i&&"portalItem"in i?i.portalItem?.portal:null)??r.getDefault();switch(o.user?.units??o.units){case n:return n;case"english":return"imperial"}return t(e.spatialReference)??n}export{e as getDefaultUnitForView};
