/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/maybe","../../../../chunks/vec4f64","../support/edgeUtils","../support/symbolColorUtils"],(function(e,r,o,l,a){"use strict";var i;e.FilterModeEnum=void 0,(i=e.FilterModeEnum||(e.FilterModeEnum={}))[i.Solid=0]="Solid",i[i.WireFrame=1]="WireFrame",i[i.XRay=2]="XRay";const t=.15,d=.5*t;function c(r){switch(r.filterMode.type){case"solid":return{mode:e.FilterModeEnum.Solid};case"wire-frame":return{mode:e.FilterModeEnum.WireFrame,edgeMaterial:l.createMaterialFromEdges(r.filterMode.edges,{})};case"x-ray":return{mode:e.FilterModeEnum.XRay}}}function n(o,l){if(r.isNone(l))return o.color[3]=0,o.edgeMaterial=null,void(o.pickable=!1);switch(l.mode){case e.FilterModeEnum.Solid:return;case e.FilterModeEnum.WireFrame:return o.color[3]=0,o.edgeMaterial=l.edgeMaterial,void(o.pickable=!1);case e.FilterModeEnum.XRay:return o.color[0]=1,o.color[1]=1,o.color[2]=1,o.color[3]*=t,o.colorMixMode=a.ColorMixModeEnum.Replace,o.castShadows=!1,o.pickable=!1,void(o.edgeMaterial=u(o.edgeMaterial))}}function u(e){return r.isNone(e)?null:(M.lastMaterial!==e&&(M.cachedMaterial=s(e),M.lastMaterial=e),M.cachedMaterial)}function s(e){const r=o.clone(e.color);return r[3]*=d,{...e,color:r}}const M={cachedMaterial:null,lastMaterial:null};e.applyFilterMode=n,e.parseFilterMode=c,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
