"use strict";var e=require("postcss-value-parser");function hasFallback(e){const r=e.parent;if(!r)return!1;const s=e.prop.toLowerCase(),o=r.index(e);for(let e=0;e<o;e++){const o=r.nodes[e];if("decl"===o.type&&o.prop.toLowerCase()===s)return!0}return!1}const creator=r=>{const s=Object.assign({preserve:!1},r);return{postcssPlugin:"postcss-color-rebeccapurple",Declaration(r){if(!r.value.toLowerCase().includes("rebeccapurple"))return;if(hasFallback(r))return;const o=e(r.value);o.walk((e=>{"word"===e.type&&"rebeccapurple"===e.value.toLowerCase()&&(e.value="#639")}));const t=String(o);t!==r.value&&(r.cloneBefore({value:t}),s.preserve||r.remove())}}};creator.postcss=!0,module.exports=creator;
