/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import e from"../../core/Error.js";import{getTemplates as r}from"./classBreaks.js";import{getTemplates as t}from"./dotDensity.js";import{getTemplates as n}from"./heatmap.js";import{getTemplates as a}from"./predominance.js";import{getTemplates as s}from"./relationship.js";import{getTemplates as o}from"./simple.js";import{getTemplates as i}from"./uniqueValues.js";function p(r){const{layer:t}=r,n=r.renderer??("renderer"in t?t.renderer:void 0);if(!n)throw new e("getTemplates:invalid-parameters","'renderer' or 'layer.renderer' must be provided");return{layer:t,renderer:n}}async function l(e){const{renderer:l,layer:m}=p(e);if(!l)return null;if("simple"===l.type)return o({renderer:l,layer:m});if("class-breaks"===l.type)return r({renderer:l,layer:m});if("dot-density"===l.type)return t({renderer:l,layer:m});if("heatmap"===l.type)return n({renderer:l,layer:m});if("unique-value"===l.type){const e=l.authoringInfo?.type;return"predominance"===e?a({renderer:l,layer:m}):"relationship"===e?s({renderer:l,layer:m}):i({renderer:l,layer:m})}return null}export{l as getTemplates};
