"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../animation/utils/is-css-variable.mjs.js"),r=require("../../value/types/color/index.mjs.js"),t=require("../../value/types/complex/index.mjs.js"),i=require("./color.mjs.js"),s=require("./immediate.mjs.js"),n=require("./number.mjs.js"),o=require("./visibility.mjs.js"),l=require("../../../../../motion-utils/dist/es/pipe.mjs.js"),a=require("../../../../../motion-utils/dist/es/errors.mjs.js");function u(e,r){return t=>n.mixNumber(e,r,t)}function m(t){return"number"==typeof t?u:"string"==typeof t?e.isCSSVariableToken(t)?s.mixImmediate:r.color.test(t)?i.mixColor:p:Array.isArray(t)?c:"object"==typeof t?r.color.test(t)?i.mixColor:x:s.mixImmediate}function c(e,r){const t=[...e],i=t.length,s=e.map(((e,t)=>m(e)(e,r[t])));return e=>{for(let r=0;r<i;r++)t[r]=s[r](e);return t}}function x(e,r){const t={...e,...r},i={};for(const s in t)void 0!==e[s]&&void 0!==r[s]&&(i[s]=m(e[s])(e[s],r[s]));return e=>{for(const r in i)t[r]=i[r](e);return t}}const p=(e,r)=>{const i=t.complex.createTransformer(r),n=t.analyseComplexValue(e),u=t.analyseComplexValue(r);return n.indexes.var.length===u.indexes.var.length&&n.indexes.color.length===u.indexes.color.length&&n.indexes.number.length>=u.indexes.number.length?o.invisibleValues.has(e)&&!u.values.length||o.invisibleValues.has(r)&&!n.values.length?o.mixVisibility(e,r):l.pipe(c(function(e,r){const t=[],i={color:0,var:0,number:0};for(let s=0;s<r.values.length;s++){const n=r.types[s],o=e.indexes[n][i[n]],l=e.values[o]??0;t[s]=l,i[n]++}return t}(n,u),u.values),i):(a.warning(!0,`Complex values '${e}' and '${r}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),s.mixImmediate(e,r))};exports.getMixer=m,exports.mixArray=c,exports.mixComplex=p,exports.mixObject=x;
//# sourceMappingURL=complex.mjs.js.map
