/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{simulationSettingsEqual as t}from"../../../support/flow/utils.js";function o(t){const o=t.toRgba();return[o[0]/255,o[1]/255,o[2]/255,o[3]]}function n(t){return{kind:"constant",value:[.1,.1,.1,1]}}function e(t){if(!t.hasVisualVariables("color"))return{kind:"constant",value:o(t.color)};const n=t.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of n.stops)e.push(i.value),Array.prototype.push.apply(s,o(i.color));return{kind:"ramp",stops:e,values:s,count:n.stops.length}}function s(t){if(!t.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const o=t.getVisualVariablesForType("opacity")[0],n=[],e=[];for(const s of o.stops)n.push(s.value),e.push(s.opacity);return{kind:"ramp",stops:n,values:e,count:o.stops.length}}function i(t,o,n,e){switch(o){case"int":t.setUniform1iv(n,e);break;case"float":t.setUniform1fv(n,e);break;case"vec2":t.setUniform2fv(n,e);break;case"vec3":t.setUniform3fv(n,e);break;case"vec4":t.setUniform4fv(n,e)}}function a(t,o,n,e){"constant"===e.kind?i(t,n,`u_${o}`,e.value):(i(t,"float",`u_${o}_stops`,e.stops),i(t,n,`u_${o}_values`,e.values),t.setUniform1i(`u_${o}_count`,e.count))}function r(t,o){return t===o||null!=t&&null!=o&&t.equals(o)}function u(o,n){if(!t(o.simulationSettings,n.simulationSettings))return!1;if(!r(o.timeExtent,n.timeExtent))return!1;let e=!0;return e=e&&o.loadImagery===n.loadImagery,e=e&&o.createFlowMesh===n.createFlowMesh,e=e&&o.color.kind===n.color.kind,e=e&&o.opacity.kind===n.opacity.kind,e=e&&o.size.kind===n.size.kind,e}const c=36e5,l=3600;export{u as areStreamlinesCompatible,e as getColor,n as getForegroundColor,s as getOpacity,c as longSafetyTime,i as setUniform,a as setUniforms,l as shortMarginTime,r as timeExtentsEqual,o as toRgba};
