{"version":3,"file":"addSpecificity.cjs","names":["addSpecificity","specificityCount","selector","ampersands","repeat","exports"],"sources":["../../../src/tools/addSpecificity.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Adds CSS specificity to class selectors by prepending a specified number of ampersands. This function helps override MUI component styles by increasing selector specificity.\n *\n * @param {number} specificityCount - Number of ampersands to prepend (e.g., 2 results in \"&&\")\n * @param {string} selector - The selector string to add specificity to.\n *                            Include spaces in the selector if needed for descendant selectors.\n * @returns {string} The selector with added specificity\n *\n * @example\n * // Direct selector: \"&&.MuiButton-root\"\n * addSpecificity(2, \".MuiButton-root\")\n *\n * // Descendant selector: \"&& .MuiButton-root\"\n * addSpecificity(2, \" .MuiButton-root\")\n *\n * // Direct selector with class reference:\n * addSpecificity(2, `.${buttonClasses.root}`)\n *\n * // Descendant selector with class reference:\n * addSpecificity(2, ` .${buttonClasses.root}`)\n *\n * // Combined selector: \"&&.MuiButton-root:hover\"\n * addSpecificity(2, \".MuiButton-root:hover\")\n */\nexport const addSpecificity = (\n  specificityCount: number,\n  selector: string,\n): string => {\n  const ampersands = \"&\".repeat(specificityCount);\n  return `${ampersands}${selector}`;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA0BO,MAAMA,cAAc,GAAGA,CAC5BC,gBAAwB,EACxBC,QAAgB,KACL;EACX,MAAMC,UAAU,GAAG,GAAG,CAACC,MAAM,CAACH,gBAAgB,CAAC;EAC/C,OAAO,GAAGE,UAAU,GAAGD,QAAQ,EAAE;AACnC,CAAC;AAACG,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}